Metadata-Version: 2.4
Name: krims-code-cli
Version: 1.5.2
Summary: Krims Code AI — Universal AI Gateway CLI (Python Wrapper)
Home-page: https://github.com/Krylo-60/krims-code-cli
Author: Krishiv PB
Author-email: krylobloxyt@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python
Dynamic: summary

# Krims Code AI CLI

> âš¡ **Universal AI Gateway** â€” 13+ providers, free & paid models, cyberpunk terminal

[![npm version](https://img.shields.io/npm/v/@krishivpb60/krims-code-cli.svg)](https://www.npmjs.com/package/@krishivpb60/krims-code-cli)
[![License: MIT](https://img.shields.io/badge/License-MIT-cyan.svg)](LICENSE)
[![Node.js](https://img.shields.io/badge/Node.js-â‰¥18.0.0-green.svg)](https://nodejs.org)

```
  â•”â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•—
  â•‘     â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•— â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•—â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•—â–ˆâ–ˆâ•—  â–ˆâ–ˆâ•—â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•—â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•—    â•‘
  â•‘    â–ˆâ–ˆâ•”â•â•â–ˆâ–ˆâ•—â–ˆâ–ˆâ•”â•â•â•â•â•â•šâ•â•â–ˆâ–ˆâ•”â•â•â•â–ˆâ–ˆâ•‘  â–ˆâ–ˆâ•‘â–ˆâ–ˆâ•”â•â•â•â•â•â–ˆâ–ˆâ•”â•â•â–ˆâ–ˆâ•—   â•‘
  â•‘    â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•‘â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•—     â–ˆâ–ˆâ•‘   â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•‘â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•—  â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•”â•   â•‘
  â•‘    â–ˆâ–ˆâ•”â•â•â–ˆâ–ˆâ•‘â–ˆâ–ˆâ•”â•â•â•     â–ˆâ–ˆâ•‘   â–ˆâ–ˆâ•”â•â•â–ˆâ–ˆâ•‘â–ˆâ–ˆâ•”â•â•â•  â–ˆâ–ˆâ•”â•â•â–ˆâ–ˆâ•—   â•‘
  â•‘    â–ˆâ–ˆâ•‘  â–ˆâ–ˆâ•‘â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•—   â–ˆâ–ˆâ•‘   â–ˆâ–ˆâ•‘  â–ˆâ–ˆâ•‘â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•—â–ˆâ–ˆâ•‘  â–ˆâ–ˆâ•‘   â•‘
  â•‘    â•šâ•â•  â•šâ•â•â•šâ•â•â•â•â•â•â•   â•šâ•â•   â•šâ•â•  â•šâ•â•â•šâ•â•â•â•â•â•â•â•šâ•â•  â•šâ•â•   â•‘
  â•šâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
```

**Krims Code AI v110** is a production-ready, globally installable command-line AI assistant that connects to **any AI provider in the world** â€” both free and paid. Chat with GPT-4o, Claude, Gemini, Llama, Mixtral, DeepSeek, and 50+ more models, all from one terminal.

---

## âœ¨ Features

- ðŸŒ **13+ AI Providers** â€” OpenAI, Anthropic, Google, Groq, Together, Mistral, OpenRouter, DeepSeek, Cerebras, Cohere, Perplexity, Fireworks, xAI
- ðŸ†“ **Free Models Included** â€” Groq, Together AI, Cerebras, OpenRouter, and Cohere all offer generous free tiers
- ðŸ’¬ **Interactive Chat** â€” Full terminal chat with slash commands, mode switching, and file attachments
- âš¡ **Single-Shot Queries** â€” Quick one-off questions directly from the CLI
- ðŸ§  **4 Reasoning Modes** â€” Synthesis, Research, Architect, Titan Fusion â€” each with unique system prompts
- ðŸ“Ž **File Context Injection** â€” Attach code files, logs, or documents for context-aware AI responses
- ðŸ¤– **Autopilot Debug Loop** â€” Automatically correct build/test failures using AI self-correcting feedback loop
- ðŸŒ¿ **Interactive Git TUI** â€” Beautiful cyberpunk ASCII branch tree commit history & interactive file staging checkbox menu
- ðŸ“Š **Web HUD Dashboard** â€” Companion local zero-dependency telemetry dashboard displaying real-time latencies & provider status
- ðŸŽ¤ **Voice Microphone Input** â€” Record voice input directly from your terminal and transcribe it to text using Google Gemini or Whisper
- ðŸ”„ **Failover Mesh** â€” Automatic failback across all configured providers
- ðŸ”¢ **Local Math Solver** â€” Evaluates mathematical expressions without an API call
- ðŸ¤– **Krylo Companion** â€” Offline cyberpunk companion bot when no API keys are configured
- ðŸ” **Your Keys, Your Control** â€” API keys stored locally on YOUR machine, never transmitted anywhere
- ðŸ“¤ **Export Conversations** â€” Save full chat history as Markdown files
- ðŸŽ¨ **Cyberpunk UI** â€” Neon colors, ASCII art, signal bars, and mode badges
- ðŸŽ­ **4 Color Themes** â€” Cyberpunk, Matrix, Synthwave, Crimson â€” switch with `/theme`
- âŒ¨ï¸ **Custom Commands** â€” Create reusable prompt shortcuts with `/cmd add`
- ðŸ“ **File Creation** â€” AI can create files on your system with path override prompts
- ðŸ“Š **Live Telemetry** â€” Real-time response latency & tokens/sec in the status bar
- ðŸŽ® **Mini-Game** â€” Built-in mainframe hacking game (`/game`)
- ðŸ“‹ **Clipboard Copy** â€” Copy last response to clipboard with `/copy`

---

## ðŸš€ Quick Start

### Install globally via npm

```bash
npm install -g @krishivpb60/krims-code-cli
```

### Or run directly with npx

```bash
npx @krishivpb60/krims-code-cli chat
```

### Or install via pip (Python wrapper)

```bash
pip install krims-code-agent-cli
# Run via terminal:
Krims Code-pip chat
```

### Setup (Interactive Wizard)

```bash
Krims Code setup
```

The wizard walks you through configuring providers â€” **start with free ones!**

### Or set keys manually

```bash
# Free providers (recommended to start)
krims-code config set GROQ_API_KEY gsk_your_key_here
krims-code config set GOOGLE_API_KEY AIza_your_key_here
krims-code config set OPENROUTER_API_KEY sk-or-your_key_here

# Paid providers
krims-code config set OPENAI_API_KEY sk-your_key_here
krims-code config set ANTHROPIC_API_KEY sk-ant-your_key_here
```

### Start chatting

```bash
Krims Code chat
```

### Quick one-shot query

```bash
Krims Code ask "Explain quantum computing in simple terms"
```

---

## ðŸ“¦ Supported Providers

| Provider | Key | Free Tier | Default Model |
|----------|-----|-----------|---------------|
| **Groq** | `GROQ_API_KEY` | âœ… Generous | `llama-3.3-70b-versatile` |
| **Together AI** | `TOGETHER_API_KEY` | âœ… Free credits | `Meta-Llama-3.1-70B-Instruct-Turbo` |
| **Cerebras** | `CEREBRAS_API_KEY` | âœ… Free tier | `llama-3.3-70b` |
| **OpenRouter** | `OPENROUTER_API_KEY` | âœ… Free models | `llama-3.1-70b-instruct:free` |
| **Google Gemini** | `GOOGLE_API_KEY` | âœ… Free tier | `gemini-2.5-flash` |
| **Cohere** | `COHERE_API_KEY` | âœ… Dev free | `command-r-plus` |
| **Fireworks AI** | `FIREWORKS_API_KEY` | âœ… Free tier | `llama-v3p1-70b-instruct` |
| **OpenAI** | `OPENAI_API_KEY` | ðŸ’³ Paid | `gpt-4o` |
| **Anthropic** | `ANTHROPIC_API_KEY` | ðŸ’³ Paid | `claude-sonnet-4` |
| **xAI** | `XAI_API_KEY` | ðŸ’³ Paid | `grok-2` |
| **Mistral** | `MISTRAL_API_KEY` | ðŸ’³ Paid | `mistral-large-latest` |
| **DeepSeek** | `DEEPSEEK_API_KEY` | ðŸ’³ Paid | `deepseek-chat` |
| **Perplexity** | `PERPLEXITY_API_KEY` | ðŸ’³ Paid | `sonar` |

> ðŸ’¡ **Tip:** Start with **Groq** (fastest, free) or **Google Gemini** (most capable free tier). You can configure multiple providers and Krims Code will automatically failover between them!

---

## ðŸŽ® Commands

### Core Commands

```bash
Krims Code chat                    # Interactive chat session
Krims Code ask "your question"     # Single-shot query
Krims Code setup                   # Guided provider setup wizard
```

### Configuration

```bash
krims-code config set <KEY> <value>   # Set a config value
krims-code config get <KEY>           # Get a config value
krims-code config list                # List all config (keys masked)
krims-code config delete <KEY>        # Delete a config key
krims-code config reset               # Delete all config
krims-code config path                # Show config file location
```

### Discovery

```bash
Krims Code providers               # List all 13+ supported providers
Krims Code providers --free        # Show only free-tier providers
Krims Code models                  # List all available models
Krims Code models groq             # Models for a specific provider
Krims Code modes                   # List reasoning modes
Krims Code status                  # System status & active providers
```

### Flags

```bash
Krims Code ask "prompt" --mode research     # Use specific reasoning mode
Krims Code ask "prompt" --file error.log    # Attach file context
Krims Code ask "prompt" --model gpt-4o      # Override model
Krims Code ask "prompt" --raw               # Raw text output (for piping)
Krims Code chat --mode architect            # Start chat in specific mode
```

---

## ðŸ’¬ Chat Commands

Inside interactive chat mode, use these slash commands:

| Command | Description |
|---------|-------------|
| `/help` | Show all commands |
| `/mode <name>` | Switch reasoning mode (synthesis, research, architect, titan) |
| `/modes` | List all modes with signal bars |
| `/theme <name>` | Switch visual theme (cyberpunk, matrix, synthwave, crimson) |
| `/themes` | List available color themes |
| `/attach <file>` | Attach a file for context (supports Tab autocomplete!) |
| `/files` | List attached files |
| `/clear` | Clear terminal screen |
| `/providers` | Show active providers |
| `/export` | Export chat to Markdown |
| `/copy` | Copy last response to clipboard |
| `/write <file>` | Extract last code block and save to file |
| `/cmd list` | List custom command shortcuts |
| `/cmd add <name> <template>` | Create a custom command shortcut |
| `/cmd remove <name>` | Delete a custom command |
| `/game` | Start the mainframe hacking mini-game |
| `/history` | List, switch, and resume past interactive chat sessions |
| `/history-clear` | Clear saved persistent chat history |
| `/autopilot <mode\|debug [cmd]>` | View/switch autopilot safety level or run autonomous debug loop |
| `/git` | Launch interactive cyberpunk Git TUI and file stager checkbox menu |
| `/github <status\|issues\|prs>` | Git/GitHub orchestration, auto-staging, semantic AI commit generation, and remote sync |
| `/teamwork-preview` | Render real-time multi-agent matrix status dashboard with heartbeats & tasks |
| `/dashboard` | Spawn zero-dependency local web server and launch telemetry dashboard HUD |
| `/mic` | Record audio voice input from microphone and transcribe to text |
| `/tokens` | View detailed session token usage and exchanges telemetry |
| `/update` | Force check for updates and update Krims Code CLI manually |
| `/review` | Run git diff and stream an AI code review |
| `/diagnose [cmd]` | Run build/tests and AI-debug any errors |
| `/explain <file>` | AI-explain the design and logic of a file |
| `/refactor <file>` | AI-refactor the code of a target file |
| `/bug <file>` | Scan a file to detect logical edge case failures |
| `/doc <file>` | Write documentation, inline comments, or JSDoc |
| `/translate <file> <lang>` | AI-translate file code into another target language |
| `/exit` | End session |

---

## ðŸ§  Reasoning Modes

| Mode | Layer | Style | Signal |
|------|-------|-------|--------|
| **Synthesis** | v2.5 | Balanced, clean, direct | â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–‘â–‘ 80% |
| **Research** | v104 | Deep analysis, evidence-based | â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–‘ 85% |
| **Architect** | v55 | Systems thinking, debugging | â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–‘ 90% |
| **Titan Fusion** | v110 | Premium, maximum signal density | â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–‘ 95% |

---

## ðŸ” Security

- **Your keys stay on YOUR machine** â€” stored at `~/.krims-code/config.json`
- **No keys are bundled** in the package
- **No telemetry** â€” zero data collection
- **Keys are masked** when displayed (`krims-code config list`)
- **Environment variables** also supported as fallback

---

## ðŸ”„ Failover Mesh

Krims Code routes your prompt through all configured providers automatically:

```
Your Prompt
    â†“
[Provider 1] â†’ Success? â†’ Response âœ“
    â†“ (fail)
[Provider 2] â†’ Success? â†’ Response âœ“
    â†“ (fail)
[Provider N] â†’ Success? â†’ Response âœ“
    â†“ (all fail)
[Krylo Companion] â†’ Local Response âœ“
```

If a provider returns an error (rate limit, quota, etc.), Krims Code automatically tries the next one. Configure multiple free providers for maximum resilience!

---

## ðŸ“ File Attachment

Attach code files, logs, configs, or documents for context-aware responses:

```bash
# From CLI
Krims Code ask "What's wrong with this code?" --file buggy.js

# In chat mode
/attach error.log
What errors are in this file?
```

**Supported file types:** `.js`, `.ts`, `.py`, `.html`, `.css`, `.json`, `.md`, `.txt`, `.log`, `.yaml`, `.xml`, `.toml`, `.sql`, `.go`, `.rs`, `.java`, `.c`, `.cpp`, `.rb`, `.php`, `.swift`, `.kt`, `.dart`, `.vue`, `.svelte`, `.sh`, `.bat`, `.ps1`, `.env`, `.csv`

---

## ðŸ—ï¸ Development

```bash
# Clone the repo
git clone https://github.com/Krylo-60/krims-code-cli.git
cd krims-code-cli

# Install dependencies
npm install

# Link for local development
npm link

# Test
Krims Code --help
Krims Code status
Krims Code ask "hello"
```

---

## ðŸ“„ License

MIT License â€” see [LICENSE](LICENSE) for details.

---

## ðŸ‘¨â€ðŸ’» Author

**Krishiv PB** ([@Krylo-60](https://github.com/Krylo-60))

> *"Stay cyberpunk. âš¡"*

---

<p align="center">
  <b>âš¡ Krims Code AI v110 â€” Fusion Command Station âš¡</b><br>
  <i>Universal AI Gateway for the Terminal</i>
</p>
