@slatesvideo/cli 0.5.20 → 0.6.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
@@ -1,6 +1,6 @@
1
1
  # @slatesvideo/cli
2
2
 
3
- The `slates` command for the [Slates](https://slates.video) AI video studio. Drive Slates from your terminal, or let Claude Code shell out to it instead of loading <!-- gen:tool-count -->92<!-- /gen:tool-count --> tool schemas into context.
3
+ The `slates` command for the [Slates](https://slates.video) AI video studio. Drive Slates from your terminal, or let Codex (with your ChatGPT account) or Claude Code shell out to it instead of loading <!-- gen:tool-count -->142<!-- /gen:tool-count --> tool schemas into context.
4
4
 
5
5
  ## Install
6
6
 
@@ -19,7 +19,7 @@ Requires Node.js 18+ and the Slates desktop app ([slates.video](https://slates.v
19
19
  | `slates status` | Show connection state, account, and credit balance |
20
20
  | `slates mcp` | Detect installed MCP clients and print the exact config for each; `--write` merges it into Claude Desktop / Cursor configs (with a `.bak` backup) |
21
21
  | `slates install-skills` | Install the bundled agent skills into `.claude/skills/<name>/SKILL.md`; `--global` targets `~/.claude/skills` |
22
- | `slates run <op>` | Invoke any Slates operation by id; `--list` shows all <!-- gen:tool-count -->92<!-- /gen:tool-count -->, `<op> --help` shows one op's flags |
22
+ | `slates run <op>` | Invoke any Slates operation by id; `--list` shows all <!-- gen:tool-count -->142<!-- /gen:tool-count -->, `<op> --help` shows one op's flags |
23
23
  | `slates run <op> --input '<json>'` | Pass a NESTED object (Shot `params`/`refs`, batch updates) — flags cannot express those |
24
24
  | `slates use <project>` | Set the default project, by id or name, so ops stop needing `--projectId` |
25
25
  | `slates doctor` | Check every setup precondition and print the fix for each failure |
@@ -27,7 +27,7 @@ Requires Node.js 18+ and the Slates desktop app ([slates.video](https://slates.v
27
27
 
28
28
  ## Skills
29
29
 
30
- <!-- gen:skill-count -->34<!-- /gen:skill-count --> agent skills ship embedded in `@slatesvideo/shared`: <!-- gen:workflow-skill-count -->18<!-- /gen:workflow-skill-count --> workflow recipes (<!-- gen:workflow-skills -->blocking-to-prompt, camera-language, character-identity, content-policy, cost-discipline, dialogue-blocking, direct-response-ad, edit-and-iterate, model-selection, one-prompt-film, previs-blocking, project-organization, restyle-from-blocking, shot-variety, storyboard-from-script, style-prompting, ugc-influencer-ad, vision-feedback-loop<!-- /gen:workflow-skills -->) and <!-- gen:per-model-skill-count -->16<!-- /gen:per-model-skill-count --> per-model prompting guides covering <!-- gen:video-roster -->kling-v3.0-std, kling-v3.0-pro, kling-v3.0-omni, veo-3.1-fast, veo-3.1-standard, Seedance 2.0, Seedance 2.5, Gemini Omni Flash, MiniMax H3, MiniMax H3 Max, LTX-2.5, LTX-2.5 Pro<!-- /gen:video-roster -->, <!-- gen:image-roster -->Nano Banana 2 (Gemini 3.1 Flash Image), Nano Banana 2 Lite, Nano Banana Pro, GPT Image 2.5 Flare, GPT Image 2.5 Sunburst, FLUX.2 Max, Seedream 5 Lite<!-- /gen:image-roster --> and <!-- gen:audio-roster -->Seed Audio 1.0, ElevenLabs Sound Effects v2, Inworld Realtime TTS-2<!-- /gen:audio-roster -->.
30
+ <!-- gen:skill-count -->37<!-- /gen:skill-count --> agent skills ship embedded in `@slatesvideo/shared`: <!-- gen:workflow-skill-count -->21<!-- /gen:workflow-skill-count --> workflow recipes (<!-- gen:workflow-skills -->blocking-to-prompt, camera-language, character-identity, chatgpt-images, cinematic-look, content-policy, cost-discipline, dialogue-blocking, direct-response-ad, edit-and-iterate, model-selection, one-prompt-film, previs-blocking, project-organization, restyle-from-blocking, script-craft, shot-variety, storyboard-from-script, style-prompting, ugc-influencer-ad, vision-feedback-loop<!-- /gen:workflow-skills -->) and <!-- gen:per-model-skill-count -->16<!-- /gen:per-model-skill-count --> per-model prompting guides covering <!-- gen:video-roster -->kling-v3.0-std, kling-v3.0-pro, kling-v3.0-omni, veo-3.1-fast, veo-3.1-standard, Seedance 2.0, Seedance 2.5, Gemini Omni Flash, MiniMax H3, MiniMax H3 Max, MiniMax H3 Max Turbo, LTX-2.5, LTX-2.5 Pro<!-- /gen:video-roster -->, <!-- gen:image-roster -->Nano Banana 2 (Gemini 3.1 Flash Image), Nano Banana 2 Lite, Nano Banana Pro, GPT Image 2.5 Flare, GPT Image 2.5 Sunburst, FLUX.2 Max, Seedream 5 Lite<!-- /gen:image-roster --> and <!-- gen:audio-roster -->Seed Audio 1.0, ElevenLabs Sound Effects v2, Inworld Realtime TTS-2<!-- /gen:audio-roster -->.
31
31
 
32
32
  `slates install-skills` writes each one to `.claude/skills/<skill-name>/SKILL.md` in your current project, which is the layout Claude Code's skill discovery requires. Use `--global` to install for every project. Restart Claude Code afterward, then ask: "what slates skills do you have?" to verify.
33
33
 
@@ -69,7 +69,7 @@ Notes for agent use:
69
69
  ## First-time setup
70
70
 
71
71
  1. Install and open the Slates desktop app.
72
- 2. **Settings → Agent Control → enter your email → Send link.** Click the emailed link.
72
+ 2. **Settings → AI tools → enter your email → Send link.** Click the emailed link.
73
73
  3. `slates status` should now show your account. (Alternative: `slates login`.)
74
74
 
75
75
  Credentials live in `~/.slates/agent-connection.json`. No env vars.
@@ -2,7 +2,7 @@ import { readFileSync, existsSync, readdirSync } from 'node:fs';
2
2
  import { join, dirname } from 'node:path';
3
3
  import { homedir } from 'node:os';
4
4
  import { fileURLToPath } from 'node:url';
5
- import { readConnection, CONNECTION_FILE, SlatesCloudClient, SlatesDesktopClient, SKILLS, } from '@slatesvideo/shared';
5
+ import { readConnection, CONNECTION_FILE, SlatesCloudClient, SlatesDesktopClient, SKILLS, refreshLatestVersion, compareVersions, } from '@slatesvideo/shared';
6
6
  import { EXIT } from '../exit-codes.js';
7
7
  function frontmatterName(markdown, fallback) {
8
8
  if (!markdown.startsWith('---'))
@@ -13,14 +13,44 @@ function frontmatterName(markdown, fallback) {
13
13
  const m = markdown.slice(3, end).match(/^name:\s*(.+?)\s*$/m);
14
14
  return m ? m[1].trim() : fallback;
15
15
  }
16
- /** Every op that needs a desktop capability, and the capability it needs. Kept
17
- * in step with `requireCapability` call sites in the ops registry. */
16
+ /** Every capability an op checks with `requireCapability`, and what needs it.
17
+ * scripts/agent-surface-lockstep-check.mjs (check 11) fails when this list and
18
+ * the ops' call sites disagree. */
18
19
  const REQUIRED_CAPABILITIES = [
19
20
  ['shots', 'Shots — the whole shot-list surface'],
20
21
  ['background-generation', 'background: true on any generate op'],
21
22
  ['image-references', 'reference images on image generation'],
22
23
  ['image-models-v2', 'nano-banana-pro / nano-banana-2-lite'],
23
24
  ['image-models-v3', 'gpt-image-2-5-flare / gpt-image-2-5-sunburst (five quality tiers)'],
25
+ ['edit-image', 'image edits'],
26
+ ['edit-video', 'video edits'],
27
+ ['audio-generation', 'the audio lane'],
28
+ ['voices', 'the preset voice shelf'],
29
+ ['timeline', 'the timeline'],
30
+ ['timeline-tracks', 'timeline tracks and settings'],
31
+ ['export', 'video and XML export'],
32
+ ['chatgpt-image-generation', 'connected ChatGPT images'],
33
+ ['external-image-metadata', 'saving an external image with its generation record'],
34
+ ['selection', 'reading the live selection'],
35
+ ['view', 'the window layout'],
36
+ ['pins', 'pinned references'],
37
+ ['asset-favorite', 'favorites'],
38
+ ['asset-export', 'exporting media'],
39
+ ['library', 'the Library'],
40
+ ['templates', 'templates'],
41
+ ['takes', 'moving takes between Shots'],
42
+ ['script', 'the Script page'],
43
+ ['board-quote', 'Shot prices and the board quote'],
44
+ ['board-progress', 'board progress'],
45
+ ['cut-edit', 'editing a cut'],
46
+ ['sheet-tool-seats', 'sheet tools on the default image seat'],
47
+ ['image-variations', 'more than 4 images per call'],
48
+ ['shot-position', 'placing a new Shot at a slot'],
49
+ ['edit-references-all-models', 'references on every image edit model'],
50
+ ['script-documents', 'script documents, sections, suggestions and variations'],
51
+ ['named-cuts', 'named cuts and batch export'],
52
+ ['timeline-markers', 'timeline markers'],
53
+ ['project-relocate', 'moving a project into the current projects folder'],
24
54
  ];
25
55
  export async function runDoctor() {
26
56
  const checks = [];
@@ -30,7 +60,7 @@ export async function runDoctor() {
30
60
  name: 'Connection file',
31
61
  ok: existsSync(CONNECTION_FILE),
32
62
  detail: existsSync(CONNECTION_FILE) ? CONNECTION_FILE : `not found at ${CONNECTION_FILE}`,
33
- fix: 'Run `slates login`, or open Slates → Settings → Agent Control → Send link.',
63
+ fix: 'Run `slates login`, or open Slates → Settings → AI tools → Send link.',
34
64
  });
35
65
  // 2. The cloud token, verified against the API rather than merely present.
36
66
  if (!conn.cloud.token) {
@@ -38,7 +68,7 @@ export async function runDoctor() {
38
68
  name: 'Cloud account',
39
69
  ok: false,
40
70
  detail: 'no token',
41
- fix: 'Run `slates login` (or connect from Slates → Settings → Agent Control).',
71
+ fix: 'Run `slates login` (or connect from Slates → Settings → AI tools).',
42
72
  });
43
73
  }
44
74
  else {
@@ -67,7 +97,7 @@ export async function runDoctor() {
67
97
  name: 'Desktop server',
68
98
  ok: false,
69
99
  detail: 'not enabled in the connection file',
70
- fix: 'Open Slates → Settings → Agent Control → toggle on. Every workspace op needs this.',
100
+ fix: 'Open Slates → Settings → AI tools and connect (Send link, or Connect without the email link). Every workspace op needs this.',
71
101
  });
72
102
  }
73
103
  else {
@@ -84,7 +114,7 @@ export async function runDoctor() {
84
114
  name: 'Desktop server',
85
115
  ok: false,
86
116
  detail: err instanceof Error ? err.message : String(err),
87
- fix: 'Open the Slates app. If it IS open, the stored port is stale — toggle Agent Control off and on.',
117
+ fix: 'Open the Slates app. If it IS open, the stored port is stale — in Settings → AI tools, Disconnect and connect again.',
88
118
  });
89
119
  }
90
120
  }
@@ -148,8 +178,21 @@ export async function runDoctor() {
148
178
  : `${mcpConfigs.length} client config(s) detected, none mentions slates`,
149
179
  fix: 'Run `slates mcp --write` (or `slates setup`), then restart the client.',
150
180
  });
151
- // ── Report ──
181
+ // ── Package version ──
152
182
  const version = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'package.json'), 'utf8'));
