A Python-based terminal assistant for Linux administration and security research workflows.
  • Python 84.2%
  • Shell 15.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Andrew Witulski b7fd215dfd more portability
2026-06-10 08:16:13 -04:00
bin portability 2026-06-10 08:11:04 -04:00
config/cgpt more portability 2026-06-10 08:16:13 -04:00
.gitignore Sanitize public context examples 2026-06-10 06:50:12 -04:00
install.sh more portability 2026-06-10 08:16:13 -04:00
LICENSE Initial commit 2026-06-10 06:40:28 -04:00
README.md README update 2026-06-10 07:30:06 -04:00
requirements.txt more portability 2026-06-10 08:16:13 -04:00

cgpt-terminal

Personal terminal wrapper for the OpenAI API.

Files

  • bin/cgpt - terminal assistant script
  • config/cgpt/context.md - lightweight default context
  • config/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