@codespar/cli 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -63
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @codespar/cli
|
|
2
2
|
|
|
3
|
-
Command-line interface for
|
|
3
|
+
Command-line interface for CodeSpar — authenticate, browse servers, execute tools, manage sessions, stream logs, and scaffold projects from your terminal.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -8,43 +8,37 @@ Command-line interface for [CodeSpar](https://codespar.dev) — authenticate, in
|
|
|
8
8
|
npm install -g @codespar/cli
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Usage
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
codespar
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Quick start
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
# One-time: authenticate with your API key
|
|
14
|
+
# Authenticate (stores API key in ~/.codespar/config.json)
|
|
21
15
|
codespar login
|
|
22
16
|
|
|
23
|
-
#
|
|
17
|
+
# Browse the catalog
|
|
24
18
|
codespar servers list
|
|
25
|
-
codespar servers show stripe
|
|
26
19
|
codespar tools list --server asaas
|
|
27
|
-
codespar tools show codespar_pay
|
|
28
20
|
|
|
29
|
-
# Run a
|
|
21
|
+
# Run a single tool call
|
|
30
22
|
codespar execute codespar_pay \
|
|
31
23
|
--server asaas \
|
|
32
24
|
--input '{"method":"pix","amount":15000,"currency":"BRL"}'
|
|
33
25
|
|
|
34
|
-
# Manage sessions
|
|
26
|
+
# Manage sessions and logs
|
|
35
27
|
codespar sessions list
|
|
36
|
-
codespar
|
|
37
|
-
|
|
28
|
+
codespar logs tail --server stripe
|
|
29
|
+
|
|
30
|
+
# Scaffold a new agent
|
|
31
|
+
codespar init my-agent
|
|
38
32
|
```
|
|
39
33
|
|
|
40
34
|
## Commands
|
|
41
35
|
|
|
42
|
-
| Command |
|
|
43
|
-
|
|
44
|
-
| `login` | Save
|
|
36
|
+
| Command | Description |
|
|
37
|
+
|---------|-------------|
|
|
38
|
+
| `login` | Save API key to `~/.codespar/config.json` |
|
|
45
39
|
| `logout` | Clear the stored API key |
|
|
46
|
-
| `whoami` | Show authenticated user, org, project, and
|
|
47
|
-
| `servers list` | List
|
|
40
|
+
| `whoami` | Show authenticated user, org, project, and scopes |
|
|
41
|
+
| `servers list` | List servers (filter by `--category`, `--region`) |
|
|
48
42
|
| `servers show <id>` | Show a server's details and tools |
|
|
49
43
|
| `tools list` | List tools (filter by `--server`) |
|
|
50
44
|
| `tools show <name>` | Show a tool's full input/output schema |
|
|
@@ -53,25 +47,18 @@ codespar sessions close ses_abc123
|
|
|
53
47
|
| `sessions show <id>` | Show session details (add `--logs` for tool calls) |
|
|
54
48
|
| `sessions close <id>` | Close an active session |
|
|
55
49
|
| `connect list` | List active Connect Links per user |
|
|
56
|
-
| `connect start <server>` | Start an OAuth Connect Link flow (add `--open`
|
|
50
|
+
| `connect start <server>` | Start an OAuth Connect Link flow (add `--open`) |
|
|
57
51
|
| `connect revoke <server>` | Revoke a connection |
|
|
58
|
-
| `logs tail` | Stream tool-call logs in real time (
|
|
52
|
+
| `logs tail` | Stream tool-call logs in real time (SSE) |
|
|
59
53
|
| `init <name>` | Scaffold a new commerce agent from a template |
|
|
60
54
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
| Slug | Stack | What you get |
|
|
64
|
-
|------|-------|--------------|
|
|
65
|
-
| `pix-agent` | Node + OpenAI | Minimal Pix charge + WhatsApp notify loop |
|
|
66
|
-
| `ecommerce-checkout` | Node + Claude | Full Complete Loop: checkout → invoice → ship → notify |
|
|
67
|
-
| `streaming-chat` | Next.js + Vercel AI | Token-by-token streaming commerce chat |
|
|
68
|
-
| `multi-tenant` | Next.js + OpenAI | One API key, N tenants, per-tenant billing |
|
|
55
|
+
## Global flags
|
|
69
56
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
57
|
+
| Flag | Description |
|
|
58
|
+
|------|-------------|
|
|
59
|
+
| `--json` | Machine-readable JSON output (pipe into `jq`) |
|
|
60
|
+
| `--api-key <key>` | Override the stored key |
|
|
61
|
+
| `--base-url <url>` | Point at a custom API (staging, self-hosted) |
|
|
75
62
|
|
|
76
63
|
## Configuration
|
|
77
64
|
|
|
@@ -81,36 +68,19 @@ Resolution order (first match wins):
|
|
|
81
68
|
2. Environment variables (`CODESPAR_API_KEY`, `CODESPAR_BASE_URL`)
|
|
82
69
|
3. Config file at `~/.codespar/config.json` (chmod 600)
|
|
83
70
|
|
|
84
|
-
##
|
|
85
|
-
|
|
86
|
-
Output is valid JSON on stdout and human messages on stderr, so you can pipe cleanly:
|
|
71
|
+
## Templates
|
|
87
72
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
codespar sessions show ses_abc123 --logs --json \
|
|
95
|
-
| jq '[.logs[] | select(.server == "stripe") | .duration_ms] | sort | .[95]'
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Use `--json` explicitly when piping — the CLI defaults to tables in a TTY.
|
|
73
|
+
| Slug | Stack |
|
|
74
|
+
|------|-------|
|
|
75
|
+
| `pix-agent` | Node + OpenAI — minimal Pix charge + WhatsApp notify |
|
|
76
|
+
| `ecommerce-checkout` | Node + Claude — full Complete Loop |
|
|
77
|
+
| `streaming-chat` | Next.js + Vercel AI — token-by-token streaming |
|
|
78
|
+
| `multi-tenant` | Next.js + OpenAI — one API key, N tenants |
|
|
99
79
|
|
|
100
|
-
##
|
|
80
|
+
## Need more?
|
|
101
81
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
# From repo root
|
|
106
|
-
npm install
|
|
107
|
-
npm run build --workspace @codespar/cli
|
|
108
|
-
npm run typecheck --workspace @codespar/cli
|
|
109
|
-
|
|
110
|
-
# Run the local build directly
|
|
111
|
-
node packages/cli/dist/index.js --help
|
|
112
|
-
```
|
|
82
|
+
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)**.
|
|
113
83
|
|
|
114
84
|
## License
|
|
115
85
|
|
|
116
|
-
MIT
|
|
86
|
+
MIT — [codespar.dev](https://codespar.dev)
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { listConnectionsCommand, revokeConnectCommand, startConnectCommand, } fr
|
|
|
11
11
|
import { tailLogsCommand } from "./commands/logs.js";
|
|
12
12
|
import { initCommand } from "./commands/init.js";
|
|
13
13
|
import { c } from "./output.js";
|
|
14
|
-
const VERSION = "0.2.
|
|
14
|
+
const VERSION = "0.2.1";
|
|
15
15
|
const program = new Command();
|
|
16
16
|
program
|
|
17
17
|
.name("codespar")
|
package/package.json
CHANGED