sgpt
sgpt copied to clipboard
feat: add install-sgpt-pkg.sh script - with keybindings, auto-update, uninstaller
- Introduce a comprehensive shell script to install, update, and uninstall sgpt on Ubuntu/Debian systems.
- Configure key binding (Ctrl+L) for quick access to Shell-GPT functionality.
- Automatically fetch the latest release from GitHub and handle version comparisons.
- Patch system-wide shell configuration files (/etc/profile and /etc/bash.bashrc) to integrate sgpt settings.
- Include command-line options for force installation, uninstallation, and displaying help.
This commit adds robust automation and system integration for Shell-GPT, ensuring a smooth user experience on supported systems.
After installation, sgpt can be used with different presets defined in a user-specific configuration file. Each preset can include:
- Custom API endpoint (e.g., OpenAI, OpenRouter),
-
Model name (e.g.,
gpt-4.1-mini,claude-3.7-sonnet), - User-specific API key,
- Additional flags (e.g., for streaming, long context).
This allows every user on the system to define and use their own AI setup — with complete flexibility over providers, models, context lengths, and access keys.
▶️ Installation
# install or update to the latest sgpt
sudo python3 install-sgpt-pkg.py [OPTION]
Options:
| Option | Description |
|---|---|
--help |
Show usage instructions |
--force-install |
Force installation of the latest version |
--uninstall |
Uninstall sgpt and remove all configuration and integration files |
🛡️ Security Notes
- File permissions are set strictly (
chmod 0600for config,0755for scripts) - No default API keys included
- User is prompted to edit the config manually
- config survives updates and new installations
- environment is not bloated with keys
- every user on the system can have a different configuration
After install You might login into a new terminal and use :
# Input:
show all files > 8kB <cntrl-L>
# Output :
find . -type f -size +8k
# which You can exec just by pressing enter
# using a preset configuration (otherwise preset "default" is used.
sgpt -p mini "what is the mass of the sun"
sgpt -p claude "what is the mass of the sun"