🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@kyma-api/cli

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kyma-api/cli

Terminal interface for 21+ AI models. Chat, code, and manage your account.

latest
Source
npmnpm
Version
1.3.0
Version published
Maintainers
1
Created
Source

Kyma CLI

Ψ Terminal interface for 21+ AI models. One command to chat, code, and manage your account.

npm license node

Kyma is an LLM API gateway with 21+ open-source models (Qwen, DeepSeek, Llama, Gemma, Kimi, and more) at transparent pricing. This CLI brings it to your terminal—interactive chat, code agents with tool use, git diff review, and session persistence.

Quick Start

npm install -g @kyma-api/cli
kyma login
kyma "What is a Merkle tree?"

Login opens your browser. Create a free account, get $0.50 starting credits.

Examples

Interactive chat:

kyma
> Ask me anything...

One-shot prompt:

kyma "Optimize this SQL query for 100M rows"

Code agent with tools (read, edit, search, bash):

kyma code "Add error handling to auth.ts"

AI-powered git diff review:

kyma diff
kyma diff --staged
kyma diff main

Pipe files into the agent:

cat src/server.ts | kyma "Refactor this for readability"

Resume a conversation:

kyma history
kyma --continue

Modes

ModeModelCostBest For
fastQwen 3-32B~$0.10/MQuick answers, low latency
cheapGemma 4 31B~$0.00/MFree/near-free inference
deepKimi K2.5~$0.50/MComplex reasoning, best quality
autoKyma picksvariesDefault—best model for your task

Set mode with -M or --mode:

kyma -M deep "Analyze this algorithm complexity"
kyma --mode cheap "Draft an email"

Or use a specific model:

kyma -m deepseek-r1 "Prove this theorem"
kyma -m gemini-3-flash "Extract data from HTML"

Commands

kyma [prompt]                 Chat (interactive or one-shot)
kyma code [task]              Code agent with tool use
kyma diff [target]            Review git changes with AI
kyma history                  List & manage past sessions
kyma models                   Browse available models
kyma balance                  Show credits and tier
kyma keys                     Manage API keys
kyma status                   Account overview
kyma config                   View/set defaults
kyma login                    Authenticate
kyma logout                   Clear saved credentials

Configuration

Config is stored in ~/.kyma/config.json:

{
  "api_key": "ky_xxx",
  "default_mode": "auto",
  "default_model": "deepseek-v3",
  "base_url": "https://kymaapi.com"
}

View and set config:

kyma config
kyma config default_mode deep

Flags

FlagPurpose
-m, --model <id>Use a specific model (overrides mode)
-M, --mode <mode>Set mode: fast, cheap, deep, auto
--api-key <key>Use a specific API key
--continue [id]Resume a session (use last if no ID given)
--stagedFor diff—review only staged changes
--jsonMachine-readable JSON output
--quietSuppress decorative output
--versionShow version
--helpShow help

Real-Time Metrics

Every response shows token count and cost:

⚡ 1,234 tokens in 2.4s (512 cached at 90% discount)
💰 Cost: $0.024 | Saved: $0.216 with prompt caching

Sessions persist in ~/.kyma/sessions/ and auto-resume where you left off.

Code Agent Tools

When you run kyma code, you get tools that the agent can use:

  • read — Read file contents
  • edit — Modify files
  • search — Grep + glob for patterns
  • bash — Execute shell commands

The agent runs in an approval-required loop: each tool use is shown before executing.

Architecture

Kyma CLI is built on 5 core equations:

  • INPUT — Parse user intent, collect context
  • ROUTE — Choose the right model (by mode or explicit selection)
  • OUTPUT — Stream or display the response
  • SETTLE — Track tokens, cost, and cache hits
  • OBSERVE — Save sessions, provide metrics

Each maps to a core module. Sessions maintain message history and can be resumed.

Supported Models

21 models across 5 quality tiers:

  • Tier 1 (best): Qwen 3.6, DeepSeek V3/R1, Kimi K2.5, Gemma 4, Qwen 3-Coder, Llama 3.3, MiniMax
  • Tier 2 (high): Kimi K2, Gemma 4 MoE, Nemotron, Gemini 2.5 Flash, Qwen 3-Coder
  • Tier 3 (fast): Llama Scout, Gemini 2.5 Flash Lite, Step 3.5, GLM 4.5

Prices vary by model. Use kyma models to see all options and current pricing.

Billing

  • Free plan: $0.50 starting credits, no card required
  • Pay-as-you-go: $0.00–$0.50 per million tokens (varies by model)
  • Auto top-up: Set a threshold and amount, charges your saved card

Check your balance:

kyma balance

Purchase credits at https://kymaapi.com/dashboard/billing or via the CLI.

Environment Variables

Optional overrides (flags take precedence):

KYMA_API_KEY="ky_xxx"          # API key
KYMA_MODE="deep"               # Default mode
KYMA_MODEL="deepseek-r1"       # Default model
KYMA_BASE_URL="https://..."    # Custom endpoint (dev/self-hosted)

Scripting & Automation

For scripting, combine --json and --quiet:

kyma "Summarize this" --json --quiet | jq '.cost'

Pipe stdin into prompts:

find . -name "*.ts" | kyma "Find security issues in these files"

What Makes Kyma Different

  • Simple routing: 21 models, no account juggling. Set a mode, we pick the best.
  • Transparent pricing: See exact token count and cost on every response.
  • Prompt caching: Repeated context costs 90% less (10% of input price).
  • Tool use: Code agent with read/edit/search/bash for agentic workflows.
  • Session persistence: Conversations saved locally, resume anytime.
  • Open source: MIT licensed. Self-host if you prefer—use KYMA_BASE_URL to point to your own server.

Docs

Development

Clone the repo and build:

git clone https://github.com/kyma-api/cli
cd kyma-cli
npm install
npm run build
./dist/cli.js --version

Tech stack:

  • Runtime: Bun (compile to Node.js)
  • CLI framework: Clack (for prompts), Chalk (for colors)
  • Size: 99KB minified
  • Dependencies: 2 runtime (chalk, @clack/prompts)

Contributing

Contributions welcome. Start with issues marked good first issue.

License

MIT. See LICENSE.

Need Help?

Keywords

ai

FAQs

Package last updated on 12 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts