A Python-based terminal assistant for Linux administration and security research workflows.
- Python 84.2%
- Shell 15.8%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| bin | ||
| config/cgpt | ||
| .gitignore | ||
| install.sh | ||
| LICENSE | ||
| README.md | ||
| requirements.txt | ||
cgpt-terminal
Personal terminal wrapper for the OpenAI API.
Files
bin/cgpt- terminal assistant scriptconfig/cgpt/context.md- lightweight default contextconfig/cgpt/security-deep.md- optional deeper security research context
Install
./install.sh
export OPENAI_API_KEY="your_key_here"
export CGPT_NOTES_DIR="$HOME/Obsidian/Security/AI"
python3 -m venv ~/.venvs/openai-cli
source ~/.venvs/openai-cli/bin/activate
pip install --upgrade openai rich
Notes directory
By default, saved notes go to:
~/Notes/cgpt
To change the notes directory, set:
export CGPT_NOTES_DIR="$HOME/Obsidian/Security/AI"
Add it to your shell config:
echo 'export CGPT_NOTES_DIR="$HOME/Obsidian/Security/AI"' >> ~/.zshrc
source ~/.zshrc
Example usage
Ask a normal question:
cgpt "what is IDOR?"
Use brief mode:
cgpt -b "explain this error"
Use a project scope file:
cgpt -c ./scope.md "what should I test next?"
Save and open a note in Obsidian:
cgpt --save --open "summarize this into an Obsidian note"
Suggested aliases
Add these to ~/.zshrc:
alias cq='cgpt -b --max-output-tokens 250'
alias cb='cgpt -b --max-output-tokens 400'
alias csec='cgpt -c ~/.config/cgpt/security-deep.md'
alias cscope='cgpt -c ./scope.md'
alias cnote='cgpt --save --open'
alias csnote='cgpt -c ./scope.md --save --open'
Reload your shell:
source ~/.zshrc