A lightweight AI Command Line Interface powered by OpenRouter API.
This project provides a clean terminal-based AI interaction system with:
- Language selection (English / Indonesian)
- Session memory
- Token limiting
- API key validation
- Configurable model
- Clean terminal UI
- Python 3.9+
- Git
- Internet connection
- OpenRouter API key
This project uses Git for installation across Windows, Linux, macOS, and Android (Termux).
Download from: https://git-scm.com/
git clone https://github.com/jailideaid/WormGPT-V2.0
cd WormGPT-V2.0pip install -r requirements.txtpython main.pysudo apt update
sudo apt install git python3 python3-pip -ygit clone https://github.com/jailideaid/WormGPT-V2.0
cd WormGPT-V2.0pip3 install -r requirements.txtpython main.pyDownload from: https://brew.sh/
brew install git pythongit clone https://github.com/jailideaid/WormGPT-V2.0
cd WormGPT-V2.0pip3 install -r requirements.txtpython3 main.pyFrom F-Droid (recommended).
pkg update
pkg install git python -y
pip install -r requirements.txtgit clone https://github.com/jailideaid/WormGPT-V2.0
cd WormGPT-V2.0
python main.pyWhen first running the program, it will ask for your OpenRouter API key.
You can create an account on the https://openrouter.ai page and create a key.
The key is stored locally at:
mainAI/.apikey
You can manually edit it anytime.
⚠ Never upload .apikey to GitHub.
Add this to .gitignore:
mainAI/.apikey
After API key verification, you will select:
- Bahasa Indonesia
- English
The system enforces response language strictly using system prompts.
All interface text adapts to the selected language.
Edit:
mainAI/config.json
Example:
{
"base_url": "https://openrouter.ai/api/v1",
"model": "mistralai/mistral-7b-instruct",
"site_url": "http://localhost",
"site_name": "WormGPT CLI"
}You can change the model anytime.
Each language has its own system prompt file:
mainAI/system-prompts/
en.txt
id.txt
When language is selected, the corresponding file is loaded and sent as the system message.
Each request sends:
- System prompt
- Chat history (limited)
- Current user input
To OpenRouter API using:
POST /chat/completions
- Chat history is stored in memory during runtime.
- Limited to prevent token overflow.
- Automatically trims old messages.
- Not persistent after program closes.
The system uses:
max_tokensfor response limit- History trimming to avoid context overflow
This prevents:
- API errors
- Context length exceeded
- Excess cost
Before entering chat mode:
- The key is validated via OpenRouter auth endpoint.
- If invalid → user is prompted again.
- If valid → stored locally.
| Error | Meaning |
|---|---|
| 401 | Invalid API key |
| 429 | Rate limit (usually free model) |
| Context length exceeded | Too many tokens |
If using free-tier models, temporary 429 errors may occur.
wormgpt-cli/
│
├── mainAI/
│ ├── main.py
│ ├── ai_client.py
│ ├── config.json
│ ├── .apikey (automatically creates a file when the key is entered!)
│ └── system-prompts/
│ ├── en.txt
│ └── id.txt
│
└── README.md
- Persistent memory (cross-session)
- Auto-summarization
- Cost tracking
- Multi-model switch
- Plugin architecture
This project is intended for:
- Learning API integration
- Understanding CLI architecture
- Experimenting with language enforcement
- Building AI tools responsibly
Use your API key securely, do not share it publicly.
- don't misuse AI for personal gain to satisfy your crimes.
- You can use wormgpt wisely without having to do or violate anything.
- I am not responsible for that. Thank you for your support by favoriting this repository and following it.
If you use https://openrouter.ai with a free key, if you are hit by a token limit, I suggest changing to another free model or upgrading your key by subscribing.
Built for experimentation and CLI-based AI interaction. Use responsibly.