183
+ const latest = await refreshLatestVersion('@slatesvideo/cli');
184
+ const behind = latest !== null && compareVersions(version.version, latest) < 0;
185
+ checks.push({
186
+ name: 'CLI version',
187
+ ok: !behind,
188
+ detail: latest === null
189
+ ? `v${version.version} installed; registry unreachable, could not compare`
190
+ : behind
191
+ ? `v${version.version} installed, v${latest} published`
192
+ : `v${version.version} is the latest`,
193
+ fix: 'Run `npm i -g @slatesvideo/cli@latest`, then `slates install-skills` to refresh skill files.',
194
+ });
195
+ // ── Report ──
153
196
  console.log(`slates doctor — CLI v${version.version}\n`);
154
197
  for (const c of checks) {
155
198
  console.log(`${c.ok ? ' ok ' : ' ✗ '}${c.name}: ${c.detail}`);
@@ -139,7 +139,7 @@ export function runMcp(opts) {
139
139
  }
140
140
  }
141
141
  console.log('\n── Next steps ──');
142
- console.log(' 1. Connect your account: open Slates → Settings → Agent Control → Send link');
142
+ console.log(' 1. Connect your account: open Slates → Settings → AI tools → Send link');
143
143
  console.log(' (or run `slates login`)');
144
144
  console.log(' 2. Install the agent skills: `slates install-skills`');
