@clipit-ai/cli 0.2.4 → 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 +24 -6
  3. package/bin/clipit.mjs +1088 -122
  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,6 +57,7 @@ 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
@@ -60,7 +71,11 @@ Video and clip helpers:
60
71
  clipit videos list --json
61
72
  clipit videos get <videoId> --json
62
73
  clipit videos upload ./source.mp4 --confirm --json
74
+ clipit videos abort-upload <upload-intent-id> --confirm --json
63
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
64
79
  clipit videos transcribe <videoId> --confirm --json
65
80
  clipit videos transcript <videoId> --json
66
81
  clipit videos suggest-clips <videoId> --count 5 --confirm --json
@@ -137,9 +152,9 @@ If the estimate is greater than the limit, the CLI exits with code `12` and prin
137
152
 
138
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).
139
154
 
140
- 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.
141
156
 
142
- Direct `videos upload` is capped at 100 MB by default so the CLI fails before large multipart bodies hit edge request limits. Use `clipit videos import-url` for URL sources, or set `CLIPIT_CLI_DIRECT_UPLOAD_MAX_BYTES` only when your target host supports larger direct uploads.
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.
143
158
 
144
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.
145
160
 
@@ -224,13 +239,16 @@ The default profile is `default`.
224
239
  ```bash
225
240
  clipit login --profile work
226
241
  clipit auth status --profile work --json
242
+ clipit auth use work
227
243
  CLIPIT_PROFILE=work clipit clips list --json
228
244
  ```
229
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
+
230
248
  Supported environment variables:
231
249
 
232
- - `CLIPPER_API_KEY`: overrides stored credentials.
233
- - `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.
234
252
  - `CLIPIT_PROFILE`: selects a config profile.
235
253
  - `CLIPIT_CONFIG_DIR`: overrides the config directory.
236
254
  - `CLIPIT_ALLOW_CUSTOM_HOST=true`: allows non-ClipIt hosts.
@@ -250,10 +268,10 @@ Only use `--allow-custom-host` for hosts you control or trust. It permits the CL
250
268
 
251
269
  | Area | Commands | Notes |
252
270
  | --- | --- | --- |
253
- | Auth and setup | `login`, `setup`, `logout`, `doctor`, `auth status`, `auth set-key`, `auth open-settings`, `auth profiles` | Browser-link login plus manual key fallback. |
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. |
254
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. |
255
273
  | Context and navigation | `context use/show/clear/build`, `open`, `links`, `examples` | Persist active IDs and open ClipIt review surfaces. |
256
- | 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. |
257
275
  | Credits | `credits balance`, `credits usage`, `credits estimate` | Estimate accepts `--metrics @file.json`. |
258
276
  | Analytics | `analytics overview`, `analytics top-clips`, `analytics post` | `overview` returns aggregate and by-platform metrics. |
259
277
  | Exports | `exports start/list/get/wait/download/cancel` | Export jobs poll through `/api/v1/exports/:jobId`; paid start requires `--confirm`. |