Skip to main content

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 rich to 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 q with 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

Release files for q-cli-ai 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for q-cli-ai 0.1.0
File Size Uploaded
q_cli_ai-0.1.0.tar.gz 14.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for q-cli-ai 0.1.0
File Interpreter ABI Platform
q_cli_ai-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.4 kB

Release files / q_cli_ai-0.1.0.tar.gz

Download URL q_cli_ai-0.1.0.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f2d9513351eeb04f8a8629ff7410677c9c4a76dbb8bb393e8d6a993fa980d6aa
BLAKE2b-256 checksum
How to use checksums
4697e990b17b79ca83f34def84d5e2c33a51158b740a2e2fbe880e1dbdb94920
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / q_cli_ai-0.1.0-py3-none-any.whl

Download URL q_cli_ai-0.1.0-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
639bee29c02efb9c07c9f74bf59f191dfbb60cb26b624d5d245a9069ea6ef8e4
BLAKE2b-256 checksum
How to use checksums
1856dce1053c0ef8040818a4257b3ffc1bedeaf3565ec189b80e89bf04550512
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page