A fast, streaming, multi-provider terminal AI chat client with codebase awareness.
Project description
q — Production Terminal AI Assistant with Codebase Awareness
q is a fast, production-grade command-line AI client supporting Google Gemini, OpenAI, and Anthropic (Claude) with Codebase Awareness, Piped STDIN Input, Real-Time Live Markdown Rendering, and Fast Provider/Model Switching.
Powerful Codebase & UNIX Features
- 📂 Codebase Awareness (
-c / --codebase): Indexes project structure and source code files into prompt context (q -c "how is config loaded"). - 📄 File Inclusion (
-f / --file): Attach a specific file to your query (q -f q/cli.py "explain the main function"). - ⚡ Piped STDIN Input: Pipe command outputs or file contents straight into
q(cat file.py | q "explain this",git diff | q "review these changes"). - 🎨 Real-Time Live Markdown Rendering: Uses
richto render bold text, code blocks with syntax highlighting, blockquotes, headings, and bullet points live as the AI streams tokens. - 🔑 Multi-Provider BYOK (Bring Your Own Key): Native support for Google Gemini, OpenAI, and Anthropic.
- 🚀 Fast Provider & Model Switching: Switch providers or models on the fly using CLI flags (
q -p anthropic ...,q -m gpt-4o ...) or interactive slash commands (/provider,/model). - 💬 Interactive Chat REPL: Run
qwith no arguments to start a multi-turn conversation session with context memory.
Installation
pip install -e .
Now you can run q from anywhere in your terminal!
Usage Examples
1. Codebase Awareness & File Inclusion
# Ask questions about your entire codebase
q -c how does configuration loading work
# Attach a specific file
q -f q/cli.py explain the main CLI loop
2. UNIX Pipe STDIN Support
cat setup.py | q explain this setup file
git diff | q review these code changes
3. Direct Questions & Fast Provider Overrides
q why is the sky blue
q -p anthropic explain quantum computing
q -p openai -m gpt-4o write a python script
4. Interactive Chat REPL
q
Command Line Flags
| Flag | Shortcut | Description | Example |
|---|---|---|---|
--codebase |
-c |
Include project codebase structure & files in context | q -c "how does provider setup work" |
--file |
-f |
Attach specific file content to context | q -f q/cli.py "explain main" |
--provider |
-p |
Specify AI provider (gemini, openai, anthropic) |
q -p anthropic why is water wet |
--model |
-m |
Specify AI model name | q -m gpt-4o write a poem |
--setup |
-s |
Re-run setup wizard manually | q --setup |
--reset |
-r |
Clear all saved provider API keys | q --reset |
--version |
-v |
Display package version | q --version |
--help |
-h |
Display CLI help menu | q --help |
Slash Commands (Inside Interactive Mode)
| Command | Description |
|---|---|
/help |
Display slash command help table |
/codebase |
Index current codebase structure & files into context |
/file <path> |
Attach a specific file to conversation context |
/provider [name] |
View current provider or launch interactive selection menu |
/model [name] |
View current model or enter custom model name |
/key [api_key] |
View or update API key for active provider |
/clear |
Reset conversation memory for current session |
/history |
Print full session conversation transcript |
/exit or /quit |
Exit interactive mode |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file q_cli_ai-0.1.0.tar.gz.
File metadata
- Download URL: q_cli_ai-0.1.0.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2d9513351eeb04f8a8629ff7410677c9c4a76dbb8bb393e8d6a993fa980d6aa
|
|
| MD5 |
c20ee494c1ec66e45cd0d112dc6601bb
|
|
| BLAKE2b-256 |
4697e990b17b79ca83f34def84d5e2c33a51158b740a2e2fbe880e1dbdb94920
|
File details
Details for the file q_cli_ai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: q_cli_ai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
639bee29c02efb9c07c9f74bf59f191dfbb60cb26b624d5d245a9069ea6ef8e4
|
|
| MD5 |
21f3ad7926b222c9ae5cd39f155a1f57
|
|
| BLAKE2b-256 |
1856dce1053c0ef8040818a4257b3ffc1bedeaf3565ec189b80e89bf04550512
|