Skip to content

uxname/kodu

Repository files navigation

Kodu 🦄

The AI-First CLI for Modern Developers

Generate contexts, clean code, review PRs, draft commits, and run remote ops—instantly.

npm version License Privacy


⚡ The Problem vs. Kodu

You (Manual) ❌ Kodu (Automated) ✅
Copy-pasting 10 files one by one kodu pack bundles context in 1 click
Hitting token limits with comments kodu clean strips noise deterministically
Context switching for code reviews kodu review checks logic inside your terminal
Writing boring commit messages kodu commit generates semantic git messages
SSHing around servers manually kodu ops runs machine-readable remote operations

🚀 Instant Start

Don't want to install? Run it directly:

# 1. Initialize config (creates kodu.json)
npx kodu init

# 2. Bundle your project to clipboard
npx kodu pack --copy

Or install globally for speed (<0.5s startup):

npm install -g kodu

🛡️ Privacy & Security

We know trust is paramount when dealing with code.

  • Local Execution: Code analysis runs locally.
  • Zero Data Retention: We don't store your code.
  • Explicit Control: .env, node_modules, and lockfiles are ignored by default.
  • You Own the Keys: Your API key (OPENAI_API_KEY) goes directly to the provider.

💡 Common Workflows

1. "I need to ask ChatGPT about my project"

Pack your entire source code (minus ignored files) into the clipboard, optimized for tokens.

kodu pack --copy
# Output: Copied 45 files (12k tokens) to clipboard. Paste into ChatGPT!

2. "I want to save money on API costs"

Strip comments and docs to reduce token count by ~30% before sending.

# Preview savings
kodu clean --dry-run

# Clean only what you changed (Great for PRs)
kodu clean --changed

3. "Check my code before I push"

Get an AI review of your staged changes without leaving the terminal.

# Detect bugs and logical errors
kodu review --mode bug

# Check for security leaks
kodu review --mode security

4. "I need my agent to inspect a server"

Run remote diagnostics and operations via kodu ops with strict JSON output.

# Server health snapshot
kodu ops sysinfo dev

# Manage app env vars remotely
kodu ops env dev set my-app --key NODE_ENV --val production

# Read Caddy routes (raw Caddyfile)
kodu ops routes dev list

⚙️ Configuration

Kodu creates a kodu.json in your root. It's pre-configured, but fully hackable.

Click to see example configuration
{
  "llm": {
    "model": "openai/gpt-4o",
    "apiKeyEnv": "OPENAI_API_KEY"
  },
  "cleaner": {
    // Kodu will NEVER remove comments starting with these:
    "whitelist": ["//!"]
  },
  "packer": {
    "ignore": ["package-lock.json", "dist", "coverage"]
  },
  "ops": {
    "servers": {
      "dev": {
        "host": "example.com",
        "port": 22,
        "user": "ubuntu",
        "sshKeyPath": "~/.ssh/id_rsa",
        "paths": {
          "apps": "/var/agent-apps",
          "caddy": "/var/agent-apps/caddy"
        }
      }
    }
  },
  "prompts": {
    "review": {
      "bug": ".kodu/prompts/review-bug.md"
    }
  }
}

kodu ops is designed for agents: responses are strict JSON (including errors), with no spinner/colors/prompts.


🏎️ Tech Stack (Fresh & Modern)

Built for speed and maintainability.

  • Runtime: Node.js (ESM)
  • Framework: NestJS + Commander
  • Parsing: ts-morph (AST-based, not Regex)
  • Globbing: tinyglobby
  • UI: @inquirer + yocto-spinner

Built with ❤️ for productive developers.
ContributingLicense

Releases

No releases published

Packages

 
 
 

Contributors