JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 18
  • Score
    100M100P100Q50630F
  • License Apache-2.0

SpacialCode — terminal-native AI coding assistant. Uses your Claude plan (via the official Claude Code CLI) or Codex/OpenAI. No SaaS lock-in.

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

    Readme

    spacialcode

    Terminal-native AI coding assistant. A polished Ink/React TUI that talks to the model you choose — your Claude Pro/Max plan, your OpenAI account, or raw API keys — without locking you into any of them.

      ███████╗ ██████╗  █████╗  ██████╗██╗ █████╗ ██╗
      ██╔════╝██╔════╝ ██╔══██╗██╔════╝██║██╔══██╗██║
      ███████╗██║      ███████║██║     ██║███████║██║
      ╚════██║██║      ██╔══██║██║     ██║██╔══██║██║
      ███████║╚██████╗ ██║  ██║╚██████╗██║██║  ██║███████╗
      ╚══════╝ ╚═════╝ ╚═╝  ╚═╝ ╚═════╝╚═╝╚═╝  ╚═╝╚══════╝
                      c o d e

    Why

    You probably already pay Anthropic or OpenAI. You probably don't want to pay a third SaaS to wrap them. SpacialCode is a local CLI that:

    • looks and feels like a modern coding-agent TUI (banner, slash commands, streaming, approval gates, project memory),
    • can drive the official claude CLI as a subprocess so your prompts bill to your Claude Pro/Max plan, not API credits,
    • can also drive codex for your ChatGPT/Codex login,
    • or talk directly to Anthropic / OpenAI with your own API keys,
    • stores nothing in the cloud — ~/.spacialcode/ and .spacialcode/ are just files you can read and edit.

    Install

    curl -fsSL https://spacialmind.com/install/spacialcode.sh | bash
    # or:
    npm install -g spacialcode

    Then verify:

    spacialcode --version
    spacialcode providers     # what's installed / logged in on this machine

    First run

    spacialcode

    Inside the TUI, type /login. You'll be walked through four options:

    choice what it does billing
    claude-cli Drives your installed claude CLI. You log in once with claude /login. Your plan
    claude-api Pastes an Anthropic API key, stored at ~/.spacialcode/auth.json (0600). Per-token
    codex-cli Drives your installed codex CLI. Your account
    openai-api Pastes an OpenAI API key. Per-token

    The "plan" route never sends your credentials through SpacialCode — the official Anthropic CLI holds the tokens, we just shell out to it.

    Quick tour

    cd path/to/your/project
    spacialcode                                    # interactive REPL
    spacialcode run "fix the failing auth test"    # one-shot prompt
    spacialcode accounts list                      # saved accounts
    spacialcode config show                        # resolved config
    spacialcode config set-mode trusted            # ask | trusted | yolo

    Inside the REPL:

    /help              all commands
    /providers         show available providers + their status
    /provider <id>     switch active provider
    /model <id>        set the model (e.g. claude-sonnet-4-5)
    /mode <m>          ask | trusted | yolo
    /login             add / switch an account
    /accounts          list saved accounts
    /memory [note]     read or append .spacialcode/memory.md
    /tools             list registered tools (Read, Write, Edit, Bash, Glob, Grep, Todo)
    /cost              session token usage
    /clear             clear conversation
    /quit              exit

    Ctrl+C interrupts an in-flight response; Ctrl+D exits.

    Approval modes

    mode behavior
    ask Prompt on every write/exec. Safest.
    trusted Auto-allow read-only ops; prompt on writes and shell.
    yolo Auto-approve, but still ask on obviously destructive commands.

    Picking "always" inside a prompt remembers that tool for the rest of the session.

    Files

    path what
    ~/.spacialcode/config.json user-wide defaults
    ~/.spacialcode/auth.json saved accounts / API keys (0600 perms)
    ~/.spacialcode/memory.md global running notes (sent as context every turn)
    ~/.spacialcode/spacialcode.log rolling debug log
    .spacialcode/config.json per-project overrides
    .spacialcode/memory.md per-project running notes

    Architecture

      user input
          │
          ▼
      Ink TUI  ──────────  slash commands  /login /mode /memory …
          │                       │
          │                       ▼
          │                approval gate (ask | trusted | yolo)
          │                       │
          ▼                       ▼
      provider registry ────►  active provider
          │                       │
          ├── claude-cli  ──── spawns `claude -p`     (Plan billing)
          ├── claude-api  ──── @anthropic-ai/sdk
          ├── codex-cli   ──── spawns `codex exec`
          └── openai-api  ──── openai SDK

    Tools (Read, Write, Edit, Bash, Glob, Grep, Todo) live in src/tools/. Each has a single risk level and goes through the approval gate. Add a tool by implementing Tool from src/tools/base.ts and registering it in src/tools/registry.ts.

    Providers live in src/providers/. Add a provider by implementing Provider from src/providers/base.ts and registering it in src/providers/registry.ts.

    Development

    npm install
    npm run build              # tsc → dist/
    npm run typecheck
    npm run smoke              # build + scripts/smoke-test.mjs
    node bin/spacialcode.js providers

    License

    Apache-2.0