@codespar/cli
Advanced tools
+1
-1
@@ -14,3 +14,3 @@ #!/usr/bin/env node | ||
| import { c } from "./output.js"; | ||
| const VERSION = "0.2.0"; | ||
| const VERSION = "0.2.1"; | ||
| const program = new Command(); | ||
@@ -17,0 +17,0 @@ program |
+1
-1
| { | ||
| "name": "@codespar/cli", | ||
| "version": "0.2.0", | ||
| "version": "0.2.1", | ||
| "description": "CodeSpar CLI — authenticate, browse servers, execute tools, manage sessions, stream logs, and scaffold projects from your terminal.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
+33
-63
| # @codespar/cli | ||
| Command-line interface for [CodeSpar](https://codespar.dev) — authenticate, inspect servers, execute tools, and manage sessions from your terminal. | ||
| Command-line interface for CodeSpar — authenticate, browse servers, execute tools, manage sessions, stream logs, and scaffold projects from your terminal. | ||
@@ -11,21 +11,13 @@ ## Install | ||
| Verify: | ||
| ## Usage | ||
| ```bash | ||
| codespar --version | ||
| ``` | ||
| ## Quick start | ||
| ```bash | ||
| # One-time: authenticate with your API key | ||
| # Authenticate (stores API key in ~/.codespar/config.json) | ||
| codespar login | ||
| # Inspect the catalog | ||
| # Browse 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 | ||
| # Run a single tool call | ||
| codespar execute codespar_pay \ | ||
@@ -35,6 +27,8 @@ --server asaas \ | ||
| # Manage sessions | ||
| # Manage sessions and logs | ||
| codespar sessions list | ||
| codespar sessions show ses_abc123 --logs | ||
| codespar sessions close ses_abc123 | ||
| codespar logs tail --server stripe | ||
| # Scaffold a new agent | ||
| codespar init my-agent | ||
| ``` | ||
@@ -44,8 +38,8 @@ | ||
| | Command | What it does | | ||
| |---------|--------------| | ||
| | `login` | Save your API key to `~/.codespar/config.json` | | ||
| | Command | Description | | ||
| |---------|-------------| | ||
| | `login` | Save API key to `~/.codespar/config.json` | | ||
| | `logout` | Clear the stored API key | | ||
| | `whoami` | Show authenticated user, org, project, and key scopes | | ||
| | `servers list` | List the server catalog (filter by `--category`, `--region`) | | ||
| | `whoami` | Show authenticated user, org, project, and scopes | | ||
| | `servers list` | List servers (filter by `--category`, `--region`) | | ||
| | `servers show <id>` | Show a server's details and tools | | ||
@@ -59,22 +53,15 @@ | `tools list` | List tools (filter by `--server`) | | ||
| | `connect list` | List active Connect Links per user | | ||
| | `connect start <server>` | Start an OAuth Connect Link flow (add `--open` to launch it) | | ||
| | `connect start <server>` | Start an OAuth Connect Link flow (add `--open`) | | ||
| | `connect revoke <server>` | Revoke a connection | | ||
| | `logs tail` | Stream tool-call logs in real time (filter by `--server`, `--status`, `--tool`) | | ||
| | `logs tail` | Stream tool-call logs in real time (SSE) | | ||
| | `init <name>` | Scaffold a new commerce agent from a template | | ||
| ### Templates available via `init` | ||
| ## Global flags | ||
| | Slug | Stack | What you get | | ||
| |------|-------|--------------| | ||
| | `pix-agent` | Node + OpenAI | Minimal Pix charge + WhatsApp notify loop | | ||
| | `ecommerce-checkout` | Node + Claude | Full Complete Loop: checkout → invoice → ship → notify | | ||
| | `streaming-chat` | Next.js + Vercel AI | Token-by-token streaming commerce chat | | ||
| | `multi-tenant` | Next.js + OpenAI | One API key, N tenants, per-tenant billing | | ||
| | Flag | Description | | ||
| |------|-------------| | ||
| | `--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) | | ||
| 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 | ||
@@ -88,34 +75,17 @@ | ||
| ## Scripting | ||
| ## Templates | ||
| Output is valid JSON on stdout and human messages on stderr, so you can pipe cleanly: | ||
| | Slug | Stack | | ||
| |------|-------| | ||
| | `pix-agent` | Node + OpenAI — minimal Pix charge + WhatsApp notify | | ||
| | `ecommerce-checkout` | Node + Claude — full Complete Loop | | ||
| | `streaming-chat` | Next.js + Vercel AI — token-by-token streaming | | ||
| | `multi-tenant` | Next.js + OpenAI — one API key, N tenants | | ||
| ```bash | ||
| # IDs of all servers that handle Pix | ||
| codespar servers list --json \ | ||
| | jq -r '.[] | select(.capabilities | contains(["pix"])) | .id' | ||
| ## Need more? | ||
| # 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]' | ||
| ``` | ||
| For production workloads with governance, audit trails, policy engines, self-hosted runtimes, and enterprise commerce primitives (mandates, escrow, payment routing), see **[CodeSpar Enterprise](https://codespar.dev/enterprise)**. | ||
| Use `--json` explicitly when piping — the CLI defaults to tables in a TTY. | ||
| ## Development | ||
| This package lives in the `codespar-core` monorepo. | ||
| ```bash | ||
| # 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 | ||
| MIT — [codespar.dev](https://codespar.dev) |
92145
-0.79%87
-25.64%