@bulkgrid/cli 0.1.0 → 0.2.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 +73 -0
- package/dist/auth-C7pTl5XB.js +723 -0
- package/dist/auth-C7pTl5XB.js.map +1 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +81 -22
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +79 -18
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -6
- package/package.json +6 -5
- package/dist/chunk-OUGLFLZG.js +0 -351
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Bulkgrid CLI
|
|
2
|
+
|
|
3
|
+
## Sign in
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
bulkgrid login
|
|
7
|
+
bulkgrid status
|
|
8
|
+
bulkgrid logout
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`login` opens your browser. Sign in to Bulkgrid, approve the workspace and collection access, then return to the terminal.
|
|
12
|
+
Your current workspace is preselected when available. The connection appears as **Bulkgrid CLI** in
|
|
13
|
+
**Settings → Connected Apps**, where you can review or revoke access.
|
|
14
|
+
|
|
15
|
+
The CLI registers a public OAuth client with Supabase and uses authorization code flow with PKCE and a temporary
|
|
16
|
+
`127.0.0.1` callback. Supabase OAuth Server and dynamic registration must be enabled, and the app must include the CLI
|
|
17
|
+
session endpoint. No client secret or new database tables are required. The grant has the same `mcp:use` and
|
|
18
|
+
`search:query` permissions and collection restrictions as an MCP connection; login does not grant general dashboard administration.
|
|
19
|
+
|
|
20
|
+
Access and refresh tokens are stored per Bulkgrid origin in `~/.config/bulkgrid`, with owner-only file permissions.
|
|
21
|
+
The CLI refreshes tokens when needed and checks access against the server. It never copies these tokens into agent or
|
|
22
|
+
project configurations. Each new login after logout creates a separate client connection.
|
|
23
|
+
|
|
24
|
+
`logout` revokes the current Bulkgrid grant and removes its local tokens. This blocks API access, including with refreshed
|
|
25
|
+
OAuth tokens. It does not sign you out of the browser or other CLI installations. If the connection was already revoked
|
|
26
|
+
or the server is unavailable, revoke it through Connected Apps if needed, then use `bulkgrid logout --local` to clear local
|
|
27
|
+
credentials. A failed remote logout retains credentials so it can be retried.
|
|
28
|
+
|
|
29
|
+
For local development or another deployment, use the same base URL on every command:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
bulkgrid login --url http://localhost:3000
|
|
33
|
+
bulkgrid status --url http://localhost:3000
|
|
34
|
+
bulkgrid logout --url http://localhost:3000
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Alternatively set `BULKGRID_URL`. Remote deployments require HTTPS.
|
|
38
|
+
`--no-browser` prints the authorization URL; open it in a browser on the same computer as the CLI so the loopback callback
|
|
39
|
+
can complete. Login times out after five minutes and can be cancelled with Ctrl+C.
|
|
40
|
+
|
|
41
|
+
## Configure AI clients
|
|
42
|
+
|
|
43
|
+
`bulkgrid init` configures MCP connections for supported AI clients. Its API-key setup is separate from CLI login:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
bulkgrid init --all
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
AI clients using OAuth should connect to the shared `/api/v1/mcp` URL and manage their own tokens and consent.
|
|
50
|
+
The `init --auth browser` option opens the dashboard to create an API key; it does not perform CLI OAuth login.
|
|
51
|
+
|
|
52
|
+
## Use a saved connection from CLI code
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import { CliAuth } from '@bulkgrid/cli';
|
|
56
|
+
|
|
57
|
+
const accessToken = await new CliAuth().getAccessToken();
|
|
58
|
+
// Send as Authorization: Bearer <accessToken> to the matching Bulkgrid deployment.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
`getAccessToken()` refreshes the credentials if necessary and checks the connection is still active before returning a token.
|
|
62
|
+
|
|
63
|
+
## Manage sources with an API key
|
|
64
|
+
|
|
65
|
+
Source commands require `BULKGRID_API_KEY`, independent of CLI OAuth login. Set `BULKGRID_URL` or use `--url` for another deployment.
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
bulkgrid sources --help
|
|
69
|
+
bulkgrid sources find https://example.com
|
|
70
|
+
bulkgrid sources status <sourceId>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
`analyze` starts deeper analysis and may create a crawl run. `add --input '<json>'` creates/subscribes using explicit source configuration. `recrawl` starts a manual refresh. `collections`, `rules`, and `include` inspect and update collection access. All output JSON; none poll or retry mutations automatically. Use the least API-key scopes needed for the chosen operation. See the source-management skill and CLI documentation for the full workflow and permission mapping.
|