Running ChatGPT directly in your terminal sounds amazing⦠until you try to set it up on Kali Linux.
I recently built a ShellGPT Kali Installer to solve exactly that problem β turning a messy setup process into a clean, reproducible workflow.
π‘ The Problem
If you've tried installing ShellGPT (shell-gpt) on Kali Linux, youβve probably hit issues like:
- β Broken APT repositories (
<!doctype html>errors) - β Python / pip / venv conflicts
- β
sgpt: command not found - β PATH misconfiguration
- β API key confusion (OpenAI vs OpenRouter)
- β Inconsistent environments across machines
Instead of fixing these one by one every timeβ¦
π I decided to automate everything.
βοΈ The Solution β ShellGPT Kali Installer
This project provides a fully automated installer that sets up ShellGPT correctly on Kali Linux.
π What it does
The installer handles:
- β APT repository cleanup and repair
- β Dependency installation (Python, pip, venv, git, curl)
- β Virtual environment setup
- β ShellGPT installation
- β Global
sgptCLI command - β PATH configuration (bash + zsh)
- β API configuration guidance
- β Clean and reproducible setup
β‘ One-Line Installation
curl -fsSL https://raw.githubusercontent.com/shahbaaz-devsec/shellgpt-kali-installer/main/scripts/shellgpt_kali_installer.sh | bash
`
π¦ Manual Installation
bash
git clone https://github.com/shahbaaz-devsec/shellgpt-kali-installer.git
cd shellgpt-kali-installer
chmod +x scripts/shellgpt_kali_installer.sh
./scripts/shellgpt_kali_installer.sh
βΆοΈ After Installation
bash
export PATH="$HOME/.local/bin:$PATH"
sgpt --help
Test it:
bash
sgpt "what is privilege escalation"
π API Setup (Important)
ShellGPT requires an API key.
OpenAI
bash
export OPENAI_API_KEY="your_openai_api_key"
OpenRouter (recommended alternative)
bash
export OPENAI_API_KEY="your_openrouter_api_key"
export OPENAI_API_BASE="https://openrouter.ai/api/v1"
π§ Example Usage
`bash
General questions
sgpt "explain DNS"
Generate shell commands
sgpt --shell "list open ports"
Generate code
sgpt --code "python port scanner"
Explain commands
sgpt --describe-shell "nmap -sV 127.0.0.1"
`
π Real Issues This Fixes
This project was built after encountering real-world problems:
- Kali repo corruption
- Broken Python environments
- Missing PATH exports
- API quota confusion
- Installation inconsistencies
Instead of patching each issue manually, the installer solves them at the root level.
π Project Structure
`text
scripts/
βββ shellgpt_kali_installer.sh
docs/
βββ 01-installation.md
βββ 02-usage.md
βββ 03-openrouter-setup.md
βββ 04-troubleshooting.md
βββ 05-clean-reset.md
`
π― What I Learned
Building this wasnβt just about installing a tool.
It was about:
- Designing reproducible environments
- Handling real-world Linux edge cases
- Improving developer experience (DX)
- Writing documentation that actually helps
- Thinking like a DevSecOps engineer
π Disclaimer
ShellGPT can generate shell commands.
π Always review commands before running them.
π Use only in authorized environments.
π¦ Repository
π https://github.com/shahbaaz-devsec/shellgpt-kali-installer
π Whatβs Next
Iβm currently building:
π PentestGPT Kali Installer (AI-powered pentesting automation)
Top comments (0)