@clipit-ai/cli 0.2.3 → 0.2.6

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.
Files changed (4) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +46 -14
  3. package/bin/clipit.mjs +2335 -166
  4. package/package.json +1 -1
package/LICENSE CHANGED
File without changes
package/README.md CHANGED
@@ -38,6 +38,16 @@ For CI or manually created API keys:
38
38
  printf '%s' "$CLIPPER_API_KEY" | clipit auth set-key --stdin
39
39
  ```
40
40
 
41
+ Team operators should store each enterprise workspace key in its own named profile, verify the returned `scope.workspaceId`, and activate that profile before working:
42
+
43
+ ```bash
44
+ printf '%s\n' "$WORKSPACE_API_KEY" | clipit auth set-key --profile client-acme --stdin
45
+ clipit auth status --profile client-acme --json
46
+ clipit auth use client-acme
47
+ ```
48
+
49
+ Interactive `--stdin` entry suppresses terminal echo and completes on the first newline. Keys are never accepted as command-line arguments.
50
+
41
51
  ## Core Commands
42
52
 
43
53
  ```bash
@@ -47,10 +57,12 @@ clipit doctor --json
47
57
  clipit auth status --json
48
58
  clipit auth open-settings
49
59
  clipit auth profiles --json
60
+ clipit auth use <profile>
50
61
  clipit skills list --json
51
62
  clipit tools list --json
52
63
  clipit tools describe <functionName> --json
53
64
  clipit run <functionName> --params @params.json --max-credits 25 --json
65
+ clipit mcp stdio
54
66
  ```
55
67
 
56
68
  Video and clip helpers:
@@ -58,22 +70,28 @@ Video and clip helpers:
58
70
  ```bash
59
71
  clipit videos list --json
60
72
  clipit videos get <videoId> --json
61
- clipit videos upload ./source.mp4 --json
62
- clipit videos import-url "https://example.com/video" --json
63
- clipit videos transcribe <videoId> --json
73
+ clipit videos upload ./source.mp4 --confirm --json
74
+ clipit videos abort-upload <upload-intent-id> --confirm --json
75
+ clipit videos import-url "https://example.com/video" --confirm --json
76
+
77
+ # Reuse this key only when retrying after an unknown network outcome
78
+ clipit videos import-url "https://example.com/video" --idempotency-key import-episode-42 --confirm --json
79
+ clipit videos transcribe <videoId> --confirm --json
64
80
  clipit videos transcript <videoId> --json
65
- clipit videos suggest-clips <videoId> --count 5 --json
81
+ clipit videos suggest-clips <videoId> --count 5 --confirm --json
66
82
  clipit videos delete <videoId> --confirm --json
67
83
 
68
84
  clipit clips list --video-id <videoId> --json
69
85
  clipit clips get <clipId> --json
70
- clipit clips create --video-id <videoId> --start 12 --end 42 --title "Strong hook" --json
86
+ clipit clips create --video-id <videoId> --start 12 --end 42 --title "Strong hook" --confirm --json
71
87
  clipit clips update <clipId> --title "Better title" --json
72
- clipit clips render <clipId> --aspect 9:16 --quality high --json
88
+ clipit clips render <clipId> --aspect 9:16 --quality high --confirm --json
73
89
  clipit clips download <clipId> --json
74
90
  clipit jobs wait <jobId> --stream
75
91
  ```
76
92
 
93
+ `clips get`, `clips list`, `clips create`, and clip-creation tool results include a structured `media` payload. Agents should present `media.url` as an inline `video/mp4` attachment when `media.isEmbeddable` is true. If it is false, the clip has no rendered MP4 yet; show `media.statusLabel` and use `media.appUrl`/`appUrl` as the review or render link.
94
+
77
95
  Platform helpers:
78
96
 
79
97
  ```bash
@@ -90,10 +108,10 @@ clipit exports list --json
90
108
  clipit exports get <jobId> --json
91
109
  clipit exports wait <jobId> --stream
92
110
  clipit exports download <jobId> --open
93
- clipit exports cancel <jobId> --json
111
+ clipit exports cancel <jobId> --confirm --json
94
112
 
95
113
  clipit assets list --json
96
- clipit assets upload ./brand-logo.png --kind image --json
114
+ clipit assets upload ./brand-logo.png --kind image --confirm --json
97
115
  clipit assets delete <assetId> --confirm --json
98
116
 
99
117
  clipit thumbnails generate --clip-id <clipId> --prompt "High contrast thumbnail" --confirm --json
@@ -134,7 +152,11 @@ If the estimate is greater than the limit, the CLI exits with code `12` and prin
134
152
 
135
153
  When the server returns HTTP 402, the CLI exits with code `13`. For spend-limit errors, raise the API key spend limit in ClipIt Settings or use a different key; otherwise top up credits at https://clipit.dev/settings (Billing).
136
154
 
137
- Large `videos upload` and `assets upload` commands print upload progress to stderr about every two seconds when stderr is a TTY and `--json` is not set.
155
+ Large `videos upload` and `assets upload` commands print upload progress to stderr when stderr is a TTY and `--json` is not set.
156
+
157
+ `videos upload` reserves quota and credits through the API, then streams the file directly to signed object-storage URLs. Files at or above 10 MiB use bounded multipart batches, and rerunning the same unchanged file resumes provider-confirmed missing parts with the same deterministic idempotency key. Supply `--idempotency-key` when the same file must retain its identity across a rename or move. The CLI rejects resume attempts when the path, size, timestamps, filename, MIME type, title, profile, or API host changed, and it rechecks the file before sealing the upload. Concurrent resume records are stored atomically as separate user-only files; they contain no signed URLs and expire after the server's 24-hour resume window. Use `videos abort-upload <intent-id> --confirm` to cancel an unfinished transfer and release its storage and credit reservations. The deprecated proxied `POST /api/v1/videos` compatibility endpoint is not used by the CLI.
158
+
159
+ `clipit run importVideoFromUrl` and `clipit videos import-url` use the same job-backed URL import path. After either command starts a job, wait with `clipit jobs wait <jobId> --json`; failed URL-import jobs include retryability and unsupported-source fields when the server can classify the source. Long URL imports can remain at 40% while the server is actively downloading; use `phase`, `message`, `lastHeartbeatAt`, and `stalled` from `clipit jobs get|wait` rather than treating unchanged numeric progress as failure. When the server returns `minimumWaitSeconds`, `jobs wait` will honor that longer wait before timing out.
138
160
 
