Official command-line client for GhostGPT API at https://api.ghostgpt.live.
ghost-forge-cli is an operator-friendly wrapper around your OpenAI-compatible endpoints:
POST /v1/chat/completionsGET /v1/models
It is built for your project flow (API key auth with ghost_... keys) and supports:
- one-shot prompt generation,
- interactive chat,
- model discovery,
- local session history.
- Linux/macOS with Python 3.10+
- API key from your GhostGPT dashboard (
ghost_...)
From the project root:
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install .This installs the command:
ghost-forge --helpDefaults are auto-created on first run:
api_base_url:https://api.ghostgpt.livetimeout:120
If no API key is found, the CLI will prompt once and save it.
ghost-forge config set -u https://api.ghostgpt.live -k ghost_your_real_key -t 120Check config:
ghost-forge config showexport GHOSTGPT_API_BASE_URL="https://api.ghostgpt.live"
export GHOSTGPT_API_KEY="ghost_your_real_key"List models available to your key and plan.
ghost-forge modelsExample output:
Available models
- ghost-nano
- ghost-pro
One-shot non-stream completion.
ghost-forge generate "Write a secure nginx config for SSE proxying"With options:
ghost-forge generate \
"Draft a Python retry wrapper for requests" \
-m ghost-pro \
-n 1400 \
-T 0.2 \
-o ./output.txtInteractive REPL-style prompt loop.
ghost-forge chat -m ghost-nano -n 1024Exit with exit or quit.
The CLI stores local history at:
~/.local/share/ghost-forge/session.json
Show history:
ghost-forge history show --limit 20Clear history:
ghost-forge history clearThe CLI posts to:
https://api.ghostgpt.live/v1/chat/completions
Request shape:
{
"model": "ghost-nano",
"messages": [{"role": "user", "content": "Hello"}],
"stream": false,
"max_tokens": 1024,
"temperature": 0.2
}Headers:
Authorization: Bearer ghost_xxx
Content-Type: application/jsonModel listing call:
GET https://api.ghostgpt.live/v1/models
# 1) Configure key once
ghost-forge config set -k ghost_xxx -u https://api.ghostgpt.live
# 2) Check model entitlements
ghost-forge models
# 3) Generate a one-shot answer
ghost-forge generate "Create a FastAPI endpoint with pydantic validation" -m ghost-nano
# 4) Start an interactive session
ghost-forge chat -m ghost-proSet one via:
ghost-forge config set --api-key ghost_xxx- Verify key prefix is
ghost_ - Ensure key is active in your backend/dashboard
Your key plan cannot access requested model. Use ghost-forge models to see available IDs.
Free-tier or throttle policy hit in your API backend.
Longer generations can exceed the client timeout. Increase it globally or per command:
ghost-forge config set -t 180
# or one-off
ghost-forge -t 180 generate "Your prompt"ghost-forge --help
ghost-forge config show
ghost-forge config set -k ghost_xxx -u https://api.ghostgpt.live
ghost-forge models
ghost-forge generate "Your prompt"
ghost-forge chat
ghost-forge history show -l 20
ghost-forge history clear