@picahq/cli 0.1.0 → 0.3.0

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 CHANGED
@@ -18,10 +18,54 @@ Requires Node.js 18+.
18
18
  pica init
19
19
  ```
20
20
 
21
- This prompts for your Pica API key, saves it to `~/.pica/config.json`, and installs the MCP server into your AI agents (Claude Code, Claude Desktop, Cursor, Windsurf).
21
+ This walks you through:
22
+ 1. Entering your Pica API key (validates it)
23
+ 2. Choosing which AI agents to install the MCP server into
24
+ 3. Choosing global vs project-level installation
22
25
 
23
26
  Get your API key at [app.picaos.com/settings/api-keys](https://app.picaos.com/settings/api-keys).
24
27
 
28
+ Config is saved to `~/.pica/config.json`.
29
+
30
+ ### Re-running init
31
+
32
+ If you already have a config, `pica init` shows your current setup instead of starting over:
33
+
34
+ ```
35
+ Pica
36
+
37
+ Current Setup
38
+ ──────────────────────────────────────────
39
+ API Key: sk_test_...9j-Y
40
+ Config: ~/.pica/config.json
41
+
42
+ Agent Global Project
43
+ ────────────── ────── ───────
44
+ Claude Code ● yes ● yes
45
+ Claude Desktop ● yes -
46
+ Cursor ○ no ○ no
47
+ Windsurf - -
48
+
49
+ - = not detected on this machine
50
+ ```
51
+
52
+ Then it offers targeted actions based on what's missing:
53
+
54
+ - **Update API key** -- validates the new key, then re-installs to every agent that currently has the MCP (preserving global/project scopes)
55
+ - **Install MCP to more agents** -- only shows detected agents missing the MCP
56
+ - **Install MCP for this project** -- creates `.mcp.json` / `.cursor/mcp.json` in cwd for agents that support project scope
57
+ - **Start fresh** -- full setup flow from scratch
58
+
59
+ Options that don't apply are hidden. If every detected agent already has the MCP globally, "Install MCP to more agents" won't appear.
60
+
61
+ ### Init flags
62
+
63
+ | Flag | Effect |
64
+ |------|--------|
65
+ | `-y, --yes` | Skip confirmations |
66
+ | `-g, --global` | Install MCP globally (default, available in all projects) |
67
+ | `-p, --project` | Install MCP for this project only (creates config files in cwd) |
68
+
25
69
  ## Usage
26
70
 
27
71
  ### Connect a platform
@@ -119,6 +163,19 @@ Every command supports `--json` for machine-readable output.
119
163
 
120
164
  All API calls route through Pica's passthrough proxy (`api.picaos.com/v1/passthrough`), which injects auth credentials, handles rate limiting, and normalizes responses. Your connection keys tell Pica which credentials to use. You never touch raw OAuth tokens.
121
165
 
166
+ ## MCP installation
167
+
168
+ `pica init` writes MCP server configs into the following locations:
169
+
170
+ | Agent | Global config | Project config |
171
+ |-------|--------------|----------------|
172
+ | Claude Code | `~/.claude.json` | `.mcp.json` |
173
+ | Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` | n/a |
174
+ | Cursor | `~/.cursor/mcp.json` | `.cursor/mcp.json` |
175
+ | Windsurf | `~/.codeium/windsurf/mcp_config.json` | n/a |
176
+
177
+ Global installs make the MCP available everywhere. Project installs create config files in your current directory that can be committed and shared with your team (each team member needs their own API key).
178
+
122
179
  ## Development
123
180
 
124
181
  ```bash
@@ -133,7 +190,7 @@ npm run typecheck # type check without emitting
133
190
  src/
134
191
  index.ts # Commander setup and command registration
135
192
  commands/
136
- init.ts # pica init (API key + MCP setup)
193
+ init.ts # pica init (setup, status display, targeted actions)
137
194
  connection.ts # pica add, pica list
138
195
  platforms.ts # pica platforms
139
196
  actions.ts # pica search, actions knowledge, exec
@@ -142,7 +199,8 @@ src/
142
199
  types.ts # TypeScript interfaces
143
200
  actions.ts # Action ID normalization, path variable helpers
144
201
  config.ts # ~/.pica/config.json read/write
145
- agents.ts # MCP config for Claude, Cursor, Windsurf
202
+ agents.ts # Agent detection, MCP config, status reporting
146
203
  platforms.ts # Platform search and fuzzy matching
147
204
  browser.ts # Open browser for OAuth and API key pages
205
+ table.ts # Formatted table output
148
206
  ```
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node