139
161
  ## Exit codes
140
162
 
@@ -168,12 +190,19 @@ Workflow helpers:
168
190
 
169
191
  ```bash
170
192
  clipit ask "Create three clip candidates" --video-id <videoId> --quick --stream
193
+ clipit ask "Create and render three strong clips" --video-id <videoId> --auto-confirm-costly --stream
171
194
  clipit ask "Prepare a review cut" --clip-id <clipId> --conversation-id <sessionId> --no-wait --json
172
195
  clipit workflow status <jobId> --json
173
196
  clipit workflow wait <jobId> --stream
174
197
  clipit workflow approve <jobId> --approval-id <approvalId> --decision cheaper
175
198
  ```
176
199
 
200
+ ## MCP Stdio Bridge
201
+
202
+ Use `clipit mcp stdio` from MCP-compatible clients that can launch a local command. It speaks standard MCP `Content-Length` framed JSON-RPC over stdio, exposes ClipIt agent tools through the authenticated CLI profile, supports `initialize`, `tools/list`, and `tools/call`, and delegates execution to `/api/v1/agent/execute`.
203
+
204
+ Paid generation, publishing, deletion, and other metered tools still require an explicit confirmation step. If a tool call may spend credits or mutate user-visible ClipIt state, the MCP bridge returns a `requiresConfirmation` result instead of executing it; retry only after the user approves and include `confirmed: true` in the tool arguments.
205
+
177
206
  Navigation:
178
207
 
179
208
  ```bash
@@ -210,13 +239,16 @@ The default profile is `default`.
210
239
  ```bash
211
240
  clipit login --profile work
212
241
  clipit auth status --profile work --json
242
+ clipit auth use work
213
243
  CLIPIT_PROFILE=work clipit clips list --json
214
244
  ```
215
245
 
246
+ An explicitly selected profile (`--profile` or `CLIPIT_PROFILE`) and an active non-default profile are authoritative for both credential and base URL. They never silently fall back to a global personal key. With the default profile and no explicit profile selection, the existing environment-variable fallback remains available.
247
+
216
248
  Supported environment variables:
217
249
 
218
- - `CLIPPER_API_KEY`: overrides stored credentials.
219
- - `CLIPPER_BASE_URL`: overrides the API base URL.
250
+ - `CLIPPER_API_KEY`: supplies the default-profile/CI credential when no named profile is selected.
251
+ - `CLIPPER_BASE_URL`: supplies the default-profile/CI API base URL when no named profile is selected.
220
252
  - `CLIPIT_PROFILE`: selects a config profile.
221
253
  - `CLIPIT_CONFIG_DIR`: overrides the config directory.
222
254
  - `CLIPIT_ALLOW_CUSTOM_HOST=true`: allows non-ClipIt hosts.
@@ -236,10 +268,10 @@ Only use `--allow-custom-host` for hosts you control or trust. It permits the CL
236
268
 
237
269
  | Area | Commands | Notes |
238
270
  | --- | --- | --- |
239
- | Auth and setup | `login`, `setup`, `logout`, `doctor`, `auth status`, `auth set-key`, `auth open-settings`, `auth profiles` | Browser-link login plus manual key fallback. |
240
- | Agent tools | `skills list`, `tools list`, `tools describe`, `run`, `ask`, `workflow status/wait/approve` | Direct tool execution and natural-language Clippy workflows. |
271
+ | Auth and setup | `login`, `setup`, `logout`, `doctor`, `auth status`, `auth set-key`, `auth open-settings`, `auth profiles`, `auth use` | Browser-link login, manual key fallback, and fail-closed named workspace profiles. |
272
+ | Agent tools | `skills list`, `tools list`, `tools describe`, `run`, `ask`, `workflow status/wait/approve`, `mcp stdio` | Direct tool execution, natural-language Clippy workflows, and MCP stdio access. |
241
273
  | Context and navigation | `context use/show/clear/build`, `open`, `links`, `examples` | Persist active IDs and open ClipIt review surfaces. |
242
- | Videos and clips | `videos list/get/upload/import-url/transcribe/transcript/suggest-clips/delete`, `clips list/get/create/update/render/download/delete`, `jobs get/wait` | Core media and render job helpers. |
274
+ | Videos and clips | `videos list/get/upload/abort-upload/import-url/transcribe/transcript/suggest-clips/delete`, `clips list/get/create/update/render/download/delete`, `jobs get/wait` | Core media and render job helpers. |
243
275
  | Credits | `credits balance`, `credits usage`, `credits estimate` | Estimate accepts `--metrics @file.json`. |
244
276
  | Analytics | `analytics overview`, `analytics top-clips`, `analytics post` | `overview` returns aggregate and by-platform metrics. |
245
277
  | Exports | `exports start/list/get/wait/download/cancel` | Export jobs poll through `/api/v1/exports/:jobId`; paid start requires `--confirm`. |