JSPM

  • Created
  • Published
  • Downloads 74
  • Score
    100M100P100Q123359F
  • License MIT

Zero-config CLI to use any open-source coding agent with TokenMix as the unified LLM backend.

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 (tokenmix) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    TokenMix CLI

    Zero-config CLI to use any open-source coding agent with TokenMix as the unified LLM backend.

    One account, one balance, 160+ models routed automatically across Claude / GPT / Gemini / DeepSeek / Qwen / Moonshot / ...

    Why TokenMix

    Behind the zero-config CLI is a gateway built to be the honest, transparent LLM backend for BYOK coding agents:

    • Transparent, real-time billing. tokenmix balance shows your actual balance, gift credit, and total spent — to micro-USD precision, not opaque "credits". tokenmix models lists every model's real price (free models show $0, not a dash).
    • Prompt caching that saves you money — automatically. Cache hits bill at the discounted rate with nothing to configure: OpenAI / DeepSeek / Gemini / Qwen via their cached_tokens, Anthropic via cache_control pass-through (cache reads ≈10% of the input price). The savings are yours, and you can see them.
    • One key, every protocol. OpenAI Chat Completions, Anthropic Messages, and the Responses API — all on one account, which is why every agent below (terminal and editor alike) runs on a single balance.
    • Non-invasive by design. Configuring an agent never clobbers your setup: your Claude settings are backed up and restored, Codex's provider is injected at launch (your ~/.codex/config.toml stays untouched), and tokenmix logout reverts everything. Credentials are stored locally at 0600.

    Quick Start

    # 1. Log in (opens browser, confirm a short code)
    npx tokenmix login
    
    # 2. Launch an agent
    npx tokenmix opencode          # install + configure + start OpenCode
    npx tokenmix claude            # install + configure + start Claude Code
    npx tokenmix aider             # configure + start Aider (Python required)
    npx tokenmix kilo              # print Kilo Code VSCode configuration
    npx tokenmix cline             # print Cline VSCode configuration
    npx tokenmix roo               # print Roo Code VSCode configuration
    npx tokenmix continue          # print Continue config.yaml snippet
    npx tokenmix codex             # install + configure + start Codex
    npx tokenmix qwen              # install + configure + start Qwen Code
    npx tokenmix goose             # configure + start Goose (install it first)

    Alternative login modes

    npx tokenmix login --paste                     # interactive paste prompt (no browser)
    npx tokenmix login --key sk-tm-...             # supply API key directly (for CI / scripts)

    Supported Agents

    Agent Install CLI Action
    OpenCode npm i -g opencode-ai full auto
    Claude Code npm i -g @anthropic-ai/claude-code full auto
    Aider pip install aider-chat semi auto
    Kilo Code VSCode extension config-only
    Cline VSCode extension config-only
    Roo Code VSCode extension config-only
    Continue VSCode / JetBrains config-only
    Codex npm i -g @openai/codex full auto
    Qwen Code npm i -g @qwen-code/qwen-code full auto
    Goose install script semi auto

    Commands

    tokenmix login [--key sk-tm-xxx]   Log in
    tokenmix logout                     Remove credentials (and revert injected agent config)
    tokenmix balance                    Show your live balance (or open the dashboard)
    tokenmix topup                      Open browser to top up
    tokenmix models [--type chat]       List available models with prices
    tokenmix list                       List supported agents
    tokenmix doctor                     Diagnose configuration
    
    tokenmix opencode [args...]         Launch OpenCode via TokenMix
    tokenmix claude [args...]           Launch Claude Code via TokenMix
    tokenmix aider [args...]            Launch Aider via TokenMix
    tokenmix kilo                       Print Kilo Code configuration
    tokenmix cline                      Print Cline configuration
    tokenmix roo                        Print Roo Code configuration
    tokenmix continue                   Print Continue config.yaml snippet
    tokenmix codex [args...]            Launch Codex via TokenMix
    tokenmix qwen [args...]             Launch Qwen Code via TokenMix
    tokenmix goose [args...]            Launch Goose via TokenMix

    Language

    The CLI speaks English, 中文, 日本語, 한국어, Español, and Français — the same six languages as tokenmix.ai — auto-detected from your system locale (LANG / LC_ALL). Force it explicitly with TOKENMIX_LANG:

    TOKENMIX_LANG=zh npx tokenmix doctor   # 中文
    TOKENMIX_LANG=ja npx tokenmix doctor   # 日本語
    TOKENMIX_LANG=fr npx tokenmix doctor   # Français

    Configuration Location

    Your TokenMix credentials are stored locally at:

    • macOS: ~/Library/Application Support/tokenmix/config.json
    • Linux: ~/.config/tokenmix/config.json (respects XDG_CONFIG_HOME)
    • Windows: %APPDATA%/tokenmix/config.json

    File permissions are restricted to 0600 (owner read/write only).

    Development

    pnpm install
    pnpm dev opencode

    License

    MIT — see LICENSE