145
145
  }
@@ -411,7 +411,7 @@ function coerceForSchema(schema, raw) {
411
411
  // Array fields: a single `--ids X` produced a bare string; repeated
412
412
  // `--ids X --ids Y` produced an array. Accept either, plus comma-split
413
413
  // (`--ids a,b,c`). Coerce each element to the array's element type.
414
- if (fieldType === 'ZodArray' && typeof value !== 'object') {
414
+ if (fieldType === 'ZodArray' && (typeof value !== 'object' || Array.isArray(value))) {
415
415
  const elemType = (unwrap(leaf?._def?.type)?._def?.typeName ?? '');
416
416
  const arr = Array.isArray(value)
417
417
  ? value
@@ -37,7 +37,7 @@ export function runSetup(opts) {
37
37
  if (hasCloud || hasDesktop) {
38
38
  console.log(` Partially connected (${hasCloud ? 'cloud' : 'desktop'} only) — finish the link below.`);
39
39
  }
40
- console.log(' Open Slates desktop → Settings → Agent Control → enter your email → Send link,');
40
+ console.log(' Open Slates desktop → Settings → AI tools → enter your email → Send link,');
41
41
  console.log(' then click the link in your email. (Or run `slates login`.)');
42
42
  console.log(' That one step authorizes the agent AND starts the local server the tools talk to.');
43
43
  }
@@ -5,7 +5,7 @@ export async function runStatus() {
5
5
  console.log(`Cloud token: ${c.cloud.token ? 'present' : 'missing — run `slates login`'}`);
6
6
  console.log(`Desktop server: ${c.desktop.enabled
7
7
  ? `enabled on 127.0.0.1:${c.desktop.port}`
8
- : 'disabled — open Slates → Settings → Agent Control'}`);
8
+ : 'disabled — open Slates → Settings → AI tools'}`);
9
9
  if (c.cloud.token) {
10
10
  try {
11
11
  const cloud = new SlatesCloudClient();
@@ -1,2 +1,4 @@
1
- export declare function runUse(target: string | undefined): Promise<void>;
1
+ export declare function runUse(target: string | undefined, opts?: {
2
+ clear?: boolean;
3
+ }): Promise<void>;
2
4
  //# sourceMappingURL=use.d.ts.map
@@ -1,16 +1,16 @@
1
1
  import { SlatesDesktopClient, setDefaultProjectId, readDefaultProjectId, } from '@slatesvideo/shared';
2
2
  import { EXIT, exitFor } from '../exit-codes.js';
3
- export async function runUse(target) {
3
+ export async function runUse(target, opts = {}) {
4
+ if (opts.clear || target === 'none') {
5
+ setDefaultProjectId(null);
6
+ console.log('Default project cleared.');
7
+ return;
8
+ }
4
9
  if (!target) {
5
10
  const current = readDefaultProjectId();
6
11
  console.log(current ? `Default project: ${current}` : 'No default project set.');
7
12
  return;
8
13
  }
9
- if (target === '--clear' || target === 'none') {
10
- setDefaultProjectId(null);
11
- console.log('Default project cleared.');
12
- return;
13
- }
14
14
  let projects = [];
15
15
  try {
16
16
  const r = await new SlatesDesktopClient().get('/agent/projects');
@@ -9,7 +9,7 @@ export declare const EXIT: {
9
9
  /** The op returned `requires_clarification` — a required choice is missing
10
10
  * (aspect ratio, resolution, duration). Its `message` names the field. */
11
11
  readonly CLARIFICATION_REQUIRED: 4;
12
- /** The Slates desktop app is not running with Agent Control on. */
12
+ /** The Slates desktop app is not running, or its local server is off (Settings → AI tools). */
13
13
  readonly DESKTOP_UNREACHABLE: 5;
14
14
  /** No cloud token, or it was revoked. Run `slates login`. */
15
15
  readonly NOT_SIGNED_IN: 6;
@@ -21,7 +21,7 @@ export const EXIT = {
21
21
  /** The op returned `requires_clarification` — a required choice is missing
22
22
  * (aspect ratio, resolution, duration). Its `message` names the field. */
23
23
  CLARIFICATION_REQUIRED: 4,
24
- /** The Slates desktop app is not running with Agent Control on. */
24
+ /** The Slates desktop app is not running, or its local server is off (Settings → AI tools). */
25
25
  DESKTOP_UNREACHABLE: 5,
26
26
  /** No cloud token, or it was revoked. Run `slates login`. */
27
27
  NOT_SIGNED_IN: 6,
@@ -36,7 +36,7 @@ export function exitFor(err) {
36
36
  if (code === 'CLOUD_TOKEN_MISSING')
37
37
  return EXIT.NOT_SIGNED_IN;
38
38
  const message = err instanceof Error ? err.message : String(err);
39
- if (/not reachable|Agent Control|is not running/i.test(message))
39
+ if (/not reachable|AI tools|Agent Control|is not running/i.test(message))
40
40
  return EXIT.DESKTOP_UNREACHABLE;
41
41
  if (/rejected the auth token|slates login|401/i.test(message))
42
42
  return EXIT.NOT_SIGNED_IN;
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { Command } from 'commander';
3
3
  import { readFileSync } from 'node:fs';
4
4
  import { join, dirname } from 'node:path';
5
5
  import { fileURLToPath } from 'node:url';
6
- import { readConnection, setCloudToken, clearCloudToken } from '@slatesvideo/shared';
6
+ import { readConnection, setCloudToken, clearCloudToken, refreshLatestVersion, updateNotice } from '@slatesvideo/shared';
7
7
  import { runLogin } from './commands/login.js';
8
8
  import { runLogout } from './commands/logout.js';
9
9
  import { runStatus } from './commands/status.js';
@@ -24,7 +24,7 @@ import { ALL_OPERATIONS } from '@slatesvideo/shared';
24
24
  // the operations into recipes.
25
25
  //
26
26
  // First-time use:
27
- // 1. Open Slates desktop → Settings → Agent Control → Send link.
27
+ // 1. Open Slates desktop → Settings → AI tools → Send link.
28
28
  // 2. Click the link in your email (or run `slates login`).
29
29
  // 3. The connection is written to ~/.slates/agent-connection.json —
30
30
  // cloud token + the desktop app's local port + token.
@@ -38,12 +38,21 @@ import { ALL_OPERATIONS } from '@slatesvideo/shared';
38
38
  // Version comes from this package's own package.json (dist/index.js → ../package.json)
39
39
  // so the CLI never drifts from the published version.
40
40
  const pkg = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', 'package.json'), 'utf8'));
41
+ const CLI_PKG_NAME = '@slatesvideo/cli';
41
42
  const program = new Command();
42
43
  program
43
44
  .name('slates')
44
45
  .description('Slates CLI — drive AI Video Creation Studio from your terminal.')
45
46
  .version(pkg.version)
46
- .enablePositionalOptions();
47
+ .enablePositionalOptions()
48
+ // Version handshake: one bounded registry lookup an hour, cached in
49
+ // ~/.slates/update-check.json, printed to STDERR so JSON on stdout stays
50
+ // clean and an agent driving the CLI still sees it. Fail-silent offline.
51
+ .hook('preAction', async () => {
52
+ const notice = updateNotice(CLI_PKG_NAME, pkg.version, await refreshLatestVersion(CLI_PKG_NAME), 'Run `npm i -g @slatesvideo/cli@latest` (or invoke it as `npx @slatesvideo/cli@latest`), then `slates install-skills` if you use skill files.');
53
+ if (notice)
54
+ console.error(`slates: ${notice}`);
55
+ });
47
56
  program
48
57
  .command('login')
49
58
  .description('Authorize this CLI to use your Slates account (magic link).')
@@ -83,7 +92,8 @@ program
83
92
  .command('use')
84
93
  .description('Set the default project for this machine, by id or name. Ops that take projectId fill it when you omit one; an explicit --projectId always wins. No argument prints the current default; `slates use --clear` removes it.')
85
94
  .argument('[project]', 'Project id or name')
86
- .action((project) => runUse(project));
95
+ .option('--clear', 'Remove the default project', false)
96
+ .action((project, opts) => runUse(project, opts));
87
97
  program
88
98
  .command('completion')
89
99
  .description('Print a shell completion script for the 91 operation ids.')
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@slatesvideo/cli",
3
- "version": "0.5.20",
4
- "description": "Slates CLI: drive the Slates AI video studio from your terminal or let Claude Code shell out to it. Includes the bundled agent skills and an MCP client configurator.",
3
+ "version": "0.6.0",
4
+ "description": "Slates CLI: drive the Slates AI video studio from your terminal or let Codex (with your ChatGPT account) or Claude Code shell out to it. Includes the bundled agent skills and an MCP client configurator.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "bin": {
@@ -47,7 +47,7 @@
47
47
  "node": ">=18"
48
48
  },
49
49
  "dependencies": {
50
- "@slatesvideo/shared": "^0.6.10",
50
+ "@slatesvideo/shared": "^0.7.0",
51
51
  "commander": "^12.1.0",
52
52
  "zod": "^3.23.0"
53
53
  },