Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (kob-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
đ¤ KOB AI CLI
Command-line interface for interacting with KOB AI API. Built with Bun and TypeScript.
Developed by Kob AI â www.kob-ai.dev | Developer in Thailand đšđ
⨠Features
- đĨī¸ TUI Mode - Full-screen interactive coding agent (default when running
kobwith no args) - đ Authentication - Verify credentials and check balance
- đŦ AI Chat - Send messages and get AI responses
- đ Streaming - Real-time streaming AI responses
- đĄ Ask - Quick one-shot question answering
- đģ Code - AI code generation with auto file creation
- đ¤ Models - Browse available AI models and pricing
- đ§ Skills - List all available CLI skills
- đ¨ Rich Output - Beautiful terminal output with colors and formatting
đ Quick Start
Prerequisites
- Bun runtime installed (Install Bun)
- KOB AI API credentials (API Key)
Installation via npm (recommended)
npm install -g kob-cliInstallation from source
- Clone or navigate to the kob-cli directory:
cd kob-cli- Install dependencies:
bun install- Set up environment variables:
# Copy the example env file
cp .env.example .env
# Edit .env and add your credentials
# KOB_API_BASE_URL=https://www.kob-ai.dev
# KOB_API_KEY=kob_your_api_keyOr export them directly:
export KOB_API_KEY=kob_your_api_keyUsage
Run the CLI directly with Bun:
bun run src/index.ts <command>Or use the npm script:
bun dev <command>đ Commands
TUI Mode (Default)
Run kob with no arguments to launch the full-screen interactive TUI:
kobThe TUI has 3 modes switchable with Tab or 1/2/3:
- Ask (
/ask) â Quick Q&A - Plan (
/plan) â Get an implementation plan before coding - Code (
/code) â Generate code + auto-run shell commands
Slash commands inside TUI: /models, /config, /clear, /help, /exit
Authentication
Verify credentials:
bun dev auth:verifyShows user information, package details, and credit balance.
Check balance:
bun dev balanceQuick check of your current credit balance.
Ask
Ask a one-shot question:
bun dev ask "What is a closure in JavaScript?"
bun dev ask "ā¸ā¸ā¸´ā¸ā¸˛ā¸ĸ recursion ā¸Ģā¸āšā¸ā¸ĸ" --provider DeepSeek --model deepseek-chatAI Chat
Send a message:
bun dev chat "Explain quantum computing" \
--provider DeepSeek \
--model deepseek-chat \
--temperature 0.7Interactive chat mode:
bun dev chat:interactive \
--provider OpenRouter \
--model openai/gpt-4oInteractive commands: /clear, /stats, /help, /exit
Code Generation
Generate code:
bun dev code "Write a REST API in Python" --lang pythonIf no prompt is given, launches the TUI in Code mode:
bun dev codeStreaming
Stream AI response:
bun dev stream "Write a poem about coding" \
--provider OpenRouter \
--model google/gemini-flash-1.5Real-time token-by-token display as AI generates response.
Models
List all models:
bun dev modelsFilter by provider:
bun dev models --provider DeepSeekJSON output:
bun dev models --format jsonSkills
List all available CLI skills:
bun dev skillsđ§ Options
Chat, Ask, Stream & Code Options
| Option | Description | Default |
|---|---|---|
-p, --provider |
AI provider (DeepSeek, OpenRouter, DeepInfra) | DeepSeek |
-m, --model |
Model ID | deepseek-chat |
-t, --temperature |
Temperature (0.0-2.0) | 0.7 |
--max-tokens |
Maximum tokens | 4096 |
--system-prompt |
System prompt | - |
--lang |
Programming language hint (code command only) | - |
Common Providers and Models
DeepSeek:
deepseek-chat(DeepSeek V3)deepseek-reasoner(DeepSeek R1)deepseek-v4-prodeepseek-v4-flash
OpenRouter:
openai/gpt-4oopenai/gpt-4o-minianthropic/claude-3.5-sonnetgoogle/gemini-1.5-pro
DeepInfra:
meta-llama/Meta-Llama-3.1-8B-Instructmeta-llama/Meta-Llama-3.1-70B-InstructQwen/Qwen2.5-72B-Instruct
đĄ Examples
Complete Workflow
# 1. Verify connection
bun dev auth:verify
# 2. Check available models
bun dev models --provider DeepSeek
# 3. Ask a quick question
bun dev ask "ā¸ā¸ā¸´ā¸ā¸˛ā¸ĸ async/await āšā¸ JavaScript"
# 4. Generate code
bun dev code "Write a Express.js REST API with CRUD endpoints" --lang javascript
# 5. Chat interactively
bun dev chat:interactive --provider DeepSeek --model deepseek-chat
# 6. Stream response for longer content
bun dev stream "Write a detailed guide about AI" \
--model openai/gpt-4o
# 7. Check credit balance
bun dev balance
# 8. Or just launch TUI for everything
kobđ Development
Project Structure
kob-cli/
âââ src/
â âââ index.ts # CLI entry point (also launches TUI if no args)
â âââ commands/ # One-shot CLI commands
â â âââ auth.ts # auth:verify, balance
â â âââ chat.ts # chat, chat:interactive
â â âââ stream.ts # stream
â â âââ models.ts # models
â â âââ ask.ts # ask
â â âââ code.ts # code
â â âââ skills.ts # skills
â âââ ui/ # TUI (full-screen mode)
â â âââ code-tui.tsx # Main TUI component (CodeEngine)
â â âââ colors.ts # Shared color tokens
â â âââ model-picker.tsx # Model selection overlay
â â âââ config-form.tsx # .env editor overlay
â âââ utils/ # Utility modules
â â âââ api.ts # API client (KobApiClient)
â â âââ config.ts # Configuration (getConfig)
â â âââ env-file.ts # .env read/write
â â âââ format.ts # Output formatting
â â âââ errors.ts # Error handling
â âââ types/ # TypeScript types
â âââ index.ts
âââ bin/
â âââ cli.cjs # CJS shim entry point
âââ .env.example # Environment variables template
âââ package.json
âââ README.mdAdding New Commands
- Create command file in
src/commands/ - Export the command
- Import and add to
src/index.ts
Build for Distribution
bun run buildThis creates a compiled binary kob-cli.exe.
â Troubleshooting
Error: KOB_API_KEY environment variable is required
- Make sure you've set your environment variables
- Check that they're exported correctly or in .env file
Authentication failed
- Verify your API key is correct
- Check that your key is active on the Kob AI dashboard
Insufficient credits
- Check your balance with
bun dev balance - Top up your account at https://www.kob-ai.dev
Model not available
- List available models with
bun dev models - Verify the model ID is correct
đ Documentation
- MANUAL.md â ā¸ā¸šāšā¸Ąā¸ˇā¸ā¸ā¸˛ā¸Ŗāšā¸āšā¸ā¸˛ā¸ā¸ā¸ā¸ąā¸āšā¸āšā¸Ą (ā¸ ā¸˛ā¸Šā¸˛āšā¸ā¸ĸ)
- QUICKSTART.md â āšā¸Ŗā¸´āšā¸Ąā¸āšā¸āšā¸āšā¸ā¸˛ā¸ā¸ā¸ĸāšā¸˛ā¸ā¸Ŗā¸§ā¸āšā¸Ŗāšā¸§
- PROJECT.md â ā¸Ēā¸ā¸˛ā¸ā¸ąā¸ā¸ĸā¸ā¸Ŗā¸Ŗā¸Ąāšā¸Ĩ⏰āšā¸ā¸Ŗā¸ā¸Ē⏪āšā¸˛ā¸āšā¸ā¸Ŗāšā¸ā¸
- AGENTS.md â ā¸ā¸šāšā¸Ąā¸ˇā¸ā¸Ē⏺ā¸Ģā¸Ŗā¸ąā¸ā¸ā¸ąā¸ā¸ā¸ąā¸ā¸ā¸˛ / AI agents
- SPECTS.md â Technical specifications
đ License
KOB AI CLI - Non-Commercial Open Source License
Copyright (c) 2025 KOB AI Project Owner
This software is open source and free to use, modify, and distribute for non-commercial purposes only.
Commercial use is strictly prohibited without prior written permission from the owner.
For commercial licensing inquiries, please contact the project owner.
See the LICENSE file for full terms.
đ¤ Support
For issues or questions, please visit https://www.kob-ai.dev or contact the Kob AI development team.