npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

anakin-ops

v0.9.4

Published

Anakin Ops CLI — single command for autonomous agents, lanes, database, and MCP tools.

Readme

@anakin/cli

Frontier developer platform CLI for Anakin. Dual-surface (Agent-first & Human TTY), built-in MCP server, real-time SSE streaming, remote sandbox bridge, and live counterpart lanes. Zero external dependencies (Node 18+).

   ___             __   _        _____ __   ____
  / _ | ___  ___ _/ /__(_)__    / ___// /  /  _/
 / __ |/ _ \/ _ `/  '_/ / _ \  / /__ / /___/ /  
/_/ |_/_//_/\_,_/_/\_\_/_//_/  \___//_____/___/  

Quick Start

cd packages/anakin-cli
npm run build
npm test

# 1. Inspect environment, OpenAPI spec (64 paths / 76 endpoints), and active profile
node dist/index.js doctor

# 2. Login & Profile Management
node dist/index.js login --key "ak_live_..." --profile default
node dist/index.js whoami

# 3. Sub-spec Search (token-AND search over the API contract, no LLM needed)
node dist/index.js search "lanes thread"
node dist/index.js search "files upload"
node dist/index.js search "database introspect"

# 4. Operate the whole company
node dist/index.js agent list --limit 5
node dist/index.js pages list <agentId>
node dist/index.js ledger ping <agentId>
node dist/index.js lanes send <agentId> <laneId> --message "hello"
node dist/index.js limits

# 5. Stream real-time agent turns in the terminal
node dist/index.js agent chat <agentId> --message "Audit quarterly revenue" --stream

# 6. Run Python in the remote sandbox
node dist/index.js sandbox eval "print(40 + 2)"
node dist/index.js sandbox run script.py --pull workspace/output.pdf --out ./output.pdf

# 7. Connect to the live lane terminal
node dist/index.js lanes live <agentId> <laneId>

# 8. Start the MCP server
node dist/index.js mcp

# 9. Multi-Shell Completion (bash, zsh, fish, powershell)
node dist/index.js completion bash >> ~/.bashrc
node dist/index.js completion powershell >> $PROFILE

Frontier Architecture & Features

1. Dual-Surface Output

  • Agent Mode (--json or pipe/subshell): Emits pure, compact single-line JSON to stdout with structured machine-readable errors on failure.
  • Human TTY Mode (stdout.isTTY): Automatically renders collection endpoints (agent list, lanes list, files list, database list) as crisp, bordered ASCII tables with ANSI-styled method tags.

2. Full-Company Operator Commands

  • Agents: list | get | chat | create | update | delete — the whole lifecycle from the terminal.
  • Tables & SQL: tables list | get | rows | export, sql --query "...", query run | analyze | staging | saved — query workspace tables with automatic JSON column decoding or run arbitrary SQL.
  • Capabilities: list | get | invoke | dry-run | test | stats | calls | propose — inspect, dry-run, test, and invoke agent capabilities.
  • Pages: list | create | update | delete | submissions | audience — the owner publishing surface (auto-resolves primary agent when [agentId] is omitted).
  • Lanes: list | create | send | note | thread | facts | files | digest | read | revoke | live — counterpart delivery (including email) plus the live terminal.
  • Ledger: ping | stock | companies | invoices | chart | periods | warehouses | reconcile | ... — ERP reads across 12 views.
  • Inbox, Workflows & Skills: inbox list, workflows list | run, skills list — inspect escalations, workflows, and agent skills.
  • Files: list | read | details | upload | download | compile | export-pdf | save-artifact | signed-url — the workspace vault end to end.
  • Limits: plan caps, agent counts, and rate limits from live usage.

3. Native Model Context Protocol (MCP) Server (28 Tools)

Turn @anakin/cli into an MCP server for any modern AI IDE or agent (Claude Code, Cursor, Windsurf, Codex):

{
  "mcpServers": {
    "anakin": {
      "command": "npx",
      "args": ["-y", "anakin-ops", "mcp"]
    }
  }
}

Exposes 28 workspace tools with automatic primary-agent resolution:

  • Discovery & Runtime: anakin_search, anakin_execute, anakin_usage_limits, anakin_sandbox_eval
  • Agents & Inbox: anakin_agent_list, anakin_agent_get, anakin_agent_chat, anakin_inbox_list, anakin_workflows_list, anakin_skills_list
  • Workspace Tables & SQL: anakin_tables_list, anakin_tables_rows, anakin_sql_query, anakin_saved_queries_list, anakin_db_list
  • Capabilities: anakin_capabilities_list, anakin_capability_get, anakin_capability_invoke, anakin_capability_dry_run
  • Counterpart Lanes: anakin_lanes_list, anakin_lanes_thread, anakin_lanes_send, anakin_lanes_note
  • Pages & ERP Ledger: anakin_pages_list, anakin_pages_submissions, anakin_ledger_query
  • Files & Vault: anakin_files_list, anakin_files_read

4. Remote Sandbox Execution Bridge

Run Python scripts and calculations inside isolated sandbox containers:

  • anakin sandbox eval "import pandas; print('ready')"
  • anakin sandbox run analyze.py --pull /workspace/chart.png --out ./chart.png

5. Live Lane Counterpart Terminal

  • Connects directly to the lane room over bi-directional WebSockets (anakin lanes live <agentId> <laneId>).
  • Supports typewriter incoming streaming chunks, heartbeat ping/pong keepalive, and live interactive prompt input.

6. Real-Time SSE Token Streaming

anakin agent chat <id> --message "..." --stream reads Server-Sent Events natively over fetch streams:

  • Human TTY: Streams tokens live to the console with typing cadence.
  • Agent mode (--stream --json): Emits structured NDJSON event objects ({ event: "token", data: "..." }).

7. Multi-Profile Credential Store

  • anakin login --key <key> [--profile <name>] [--base-url <url>]
  • Persists credentials securely to ~/.anakin/credentials.json (or %USERPROFILE%\.anakin\credentials.json) with restricted permissions (0600).
  • Priority cascade: --api-key flag $\rightarrow$ ANAKIN_API_KEY $\rightarrow$ anakin.config.json $\rightarrow$ Active User Profile.

8. Humane Safety Confirmation

Mutating or metered operations (capability invoke, lanes revoke, keys rotate) enforce safety:

  • Interactive TTY: Prompts developer with Warning: ... Proceed? [y/N].
  • Non-TTY / Agent: Fails-closed immediately unless explicit --force flag is provided.

Test Suite & Invariants

npm run audit-deps  # Asserts 0 external dependencies
npm test            # Runs 34 unit tests across 14 suites via node:test
TAP version 13
1..14
# tests 34
# suites 14
# pass 34
# fail 0

0.9.0 — Full 8-Sector Workspace Cockpit, Tables, SQL, Capabilities & 28 MCP Tools

  • 8-Sector TUI Cockpit (anakin top / anakin dashboard): Every row across all 8 workspace sectors (1 usage & telemetry, 2 fleet agents, 3 workspace tables, 4 capabilities, 5 counterpart lanes, 6 pages & artifacts, 7 ledger, queries & inbox, 8 files & developer keys) is selectable and scrollable from line 0 to the final line (computeMainViewport + clampAnsiLine overflow protection).
  • Interactive Inspectors & Inline Prompts: Press Enter on any row to open its dedicated scrollable inspector (detailScroll with ↑/↓/PgUp/PgDn/g/G, Esc/Backspace to return). Run inline prompts directly inside the TUI: c (live agent chat), x (custom SQL query), p (Python sandbox eval), i/d (capability invoke/dry-run), m/n (lane message/note), / (global filter).
  • Shared Workspace Engine (src/workspace.ts): Automatic primary Copilot resolution (resolveDefaultAgentId prioritizes general/copilot agents over visitor subagents), automatic decoding of JSON-encoded workspace_table_rows.data columns, and fleet-wide aggregation.
  • New CLI Command Groups: tables list|get|rows|export, sql, query run|analyze|staging|saved, capability list|get|invoke|dry-run|test|stats|calls|propose, inbox list, workflows list|run, skills list, and files read|details. Optional [agentId] across all workspace commands.
  • 28 MCP Server Tools: Expanded anakin mcp from 7 to 28 tools covering tables, SQL, capabilities, lanes, pages, ERP ledger views, inbox, workflows, skills, file content reading, and Python sandbox execution.
  • 34/34 unit tests across 14 suites (computeMainViewport, clampAnsiLine, resolveDefaultAgentId, MCP_TOOLS, trunc ASCII width invariants).

0.8.0 — One scroll list + sticky header

  • Cockpit is now a single unified scroll list: usage → keys → fleet → lanes → files. One cursor (↑↓/j/k, PgUp/PgDn) travels all selectable rows (agents, then lanes); per-panel focus and hide/show are gone.
  • tab jumps between fleet and lanes, 1-5 jumps the viewport to a section, Enter opens the row under the cursor. Footer shows scroll position (1-26/28).
  • Header is a sticky compact 3-row block (gradient ANAKIN wordmark + status, clock/latency, target/profile/identity) — the 5-row block art that clipped narrow terminals is retired from the header.
  • No new tests (30/30 across 11 suites).
  • New src/art.ts: photo-derived ASCII art in 80x27 + 100x34, plain ramp .:-=+*#%@, dark-terminal mapping, zero-dep constants.
  • New anakin art [--width 80|100] command (auto-picks by terminal width, --json supported); shell completions updated.
  • Cockpit A toggles a fullscreen art view (ticks pause while viewing, Enter/Esc backs out); help/footer hints updated.
  • Art unit-tested (30 tests).
  • Header drops the blue block for a big 5x40 ANAKIN block wordmark (royal-to-ice gradient, # ASCII fallback, plain ANAKIN at level 0, single-column stack under 104 cols).
  • Lanes are fleet-wide now: prefetched across all agents in parallel, tagged per agent, sorted unread-first, filter matches counterpart + agent + id; footer/panel show fleet totals instead of selected-agent-only; Enter opens the lane's own agent thread.
  • anakinWord() unit-tested (29 tests).
  • Brand header: white-stick-on-royal-blue logoMark() (5 rows, level-gated truecolor/256/16 + ASCII fallback) beside title block with target, profile, signed-in identity, and health.
  • Fixes your three findings: fleet conversation bars are brand-blue fixed (threshold red only for quota API/fleet-cap bars), files title shows (count · MB) matching its body, usage numbers row no longer fights the identity (own signed in as line).
  • SOTA upgrades: fleet sort S (activity/name/recent), API-pressure sparkline, display-width-aware truncation (CJK/emoji-safe), 72x20 minimum-size gate, SIGTERM/SIGHUP restore, S in help/footer.
  • bar() gains fixedHex for informational quantities; logoMark() + anakinWord() + bundled art unit-tested (30 tests).
  • Numbered panels à la abtop: ¹usage (API window + fleet bars, latency sparkline), ²keys (prefix + last-used rel times), ³fleet (selectable, conversation bars), ⁴lanes (selected agent's lanes, lazy per-agent fetch + cache), ⁵files (recent + storage).
  • tab switches fleet/lanes focus, Enter opens agent detail or lane thread view, 1–5 toggle panels, t toggles anakin/mono theme live.
  • bar() + spark() join the theme engine (threshold colors, ASCII fallback) with unit tests.
  • New src/theme.ts engine: capability detection per stream (levels 0–3), NO_COLOR/FORCE_COLOR/NO_UNICODE honored, --color/--theme/--no-color flags + ANAKIN_THEME env, anakin + mono themes.
  • Trademark system: bold white ▌ section markers (Vercel-▲ style brand glyph), royal→ice gradient wordmark in help, glyph+word badges (never color alone), dim borders, bold content.
  • Downgrade ladder: truecolor ramp → 256/16-quantized solid → plain text; unicode → ASCII (✔→√, ▌→|); pipes stay byte-clean. doctor reports theme/colorLevel/unicode.

0.2.1 — Clean ship (stale build artifacts removed)

  • 0.2.0 accidentally shipped dead dist/cf.js + dist/forge*.js (tsc never deletes stale output). Added npm run clean and made build clean-first so it can't recur.
  • No behavior change from 0.2.0.

0.2.0 — Pure Anakin: no cf, no forge, no outside names

  • Removed command groups: cf (edge-database bridge) and forge (contract/codegen). Removed forge:* npm scripts and the forge keyword.
  • Scrubbed all user-facing outside names (sandbox/bridge/lane copy is now brand-neutral). Completions are fully static (no contract-registry I/O).
  • Kept: everything else, including search over the bundled API contract and the MCP server.

0.1.11 — Full operator: agent CRUD, pages, lane sends, ledger, file builds, limits

  • agent create|update|delete, pages list|create|update|delete|submissions|audience, lanes send|note (counterpart delivery incl. email), ledger <12 views>, files compile|export-pdf|save-artifact, limits (plan caps + rates from usage).
  • Worker: gateway /api/v2/* accepts PATs on the extended allowlist (lanes/ledger/pages reads, lane sends, page writes, file builds); destructive/credential ops stay JWT-only. adminPatScopes.test.ts extended (7 tests).

0.1.10 — anakin cf Cloudflare bridge

  • New group anakin cf d1 <tables|query|agent> [--db engine|cache] [--local|--remote]: runs CF D1 SQL through wrangler (repo-root aware, pinned [email protected], --json parsed into tables). No Anakin API key needed — uses wrangler auth (wrangler login or CLOUDFLARE_API_TOKEN).
  • Reads free-form; remote writes require --force. Agent ids validated before interpolation (no SQL injection from CLI args).
  • cf d1 agent <id> returns the exact agent row (the D1 counterpart of agent get).

0.1.9 — Probe-then-classify (future-proof for PAT-aware backend)

  • Dashboard/smoke attempt all probes (cheap, time-boxed) and classify scope-denials (browser session|Clerk JWT|Invalid JWT parts) with a PAT as skipped, everything else as failed. Against the current JWT-only backend: same clean via web display. After the worker ships PAT reads: sections fill automatically, no CLI change needed.
  • Worker (agent-worker, deploy separately): requireAdminAuth accepts ak_live_* PATs on an explicit allowlist — all GETs on data-connections/files/query/unified-tools (data:read), developer/keys (keys:manage), developer/webhooks (webhooks:manage), plus benign POSTs (connection test/introspect, files upload/signed-url, query run/analyze/python, webhook test). Destructive/credential-lifecycle ops stay JWT-only (403 with clear message). keys/webhooks router middleware consolidated onto requireAdminAuth. New adminPatScopes.test.ts (4 tests); JWT behavior byte-identical (existing auth.test.ts green).

0.1.8 — Scope-aware auth (no more phantom degradation)

  • Root cause: data-connections, files/*, developer/keys|webhooks, query/*, unified-tools/* are Clerk-JWT-only (requireAdminAuth); ak_live_* PATs can never pass them — v1 runtime (auth/agents/usage) is the PAT surface. Probing JWT-only routes with a PAT always 401s.
  • client.ts: looksLikeJWT() / isJwtOnlyPath() / patScopeHint(); 401s on JWT-only paths with a PAT now explain scope + web-app path instead of Invalid JWT parts length: 1.
  • dashboard.ts: JWT-only probes skipped (not fetched) for PATs — skipped[] with reason, patMode flag, counts show web, bands show via web app (browser login). Same run: 0 errors, 5 skipped, ~2.3s (was 5 degraded).
  • smoke.ts: database + storage probes SKIP (not FAIL) for PATs.
  • Backend note (not in this package): make v2 PAT-aware via patService like v1, or document JWT requirement. Direct CF D1 queries from the CLI are impossible (ENGINE_DB is a server binding; query/* is equally JWT-gated).

0.1.7 — Stable cockpit (no shake, one clock, whole platform)

  • No shake: home-cursor redraw (ESC[H + clear-below, no full clear), change-gated renders (identical frames skipped), ticks paused while typing filter / in detail view, default interval 10s (was 3s).
  • One clock: header keeps the single refreshed-at time; footer ok … duplicate removed (hints + transient status only).
  • Whole thing: cockpit now shows Metrics band (credits/runs/files + agents/db/keys/hooks counts), Agents (select + detail), Files (recent 3), DB (recent 3), Platform counts (keys/webhooks from live endpoints). New probes: files/list, developer/keys, developer/webhooks (all degraded gracefully).

0.1.6 — Truly interactive cockpit (keyboard-first rethink)

  • anakin top / anakin dashboard are now interactive by default in a real terminal (alternate screen, hidden cursor). --once for single-shot scripts/CI; --json/pipes/CI auto-fallback to snapshot.
  • Keys (PowerShell/cmd/bash-safe via keypress events): ↑/↓ or j/k move, / filter, Enter agent detail, r refresh, space pause/resume, o open web app, s settings, ? help, q/Esc/Ctrl+C quit. Live auto-refresh (--interval), resize redraw, ⟳ indicator.
  • ONLINE = auth || fleet || usage — flaky auth/me (8s+ timeouts observed) no longer blanks the fleet when agents proves the key. Identity falls back to fleet user_id. Metrics/databases show unavailable per-section instead of guest mode.

0.1.5 — Resilient cockpit (auth-first, partial degradation)

  • dashboard.ts: auth fetched first (8s cap), secondaries parallel (8s each). ONLINE = !!auth (latency no longer blanks auth). Per-section unavailable states + named errors[] ({idx, endpoint, error}). Header shows 2 section(s) degraded, TTY hints --json for details. Fixes 12s OFFLINE when slow/failing data-connections/files/usage hung the full Promise.allSettled.
  • Known server-side: /api/v2/data-connections + /api/v2/files/usage return 401 Invalid JWT parts length: 1 for ak_live_* keys while auth/agents/usage succeed — CLI now degrades instead of going guest. (Resolved: worker requireAdminAuth now accepts ak_live_* PATs on the read allowlist — data-connections, files/*, developer/keys|webhooks GETs plus benign data-plane POSTs, same payloads scoped to the key owner; mutations stay JWT-only. Probes fill automatically, no CLI change needed.)

0.1.4 — SOTA identity (doctor/whoami parity)

  • credentials.ts: typed ActiveCredential (email/createdAt/updatedAt), per-profile validation, atomic tmp+rename writes, profile-name validation, updatedAt tracking, listProfiles().
  • doctor: shows keySource (flag/env/config/profile), stored email, profileUpdatedAt.
  • whoami: self-heals stale/missing stored email when file was the key source (best-effort, no behavior change on failure).

0.1.3 — Hardening + Premium TUI

  • SSE parser hoists event state, handles split chunks, \r\n, [DONE], OpenAI choices[0].delta tokens, onToken/onEvent wired.
  • apiRequest/apiStreamRequest share 30s timeout (--timeout, ANAKIN_TIMEOUT_MS), attach .status/.data on errors.
  • login verifies live; offline save requires --force; 401 never persists. files download --out is binary-safe + contained in cwd.
  • Forge: heuristics-first then exact overlays, sanitized group/action, unique MCP names (96/96), typed schemas, mkdir -p codegen.
  • forge check scans .all(), multiline/backticks, honest spec+code coverage.
  • search ranked, single-char safe, cached. MCP isError inside result, protocol negotiate, arg validation.
  • dashboard spawn-safe browser open, honest ONLINE, clamped watch interval, responsive cockpit. smoke time-boxed + SKIP-aware. taskRunner word-boundary intents + injection-safe sandbox prompt.
  • Parser supports -h/-v, --no-*, --k=false, -- terminator. Version string unified to anakin v0.1.3.