Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@codespar/cli

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codespar/cli

CodeSpar CLI — authenticate, browse servers, execute tools, manage sessions, stream logs, and scaffold projects from your terminal.

Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
45
-35.71%
Maintainers
1
Weekly downloads
 
Created
Source

@codespar/cli

Command-line interface for CodeSpar — authenticate, inspect servers, execute tools, and manage sessions from your terminal.

Install

npm install -g @codespar/cli

Verify:

codespar --version

Quick start

# One-time: authenticate with your API key
codespar login

# Inspect the catalog
codespar servers list
codespar servers show stripe
codespar tools list --server asaas
codespar tools show codespar_pay

# Run a one-shot tool call
codespar execute codespar_pay \
  --server asaas \
  --input '{"method":"pix","amount":15000,"currency":"BRL"}'

# Manage sessions
codespar sessions list
codespar sessions show ses_abc123 --logs
codespar sessions close ses_abc123

Commands

CommandWhat it does
loginSave your API key to ~/.codespar/config.json
logoutClear the stored API key
whoamiShow authenticated user, org, project, and key scopes
servers listList the server catalog (filter by --category, --region)
servers show <id>Show a server's details and tools
tools listList tools (filter by --server)
tools show <name>Show a tool's full input/output schema
execute <tool>Run a single tool call in a throwaway session
sessions listList recent sessions (filter by --status, --limit)
sessions show <id>Show session details (add --logs for tool calls)
sessions close <id>Close an active session
connect listList active Connect Links per user
connect start <server>Start an OAuth Connect Link flow (add --open to launch it)
connect revoke <server>Revoke a connection
logs tailStream tool-call logs in real time (filter by --server, --status, --tool)
init <name>Scaffold a new commerce agent from a template

Templates available via init

SlugStackWhat you get
pix-agentNode + OpenAIMinimal Pix charge + WhatsApp notify loop
ecommerce-checkoutNode + ClaudeFull Complete Loop: checkout → invoice → ship → notify
streaming-chatNext.js + Vercel AIToken-by-token streaming commerce chat
multi-tenantNext.js + OpenAIOne API key, N tenants, per-tenant billing

Every command supports:

  • --json — machine-readable JSON output (pipe into jq)
  • --api-key <key> — override the stored key
  • --base-url <url> — point at a custom API (staging, self-hosted)

Configuration

Resolution order (first match wins):

  • Command-line flags (--api-key, --base-url)
  • Environment variables (CODESPAR_API_KEY, CODESPAR_BASE_URL)
  • Config file at ~/.codespar/config.json (chmod 600)

Scripting

Output is valid JSON on stdout and human messages on stderr, so you can pipe cleanly:

# IDs of all servers that handle Pix
codespar servers list --json \
  | jq -r '.[] | select(.capabilities | contains(["pix"])) | .id'

# p95 latency of the last 100 stripe calls in a session
codespar sessions show ses_abc123 --logs --json \
  | jq '[.logs[] | select(.server == "stripe") | .duration_ms] | sort | .[95]'

Use --json explicitly when piping — the CLI defaults to tables in a TTY.

Development

This package lives in the codespar-core monorepo.

# From repo root
npm install
npm run build --workspace @codespar/cli
npm run typecheck --workspace @codespar/cli

# Run the local build directly
node packages/cli/dist/index.js --help

License

MIT © CodeSpar

Keywords

cli

FAQs

Package last updated on 19 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