Skip to main content

A fast, streaming, multi-provider terminal AI chat client with codebase awareness.

Project description

q — Fast Multi-Provider Terminal AI Assistant

PyPI Version License: MIT Python 3.8+

q is a fast, production-grade command-line AI assistant supporting Google Gemini, OpenAI, and Anthropic (Claude) with Whole Codebase Awareness, File Context Attaching, Piped STDIN Processing, and Real-Time Streaming Output.


Key Features

  • 📂 Codebase Awareness (-c / --codebase): Automatically indexes your project directory structure and source files into AI prompt context (q -c "how does config loading work").
  • 📄 File Attachment (-f / --file): Attach a specific file to your question (q -f q/cli.py "explain the main loop").
  • ⚡ Piped STDIN Input: Pipe command outputs or code files directly into q (cat main.py | q "review this", git diff | q "suggest improvements").
  • 🎨 Real-Time Markdown Output: Uses rich for real-time live Markdown streaming with syntax-highlighted code blocks and minimal status footers.
  • 🔑 Multi-Provider BYOK: Connect your choice of Google Gemini, OpenAI, or Anthropic (Claude) using your own API keys.
  • 🚀 Fast Provider & Model Overrides: Switch providers on the fly (q -p anthropic ..., q -m gpt-4o ...) or inside interactive chat using slash commands (/provider, /model).
  • 💬 Interactive Chat REPL: Launch q with no arguments for a multi-turn chat session with session memory.
  • 🔒 Secure Local Storage: Stores API keys in ~/.q/config.json enforced with POSIX 0600 owner-only permissions.

Installation

Option 1: Install via PyPI (Recommended)

pip install q-notyourtype

(Once installed, run q directly in any terminal shell!)

Option 2: Install from Source

git clone https://github.com/oz456/q.git
cd q
pip install -e .

Quickstart & Examples

1. Direct Questions & Terminal Pipe Input

# Ask any direct question
q why is the sky blue

# Pipe command outputs into q
cat setup.py | q explain this setup file
git diff | q review these code changes

2. Codebase Awareness & File Context

# Ask questions about your entire project directory
q -c how does configuration management work

# Attach a specific file to your prompt
q -f q/cli.py explain main function

3. Quick Provider Overrides

# Query Anthropic Claude directly
q -p anthropic explain quantum computing

# Query OpenAI GPT-4o
q -p openai -m gpt-4o write a python script

4. Interactive REPL Chat Mode

q

Command Line Flags

Flag Shortcut Description Example
--codebase -c Include project directory structure & files in prompt context q -c "explain architecture"
--file -f Attach specific file content to prompt 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 API keys and reset config q --reset
--version -v Display package version q --version
--help -h Display CLI help menu q --help

Slash Commands (Interactive Mode)

Inside the interactive chat REPL (q), you can use the following slash commands:

Command Description
/help Show slash command help table
/codebase Index current directory structure & source files into session context
/file <path> Attach a specific file to conversation context
/provider [name] View active provider or launch interactive provider switcher
/model [name] View active model or switch 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 chat session

License

Distributed under the MIT License. Open source and free to use.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

q_notyourtype-0.1.1.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

q_notyourtype-0.1.1-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file q_notyourtype-0.1.1.tar.gz.

File metadata

  • Download URL: q_notyourtype-0.1.1.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for q_notyourtype-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fa87f24b01a658754ff3972d00921e85bb63b2fc91396e2808f77056ab9e5ed5
MD5 f97dd7bdbb4d9d8592673c6a60994983
BLAKE2b-256 5b16ef9d07b3352ab6a2b11f8220201a1fa47545197c7a45fe4abdae09a63102

See more details on using hashes here.

File details

Details for the file q_notyourtype-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: q_notyourtype-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for q_notyourtype-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fab83a61fc63c5108c9defd0b54a18264c4940c34d7a1836a0bca605b0d5ac84
MD5 dd210b168f63dccfb9e88d5a8a0e65a8
BLAKE2b-256 2471d9fa074343803fc8dbc6a2efbe1bfa521415dd61905572e713d390ad0e8e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page