{"_id":"@code-q/code-q","_rev":"4-7881bcf016034e64d4f83f918c3a7175","name":"@code-q/code-q","dist-tags":{"latest":"0.0.32"},"versions":{"0.0.29":{"name":"@code-q/code-q","version":"0.0.29","keywords":["cli","agent","text-editor","grok","ai"],"author":{"name":"Your Name"},"license":"MIT","_id":"@code-q/code-q@0.0.29","maintainers":[{"name":"d0gra","email":"work.ndogra@gmail.com"},{"name":"codecue","email":"work.ndo.gra@gmail.com"}],"homepage":"https://github.com/hilltree/codecue#readme","bugs":{"url":"https://github.com/hilltree/codecue/issues"},"bin":{"code-q":"dist/index.js"},"dist":{"shasum":"fea152ba18d2e44c75777e18a80b64c55ca503fc","tarball":"https://registry.npmjs.org/@code-q/code-q/-/code-q-0.0.29.tgz","fileCount":147,"integrity":"sha512-x9e4RSjG5IwerPfOFEBOTPuI1IiY/Uh59PEW5LeyOPCbZIwZI49TTlAngP9CVa9X07yqJi3mHwmCJiXojYn1hg==","signatures":[{"sig":"MEUCIHhT1zzjcmxDpPIoMuma+yMxkwSCGU3vwPomgIBfwmB0AiEAtyGqouqec5im0qncSfrd0So2JZ/MQLVS+CXlHiNsDJ0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":625257},"main":"dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"61b81d6ea276429940ce360340025ebc1e06b230","scripts":{"dev":"tsx src/index.ts","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"node dist/index.js","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"codecue","email":"work.ndo.gra@gmail.com"},"repository":{"url":"git+https://github.com/hilltree/codecue.git","type":"git"},"_npmVersion":"9.2.0","description":"An open-source AI agent that brings the power of Grok directly into your terminal.","directories":{},"_nodeVersion":"18.19.1","dependencies":{"ink":"^3.2.0","axios":"^1.6.0","chalk":"^4.1.2","react":"^17.0.2","cfonts":"^3.3.0","dotenv":"^16.3.0","openai":"^5.10.1","enquirer":"^2.4.1","fs-extra":"^11.1.1","tiktoken":"^1.0.21","commander":"^11.1.0","typescript":"^4.9.5","ink-markdown":"^1.0.4","ripgrep-node":"^1.0.0","@supabase/supabase-js":"^2.45.2","@modelcontextprotocol/sdk":"^1.17.0"},"preferGlobal":true,"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","eslint":"^9.31.0","@types/node":"^20.8.0","@types/react":"^17.0.0","@types/fs-extra":"^11.0.2","@typescript-eslint/parser":"^8.37.0","@typescript-eslint/eslint-plugin":"^8.37.0"},"_npmOperationalInternal":{"tmp":"tmp/code-q_0.0.29_1756658498605_0.833582874440725","host":"s3://npm-registry-packages-npm-production"}},"0.0.30":{"name":"@code-q/code-q","version":"0.0.30","keywords":["cli","agent","text-editor","grok","ai"],"author":{"name":"Your Name"},"license":"MIT","_id":"@code-q/code-q@0.0.30","maintainers":[{"name":"d0gra","email":"work.ndogra@gmail.com"},{"name":"codecue","email":"work.ndo.gra@gmail.com"}],"homepage":"https://github.com/hilltree/codecue#readme","bugs":{"url":"https://github.com/hilltree/codecue/issues"},"bin":{"code-q":"dist/index.js"},"dist":{"shasum":"496e448d57880fb0cca4d3d83b546e359768368f","tarball":"https://registry.npmjs.org/@code-q/code-q/-/code-q-0.0.30.tgz","fileCount":147,"integrity":"sha512-RwEBf3LAWDM8ZoskCdVHgWuhdN2KeeMum10VX7fEqG6vxLQhHoTTXK/8fEwFrxL3N0NgGplJm+nczDQ7ir4iMg==","signatures":[{"sig":"MEQCID3DovlqjE3vmeB6Of7XKtq1S69x53Y5EkhBG6GZaSu5AiBWAWTzti2o8WddkZkJkJpPp1nfG+obUJR+yafUPC9JQg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":625257},"main":"dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"7e37bef1f528528cad49ce4384c5aa3f3ff84f28","scripts":{"dev":"tsx src/index.ts","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"node dist/index.js","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"codecue","email":"work.ndo.gra@gmail.com"},"repository":{"url":"git+https://github.com/hilltree/codecue.git","type":"git"},"_npmVersion":"9.2.0","description":"An open-source AI agent that brings the power of Grok directly into your terminal.","directories":{},"_nodeVersion":"18.19.1","dependencies":{"ink":"^3.2.0","axios":"^1.6.0","chalk":"^4.1.2","react":"^17.0.2","cfonts":"^3.3.0","dotenv":"^16.3.0","openai":"^5.10.1","enquirer":"^2.4.1","fs-extra":"^11.1.1","tiktoken":"^1.0.21","commander":"^11.1.0","typescript":"^4.9.5","ink-markdown":"^1.0.4","ripgrep-node":"^1.0.0","@supabase/supabase-js":"^2.45.2","@modelcontextprotocol/sdk":"^1.17.0"},"preferGlobal":true,"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","eslint":"^9.31.0","@types/node":"^20.8.0","@types/react":"^17.0.0","@types/fs-extra":"^11.0.2","@typescript-eslint/parser":"^8.37.0","@typescript-eslint/eslint-plugin":"^8.37.0"},"_npmOperationalInternal":{"tmp":"tmp/code-q_0.0.30_1756658784979_0.8494671795604776","host":"s3://npm-registry-packages-npm-production"}},"0.0.31":{"name":"@code-q/code-q","version":"0.0.31","keywords":["cli","agent","coding-agent","developer-tools","terminal","text-editor","ai","grok","openrouter","mcp","supabase","saas","india","bharat"],"author":{"name":"Code Q"},"license":"MIT","_id":"@code-q/code-q@0.0.31","maintainers":[{"name":"d0gra","email":"work.ndogra@gmail.com"},{"name":"codecue","email":"work.ndo.gra@gmail.com"}],"homepage":"https://code-q.in","bugs":{"url":"https://github.com/hilltree/code-q/issues"},"bin":{"code-q":"dist/index.js"},"dist":{"shasum":"e37e00691a9bbc449c8b26250c2e61b18cb06593","tarball":"https://registry.npmjs.org/@code-q/code-q/-/code-q-0.0.31.tgz","fileCount":147,"integrity":"sha512-3aXGI0fLQtt6PpiMdNyt4rlsMli/N+Q4A/g9BufnA5BtkfxNdjU61Ek06niOshhVTcQ6LjcsPTAoulkt0K52Ww==","signatures":[{"sig":"MEUCIHIBVKZcExvdajgxX8Jw9qlLLhWF3IR2ejoRWB2HAfbXAiEA7Dw2HYTAjoWrTKpA/1zxBlx8sRKkloeJ1o2Vviy4KVY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":625602},"main":"dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"921d374161dcd360d12c92ed5ca336d9222688d7","scripts":{"dev":"tsx src/index.ts","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"node dist/index.js","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"codecue","email":"work.ndo.gra@gmail.com"},"repository":{"url":"git+https://github.com/hilltree/code-q.git","type":"git"},"_npmVersion":"9.2.0","description":"India-first SaaS AI coding agent CLI for developers.","directories":{},"_nodeVersion":"18.19.1","dependencies":{"ink":"^3.2.0","axios":"^1.6.0","chalk":"^4.1.2","react":"^17.0.2","cfonts":"^3.3.0","dotenv":"^16.3.0","openai":"^5.10.1","enquirer":"^2.4.1","fs-extra":"^11.1.1","tiktoken":"^1.0.21","commander":"^11.1.0","typescript":"^4.9.5","ink-markdown":"^1.0.4","ripgrep-node":"^1.0.0","@supabase/supabase-js":"^2.45.2","@modelcontextprotocol/sdk":"^1.17.0"},"preferGlobal":true,"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","eslint":"^9.31.0","@types/node":"^20.8.0","@types/react":"^17.0.0","@types/fs-extra":"^11.0.2","@typescript-eslint/parser":"^8.37.0","@typescript-eslint/eslint-plugin":"^8.37.0"},"_npmOperationalInternal":{"tmp":"tmp/code-q_0.0.31_1756660078309_0.5912984529360525","host":"s3://npm-registry-packages-npm-production"}},"0.0.32":{"name":"@code-q/code-q","version":"0.0.32","description":"India-first SaaS AI coding agent CLI for developers.","main":"dist/index.js","bin":{"code-q":"dist/index.js"},"scripts":{"build":"tsc","prepublishOnly":"npm run build","dev":"tsx src/index.ts","start":"node dist/index.js","lint":"eslint . --ext .js,.jsx,.ts,.tsx","typecheck":"tsc --noEmit"},"keywords":["cli","agent","coding-agent","developer-tools","terminal","text-editor","ai","grok","openrouter","mcp","supabase","saas","india","bharat"],"author":{"name":"Code Q"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/hilltree/code-q.git"},"homepage":"https://code-q.in","bugs":{"url":"https://github.com/hilltree/code-q/issues"},"publishConfig":{"access":"public"},"dependencies":{"@modelcontextprotocol/sdk":"^1.17.0","axios":"^1.6.0","cfonts":"^3.3.0","chalk":"^4.1.2","commander":"^11.1.0","dotenv":"^16.3.0","enquirer":"^2.4.1","fs-extra":"^11.1.1","ink":"^3.2.0","ink-markdown":"^1.0.4","openai":"^5.10.1","@supabase/supabase-js":"^2.45.2","react":"^17.0.2","ripgrep-node":"^1.0.0","tiktoken":"^1.0.21","typescript":"^4.9.5"},"devDependencies":{"@types/fs-extra":"^11.0.2","@types/node":"^20.8.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^8.37.0","@typescript-eslint/parser":"^8.37.0","eslint":"^9.31.0","tsx":"^4.0.0"},"engines":{"node":">=16.0.0"},"preferGlobal":true,"types":"./dist/index.d.ts","gitHead":"d8f9a84845945cb899556167bb105c72bda4b1d1","_id":"@code-q/code-q@0.0.32","_nodeVersion":"18.19.1","_npmVersion":"9.2.0","dist":{"integrity":"sha512-uJZBzL7j/qty0girEJIWnnJosoqj1QKgkg8novZfJfMulsaan3TAF9KFyeDseywRhrIdx777vwo6XQtG7l6Azg==","shasum":"789e14f91ccf596f274763af52736b945818035c","tarball":"https://registry.npmjs.org/@code-q/code-q/-/code-q-0.0.32.tgz","fileCount":147,"unpackedSize":630493,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC3I8OaBQ3oEuTDsrAQ4OBVtblqOgfJnCTiAch992WKPAIgAyKjyb7E6cFgwL9RU2EdaUE5kdgpVFj4ZYzkvq91XBo="}]},"_npmUser":{"name":"codecue","email":"work.ndo.gra@gmail.com"},"directories":{},"maintainers":[{"name":"d0gra","email":"work.ndogra@gmail.com"},{"name":"codecue","email":"work.ndo.gra@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/code-q_0.0.32_1756666280767_0.306256530100357"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-31T16:41:38.482Z","modified":"2025-08-31T18:51:21.228Z","0.0.29":"2025-08-31T16:41:38.843Z","0.0.30":"2025-08-31T16:46:25.203Z","0.0.31":"2025-08-31T17:07:58.544Z","0.0.32":"2025-08-31T18:51:20.956Z"},"bugs":{"url":"https://github.com/hilltree/code-q/issues"},"author":{"name":"Code Q"},"license":"MIT","homepage":"https://code-q.in","keywords":["cli","agent","coding-agent","developer-tools","terminal","text-editor","ai","grok","openrouter","mcp","supabase","saas","india","bharat"],"repository":{"type":"git","url":"git+https://github.com/hilltree/code-q.git"},"description":"India-first SaaS AI coding agent CLI for developers.","maintainers":[{"name":"d0gra","email":"work.ndogra@gmail.com"},{"name":"codecue","email":"work.ndo.gra@gmail.com"}],"readme":"# code-q CLI\n\nIndia-first SaaS AI coding agent for the terminal. OpenAI-compatible with intelligent file editing, shell automation, and MCP integrations. Built for developers in India (and beyond) with fast onboarding, local-friendly pricing, and secure authentication.\n\n<img width=\"980\" height=\"435\" alt=\"Screenshot 2025-07-21 at 13 35 41\" src=\"https://github.com/user-attachments/assets/192402e3-30a8-47df-9fc8-a084c5696e78\" />\n\n## Features\n\n- **🇮🇳 India‑first SaaS**: Local-friendly onboarding, pricing, and support\n- **🤖 Conversational AI**: Natural language interface\n- **📝 Smart File Operations**: AI automatically uses tools to view, create, and edit files\n- **⚡ Bash Integration**: Execute shell commands through natural conversation\n- **🔧 Automatic Tool Selection**: AI intelligently chooses the right tools for your requests\n- **🚀 Morph Fast Apply**: Optional high-speed code editing at 4,500+ tokens/sec with 98% accuracy\n- **🔌 MCP Tools**: Extend capabilities with Model Context Protocol servers (Linear, GitHub, etc.)\n- **💬 Interactive UI**: Beautiful terminal interface built with Ink\n- **🌍 Global Installation**: Install and use anywhere with `npm i -g code-q`\n\n## Installation\n\n### Prerequisites\n- Node.js 16+ \n- API key for your chosen OpenAI-compatible provider (e.g., X.AI Grok)\n- (Optional, Recommended) Morph API key for Fast Apply editing\n\n### Primary install options\n\n1) npx (no install):\n```bash\nnpx @code-q/code-q@latest --no-tools --prompt \"hello\"\n```\n\n2) npm global:\n```bash\nnpm install -g @code-q/code-q\n```\n\n3) Docker:\n```bash\ndocker run --rm -it -v \"$PWD:/work\" -w /work ghcr.io/<org>/code-q code-q --no-tools -p \"hello\"\n```\n\n### Local Development\n```bash\ngit clone <repository>\ncd code-q-cli\nnpm install\nnpm run build\nnpm link\n```\n\n## Setup\n\n1. Get an API key from your provider (e.g., [X.AI](https://x.ai))\n\n2. Set up your API key (choose one method):\n\n**Method 1: Environment Variable**\n```bash\nexport MUZZIK_API_KEY=your_api_key_here   # GROK_API_KEY also supported\n```\n\n**Method 2: .env File**\n```bash\ncp .env.example .env\n# Edit .env and add your API key\n```\n\n**Method 3: Command Line Flag**\n```bash\ncode-q --api-key your_api_key_here\n```\n\n**Method 4: User Settings File**\nCreate `~/.muzzik/user-settings.json` (legacy `~/.grok/user-settings.json` also supported):\n```json\n{\n  \"apiKey\": \"your_api_key_here\"\n}\n```\n\n3. (Optional, Recommended) Get your Morph API key from [Morph Dashboard](https://morphllm.com/dashboard/api-keys)\n\n4. Set up your Morph API key for Fast Apply editing (choose one method):\n\n**Method 1: Environment Variable**\n```bash\nexport MORPH_API_KEY=your_morph_api_key_here\n```\n\n**Method 2: .env File**\n```bash\n# Add to your .env file\nMORPH_API_KEY=your_morph_api_key_here\n```\n\n### Custom Base URL (Optional)\n\nBy default, the CLI uses `https://api.x.ai/v1`. You can configure a custom endpoint if needed (choose one method):\n\n**Method 1: Environment Variable**\n```bash\nexport MUZZIK_BASE_URL=https://your-custom-endpoint.com/v1   # GROK_BASE_URL also supported\n```\n\n**Method 2: Command Line Flag**\n```bash\ncode-q --api-key your_api_key_here --base-url https://your-custom-endpoint.com/v1\n```\n\n**Method 3: User Settings File**\nAdd to `~/.muzzik/user-settings.json`:\n```json\n{\n  \"apiKey\": \"your_api_key_here\",\n  \"baseURL\": \"https://your-custom-endpoint.com/v1\"\n}\n```\n\n## Configuration Files\n\ncode-q uses two types of configuration files to manage settings:\n\n### User-Level Settings (`~/.muzzik/user-settings.json`)\n\nThis file stores **global settings** that apply across all projects. These settings rarely change and include:\n\n- **API Key**: Your API key\n- **Base URL**: Custom API endpoint (if needed)\n- **Default Model**: Your preferred model (e.g., `grok-4-latest`)\n- **Available Models**: List of models you can use\n\n**Example:**\n```json\n{\n  \"apiKey\": \"your_api_key_here\",\n  \"baseURL\": \"https://api.x.ai/v1\",\n  \"defaultModel\": \"grok-4-latest\",\n  \"models\": [\n    \"grok-4-latest\",\n    \"grok-3-latest\",\n    \"grok-3-fast\",\n    \"grok-3-mini-fast\"\n  ]\n}\n```\n\n### Project-Level Settings (`.muzzik/settings.json`)\n\nThis file stores **project-specific settings** in your current working directory. It includes:\n\n- **Current Model**: The model currently in use for this project\n- **MCP Servers**: Model Context Protocol server configurations\n\n**Example:**\n```json\n{\n  \"model\": \"grok-3-fast\",\n  \"mcpServers\": {\n    \"linear\": {\n      \"name\": \"linear\",\n      \"transport\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"@linear/mcp-server\"]\n    }\n  }\n}\n```\n\n### How It Works\n\n1. **Global Defaults**: User-level settings provide your default preferences\n2. **Project Override**: Project-level settings override defaults for specific projects\n3. **Directory-Specific**: When you change directories, project settings are loaded automatically\n4. **Fallback Logic**: Project model → User default model → System default (`grok-4-latest`)\n\nThis means you can have different models for different projects while maintaining consistent global settings like your API key.\n\n### Using Other API Providers\n\n**Important**: code-q uses **OpenAI-compatible APIs**. You can use any provider that implements the OpenAI chat completions standard. The CLI will try to infer the correct base URL from your API key if none is provided (e.g., `sk-` → OpenAI, `or-v1-` → OpenRouter). You can always override with `--base-url`.\n\n**Popular Providers**:\n- **X.AI (Grok)**: `https://api.x.ai/v1` (default)\n- **OpenAI**: `https://api.openai.com/v1`\n- **OpenRouter**: `https://openrouter.ai/api/v1`\n- **Groq**: `https://api.groq.com/openai/v1`\n\n**Example with OpenRouter**:\n```json\n{\n  \"apiKey\": \"your_openrouter_key\",\n  \"baseURL\": \"https://openrouter.ai/api/v1\",\n  \"defaultModel\": \"anthropic/claude-3.5-sonnet\",\n  \"models\": [\n    \"anthropic/claude-3.5-sonnet\",\n    \"openai/gpt-4o\",\n    \"meta-llama/llama-3.1-70b-instruct\"\n  ]\n}\n```\n\n## Usage\n\n### Interactive Mode\n\nStart the conversational AI assistant:\n```bash\ncode-q\n```\n\nOr specify a working directory:\n```bash\ncode-q -d /path/to/project\n```\n\n### Headless Mode\n\nProcess a single prompt and exit (useful for scripting and automation):\n```bash\ncode-q --prompt \"show me the package.json file\"\ncode-q -p \"create a new file called example.js with a hello world function\"\ncode-q --prompt \"run npm test and show me the results\" --directory /path/to/project\ncode-q --prompt \"complex task\" --max-tool-rounds 50  # Limit tool usage for faster execution\n```\n\nThis mode is particularly useful for:\n- **CI/CD pipelines**: Automate code analysis and file operations\n- **Scripting**: Integrate AI assistance into shell scripts\n- **Terminal benchmarks**: Perfect for tools like Terminal Bench that need non-interactive execution\n- **Batch processing**: Process multiple prompts programmatically\n\n### Tool Execution Control\n\nBy default, code-q allows up to 400 tool execution rounds to handle complex multi-step tasks. You can control this behavior:\n\n```bash\n# Limit tool rounds for faster execution on simple tasks\ncode-q --max-tool-rounds 10 --prompt \"show me the current directory\"\n\n# Increase limit for very complex tasks (use with caution)\ncode-q --max-tool-rounds 1000 --prompt \"comprehensive code refactoring\"\n\n# Works with all modes\ncode-q --max-tool-rounds 20  # Interactive mode\ncode-q git commit-and-push --max-tool-rounds 30  # Git commands\n```\n\n**Use Cases**:\n- **Fast responses**: Lower limits (10-50) for simple queries\n- **Complex automation**: Higher limits (500+) for comprehensive tasks\n- **Resource control**: Prevent runaway executions in automated environments\n\n### Model Selection\n\nYou can specify which AI model to use with the `--model` parameter (supports `GROK_MODEL` environment variable):\n\n**Method 1: Command Line Flag**\n```bash\n# Use Grok models\ncode-q --model grok-4-latest\ncode-q --model grok-3-latest\ncode-q --model grok-3-fast\n\n# Use other models (with appropriate API endpoint)\ncode-q --model gemini-2.5-pro --base-url https://api-endpoint.com/v1\ncode-q --model claude-sonnet-4-20250514 --base-url https://api-endpoint.com/v1\n```\n\n**Method 2: Environment Variable**\n```bash\nexport GROK_MODEL=grok-4-latest\ncode-q\n```\n\n**Method 3: User Settings File**\nAdd to `~/.muzzik/user-settings.json`:\n```json\n{\n  \"apiKey\": \"your_api_key_here\",\n  \"defaultModel\": \"grok-4-latest\"\n}\n```\n\n**Model Priority**: `--model` flag > `GROK_MODEL` environment variable > user default model > system default (grok-4-latest)\n\n### Command Line Options\n\n```bash\ncode-q [options]\n\nOptions:\n  -V, --version          output the version number\n  -d, --directory <dir>  set working directory\n  -k, --api-key <key>    code-q API key (set MUZZIK_API_KEY; GROK_API_KEY supported)\n  -u, --base-url <url>   API base URL (set MUZZIK_BASE_URL; GROK_BASE_URL supported)\n  -m, --model <model>    AI model to use (supports GROK_MODEL env var)\n  -p, --prompt <prompt>  process a single prompt and exit (headless mode)\n  --max-tool-rounds <rounds>  maximum number of tool execution rounds (default: 400)\n  -h, --help             display help for command\n```\n\n### Custom Instructions\n\nYou can provide custom instructions by creating `.muzzik/MUZZIK.md` (preferred) or legacy `.grok/GROK.md` in your project directory:\n\n```bash\nmkdir .muzzik\n```\n\nCreate `.muzzik/MUZZIK.md` with your custom instructions:\n```markdown\n# Custom Instructions for code-q CLI\n\nAlways use TypeScript for any new code files.\nWhen creating React components, use functional components with hooks.\nPrefer const assertions and explicit typing over inference where it improves clarity.\nAlways add JSDoc comments for public functions and interfaces.\nFollow the existing code style and patterns in this project.\n```\n\ncode-q will automatically load and follow these instructions when working in your project directory. The custom instructions are added to the system prompt and take priority over default behavior.\n\n## Morph Fast Apply (Optional)\n\ncode-q supports Morph's Fast Apply model for high-speed code editing at **4,500+ tokens/sec with 98% accuracy**. This is an optional feature that provides lightning-fast file editing capabilities.\n\n**Setup**: Configure your Morph API key following the [setup instructions](#setup) above.\n\n### How It Works\n\nWhen `MORPH_API_KEY` is configured:\n- **`edit_file` tool becomes available** alongside the standard `str_replace_editor`\n- **Optimized for complex edits**: Use for multi-line changes, refactoring, and large modifications\n- **Intelligent editing**: Uses abbreviated edit format with `// ... existing code ...` comments\n- **Fallback support**: Standard tools remain available if Morph is unavailable\n\n**When to use each tool:**\n- **`edit_file`** (Morph): Complex edits, refactoring, multi-line changes\n- **`str_replace_editor`**: Simple text replacements, single-line edits\n\n### Example Usage\n\nWith Morph Fast Apply configured, you can request complex code changes:\n\n```bash\ncode-q --prompt \"refactor this function to use async/await and add error handling\"\ncode-q -p \"convert this class to TypeScript and add proper type annotations\"\n```\n\nThe AI will automatically choose between `edit_file` (Morph) for complex changes or `str_replace_editor` for simple replacements.\n\n## MCP Tools\n\ncode-q supports MCP (Model Context Protocol) servers, allowing you to extend the AI assistant with additional tools and capabilities.\n\n### Adding MCP Tools\n\n#### Add a custom MCP server:\n```bash\n# Add an stdio-based MCP server\ncode-q mcp add my-server --transport stdio --command \"node\" --args server.js\n\n# Add an HTTP-based MCP server\ncode-q mcp add my-server --transport http --url \"http://localhost:3000\"\n\n# Add with environment variables\ncode-q mcp add my-server --transport stdio --command \"python\" --args \"-m\" \"my_mcp_server\" --env \"API_KEY=your_key\"\n```\n\n#### Add from JSON configuration:\n```bash\ncode-q mcp add-json my-server '{\"command\": \"node\", \"args\": [\"server.js\"], \"env\": {\"API_KEY\": \"your_key\"}}'\n```\n\n### Linear Integration Example\n\nTo add Linear MCP tools for project management:\n\n```bash\n# Add Linear MCP server\ncode-q mcp add linear --transport sse --url \"https://mcp.linear.app/sse\"\n```\n\nThis enables Linear tools like:\n- Create and manage Linear issues\n- Search and filter issues\n- Update issue status and assignees\n- Access team and project information\n\n### Managing MCP Servers\n\n```bash\n# List all configured servers\ncode-q mcp list\n\n# Test server connection\ncode-q mcp test server-name\n\n# Remove a server\ncode-q mcp remove server-name\n```\n\n### Available Transport Types\n\n- **stdio**: Run MCP server as a subprocess (most common)\n- **http**: Connect to HTTP-based MCP server\n- **sse**: Connect via Server-Sent Events\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Development mode\nnpm run dev\n\n# Build project\nnpm run build\n\n# Run linter\nnpm run lint\n\n# Type check\nnpm run typecheck\n```\n\n## Architecture\n\n- **Agent**: Core command processing and execution logic\n- **Tools**: Text editor and bash tool implementations\n- **UI**: Ink-based terminal interface components\n- **Types**: TypeScript definitions for the entire system\n\n## License\n\nMIT\n\n## Authentication (Supabase)\n\nThis CLI requires a Supabase-authenticated user. Configure environment variables (see `env.example`). If you sign in on `code-q.in`, device login flows and email password logins are supported in-terminal.\n\n- `SUPABASE_URL`\n- `SUPABASE_ANON_KEY`\n\nWhen you run `code-q`, if you are not authenticated, you will be prompted to log in with your email and password directly in the terminal. The session is securely stored in `~/.muzzik/user-settings.json` and refreshed automatically.\n\nYou can verify by starting the CLI; if already logged in, no prompt will appear.\n","readmeFilename":"README.md"}