@slatesvideo/cli 0.6.0 → 0.6.1

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 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.
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 -->157<!-- /gen:tool-count --> tool schemas into context.
4
4
 
5
5
  ## Install
6
6
 
@@ -17,9 +17,9 @@ Requires Node.js 18+ and the Slates desktop app ([slates.video](https://slates.v
17
17
  | `slates login` | Authorize this machine via magic link (or `--token slates_sk_...`) |
18
18
  | `slates logout` | Clear the stored cloud token |
19
19
  | `slates status` | Show connection state, account, and credit balance |
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
- | `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 -->142<!-- /gen:tool-count -->, `<op> --help` shows one op's flags |
20
+ | `slates mcp` | Detect Codex, Claude and Cursor; print the Codex/Claude Code setup commands or the JSON config; `--write` merges it into Claude Desktop / Cursor configs (with a `.bak` backup) |
21
+ | `slates install-skills` | Install the same bundled skills for Claude Code and Codex; `--client claude` or `--client codex` selects one, and `--global` covers every project |
22
+ | `slates run <op>` | Invoke any Slates operation by id; `--list` shows all <!-- gen:tool-count -->157<!-- /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,9 +27,9 @@ 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 -->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 -->.
30
+ <!-- gen:skill-count -->36<!-- /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 -->15<!-- /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, 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
- `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.
32
+ `slates install-skills` writes each portable `SKILL.md` to `.claude/skills/<skill-name>/` for Claude Code and `.agents/skills/<skill-name>/` for Codex. Both receive identical content. Use `--global` for every project, or `--client claude` / `--client codex` to install for one client. Skills reload automatically; use `/reload-skills` in Claude Code if the root was just created, or restart Codex if its list has not refreshed. The installer preserves other files, including old flat Markdown copies.
33
33
 
34
34
  ## Using `slates run` (agent-driven)
35
35
 
@@ -47,7 +47,7 @@ slates run slates_estimate_generation_cost --model kling-v3-standard-5s
47
47
  slates run slates_generate_image --projectId <uuid> --prompt "..." --resolution 1k --aspectRatio 16:9
48
48
 
49
49
  # Kick off a video in the background, then poll it
50
- slates run slates_generate_video --projectId <uuid> --model veo-3.1-fast --prompt "..." --aspectRatio 16:9 --duration 8 --background true --confirm true
50
+ slates run slates_generate_video --projectId <uuid> --model seedance-2.5 --prompt "..." --aspectRatio 16:9 --duration 8 --background true --confirm true
51
51
  slates run slates_get_generation_status --generationId <uuid>
52
52
 
53
53
  # Assemble + export
@@ -1,18 +1,11 @@
1
- import { readFileSync, existsSync, readdirSync } from 'node:fs';
1
+ import { readFileSync, existsSync } 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
5
  import { readConnection, CONNECTION_FILE, SlatesCloudClient, SlatesDesktopClient, SKILLS, refreshLatestVersion, compareVersions, } from '@slatesvideo/shared';
6
6
  import { EXIT } from '../exit-codes.js';
7
- function frontmatterName(markdown, fallback) {
8
- if (!markdown.startsWith('---'))
9
- return fallback;
10
- const end = markdown.indexOf('\n---', 3);
11
- if (end === -1)
12
- return fallback;
13
- const m = markdown.slice(3, end).match(/^name:\s*(.+?)\s*$/m);
14
- return m ? m[1].trim() : fallback;
15
- }
7
+ import { skillInstallTargets, inspectSkillInstallation } from './install-skills.js';
8
+ import { CODEX_MCP_SETUP, inspectCodexMcpConfig } from './mcp-config.js';
16
9
  /** Every capability an op checks with `requireCapability`, and what needs it.
17
10
  * scripts/agent-surface-lockstep-check.mjs (check 11) fails when this list and
18
11
  * the ops' call sites disagree. */
@@ -51,6 +44,24 @@ const REQUIRED_CAPABILITIES = [
51
44
  ['named-cuts', 'named cuts and batch export'],
52
45
  ['timeline-markers', 'timeline markers'],
53
46
  ['project-relocate', 'moving a project into the current projects folder'],
47
+ ['manual-pictures', "the manual's pictures of each screen"],
48
+ ['ui-pointer', 'pointing at a control in the window'],
49
+ ['composer', 'reading and staging the prompt box'],
50
+ ['reorder', 'reordering folders and pins'],
51
+ ['usage', 'usage'],
52
+ ['app-settings', 'app settings'],
53
+ ['agent-host', "choosing who does the Studio Agent's thinking"],
54
+ ['asset-detail', 'reading one asset in full'],
55
+ ['asset-link', 'linking a clip to its picture'],
56
+ ['frame-extract', 'extracting a frame from a clip'],
57
+ ['view-v2', 'showing and opening things in the window'],
58
+ ['selection-set', 'ticking cards and shots'],
59
+ ['first-frames', 'using pictures as first frames'],
60
+ ['grid-extract', 'extracting cells from a grid picture'],
61
+ ['frame-preferred-clip', 'choosing the clip a slot uses'],
62
+ ['trim-pieces', 'cutting a clip into pieces'],
63
+ ['shot-from-asset', 'saving a result as a Shot'],
64
+ ['media-folder', 'choosing the folder a generation or upload lands in'],
54
65
  ];
55
66
  export async function runDoctor() {
56
67
  const checks = [];
@@ -131,28 +142,18 @@ export async function runDoctor() {
131
142
  fix: 'Update Slates (Settings → Check for Updates). The ops that need these will refuse until you do.',
132
143
  });
133
144
  }
134
- // 5. Installed skills vs what this CLI ships.
135
- const bundled = new Set(Object.entries(SKILLS).map(([k, v]) => frontmatterName(v, k)));
136
- const roots = [join(process.cwd(), '.claude', 'skills'), join(homedir(), '.claude', 'skills')];
137
- const installedRoot = roots.find((r) => existsSync(r));
138
- if (!installedRoot) {
139
- checks.push({
140
- name: 'Agent skills',
141
- ok: false,
142
- detail: 'none installed',
143
- fix: 'Run `slates install-skills` (add --global for ~/.claude/skills), then restart Claude Code.',
144
- });
145
- }
146
- else {
147
- const installed = new Set(readdirSync(installedRoot).filter((d) => existsSync(join(installedRoot, d, 'SKILL.md'))));
148
- const missing = [...bundled].filter((s) => !installed.has(s));
145
+ // Native skill files are optional with MCP. Inspect both scopes for each client.
146
+ for (const target of skillInstallTargets('both', process.cwd())) {
147
+ const globalTarget = skillInstallTargets(target.client, homedir())[0];
148
+ const state = inspectSkillInstallation([target.path, globalTarget.path]);
149
+ const absent = state.installed === 0;
149
150
  checks.push({
150
- name: 'Agent skills',
151
- ok: missing.length === 0,
152
- detail: missing.length === 0
153
- ? `${bundled.size} of ${bundled.size} installed in ${installedRoot}`
154
- : `${bundled.size - missing.length} of ${bundled.size} installed — missing ${missing.length}`,
155
- fix: 'Run `slates install-skills` to bring them up to this CLI version, then restart Claude Code.',
151
+ name: `Agent skills (${target.client})`,
152
+ ok: absent || (!state.missing.length && !state.stale.length),
153
+ detail: absent
154
+ ? 'not installed; MCP guides remain available'
155
+ : `${state.installed} of ${Object.keys(SKILLS).length} installed; ${state.missing.length} missing, ${state.stale.length} outdated, ${state.duplicates.length} duplicate names`,
156
+ fix: `Run slates install-skills --client ${target.client}; also add --global if you have a global copy.`,
156
157
  });
157
158
  }
158
159
  // 6. MCP client configs — present is enough; `slates mcp` owns the detail.
@@ -170,13 +171,18 @@ export async function runDoctor() {
170
171
  return false;
171
172
  }
172
173
  });
174
+ const codex = inspectCodexMcpConfig();
173
175
  checks.push({
174
176
  name: 'MCP client config',
175
- ok: wired.length > 0,
176
- detail: wired.length > 0
177
- ? `slates entry found in ${wired.length} of ${mcpConfigs.length} detected config(s)`
178
- : `${mcpConfigs.length} client config(s) detected, none mentions slates`,
179
- fix: 'Run `slates mcp --write` (or `slates setup`), then restart the client.',
177
+ ok: codex.configured || wired.length > 0,
178
+ detail: codex.configured
179
+ ? 'Slates entry found in Codex config (configuration only; connection checked separately)'
180
+ : wired.length > 0
181
+ ? `slates entry found in ${wired.length} of ${mcpConfigs.length} detected JSON config(s)`
182
+ : codex.invalid.length
183
+ ? `Codex config could not be parsed: ${codex.invalid.join(', ')}`
184
+ : `${mcpConfigs.length + codex.files.length} client config(s) detected; no enabled Slates entry found`,
185
+ fix: `For Codex, run ${CODEX_MCP_SETUP}; for Claude Desktop or Cursor, run slates mcp --write. Restart the client.`,
180
186
  });
181
187
  // ── Package version ──
182
188
  const version = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'package.json'), 'utf8'));
@@ -1,6 +1,31 @@
1
- interface InstallSkillsOptions {
1
+ declare const CLIENT_DIRECTORIES: {
2
+ readonly claude: ".claude";
3
+ readonly codex: ".agents";
4
+ };
5
+ export type SkillClient = keyof typeof CLIENT_DIRECTORIES | 'both';
6
+ export declare const SKILL_CLIENTS: string[];
7
+ export interface InstallSkillsOptions {
2
8
  global?: boolean;
9
+ client?: SkillClient;
3
10
  }
4
- export declare function runInstallSkills(opts: InstallSkillsOptions): void;
11
+ interface SkillEnvironment {
12
+ cwd: string;
13
+ home: string;
14
+ skills: Record<string, string>;
15
+ log: (message: string) => void;
16
+ }
17
+ export declare function skillInstallTargets(client: SkillClient, base: string): Array<{
18
+ client: Exclude<SkillClient, 'both'>;
19
+ path: string;
20
+ }>;
21
+ /** Check every installed copy: Codex can discover same-name skills in both scopes. */
22
+ export declare function inspectSkillInstallation(roots: string[], skills?: Record<string, string>): {
23
+ installed: number;
24
+ missing: string[];
25
+ stale: string[];
26
+ duplicates: string[];
27
+ };
28
+ /** Both clients consume the same embedded portable SKILL.md source. */
29
+ export declare function runInstallSkills(opts: InstallSkillsOptions, environment?: SkillEnvironment): void;
5
30
  export {};
6
31
  //# sourceMappingURL=install-skills.d.ts.map
@@ -1,83 +1,58 @@
1
1
  import { join } from 'node:path';
2
2
  import { homedir } from 'node:os';
3
- import { existsSync, readdirSync, writeFileSync, mkdirSync, rmSync, statSync, } from 'node:fs';
4
- import { SKILLS } from '@slatesvideo/shared';
5
- // Install the bundled skill markdown into Claude Code's skill directories.
6
- //
7
- // Skill content is embedded in @slatesvideo/shared (generated from
8
- // packages/shared/skills/*.md at build time), so the install works no matter
9
- // how the CLI was delivered — global npm install, npx, or a bundled binary.
10
- //
11
- // Claude Code discovers skills as DIRECTORIES: .claude/skills/<name>/SKILL.md.
12
- // A loose .md file dropped straight into .claude/skills/ is silently never
13
- // loaded. So each bundled skill is written to its own <name>/SKILL.md folder,
14
- // where <name> comes from the skill's frontmatter `name:` field (falling back
15
- // to the embedded key, the source filename sans .md). Discovery runs at
16
- // session start — a restart of Claude Code is required before new skills
17
- // appear.
18
- function frontmatterName(markdown, fallback) {
19
- if (!markdown.startsWith('---'))
20
- return fallback;
21
- const end = markdown.indexOf('\n---', 3);
22
- if (end === -1)
23
- return fallback;
24
- const block = markdown.slice(3, end);
25
- const m = block.match(/^name:\s*(.+?)\s*$/m);
26
- return m ? m[1].trim() : fallback;
3
+ import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
4
+ import { SKILLS, parseSkillMetadata } from '@slatesvideo/shared';
5
+ const CLIENT_DIRECTORIES = { claude: '.claude', codex: '.agents' };
6
+ export const SKILL_CLIENTS = ['both', ...Object.keys(CLIENT_DIRECTORIES)];
7
+ export function skillInstallTargets(client, base) {
8
+ if (client !== 'both' && !Object.hasOwn(CLIENT_DIRECTORIES, client))
9
+ throw new Error(`Unknown skill client: ${client}`);
10
+ return Object.entries(CLIENT_DIRECTORIES)
11
+ .filter(([name]) => client === 'both' || name === client)
12
+ .map(([name, directory]) => ({ client: name, path: join(base, directory, 'skills') }));
27
13
  }
28
- export function runInstallSkills(opts) {
29
- const skillEntries = Object.entries(SKILLS);
30
- if (skillEntries.length === 0) {
31
- console.error('No bundled skills found in @slatesvideo/shared — broken build?');
32
- process.exit(1);
14
+ /** Check every installed copy: Codex can discover same-name skills in both scopes. */
15
+ export function inspectSkillInstallation(roots, skills = SKILLS) {
16
+ const missing = [];
17
+ const stale = [];
18
+ const duplicates = [];
19
+ for (const [key, content] of Object.entries(skills)) {
20
+ const { name } = parseSkillMetadata(content, key);
21
+ const files = [...new Set(roots)].map(root => join(root, name, 'SKILL.md')).filter(path => existsSync(path));
22
+ if (!files.length)
23
+ missing.push(name);
24
+ else if (files.some(file => readFileSync(file, 'utf8') !== content))
25
+ stale.push(name);
26
+ if (files.length > 1)
27
+ duplicates.push(name);
33
28
  }
34
- const target = opts.global
35
- ? join(homedir(), '.claude', 'skills')
36
- : join(process.cwd(), '.claude', 'skills');
37
- if (!existsSync(target))
38
- mkdirSync(target, { recursive: true });
39
- // Migrate away from the old broken layout: earlier versions of this
40
- // command copied loose slates-*.md files flat into the skills root, where
41
- // Claude Code never discovers them. Remove them — the same content is
42
- // about to be written in the correct <name>/SKILL.md layout. EXACT
43
- // filename match only (the embedded key + .md): a slates-* glob would
44
- // also delete a user's own files (e.g. slates-notes.md).
45
- const legacyFilenames = new Set(skillEntries.map(([key]) => `${key}.md`));
46
- const stale = readdirSync(target).filter((f) => {
47
- if (!legacyFilenames.has(f))
48
- return false;
49
- try {
50
- return statSync(join(target, f)).isFile();
51
- }
52
- catch {
53
- return false;
54
- }
55
- });
56
- for (const f of stale)
57
- rmSync(join(target, f));
58
- if (stale.length > 0) {
59
- console.log(`Removed ${stale.length} stale flat .md file(s) left by a previous install — ` +
60
- `the old flat layout was never picked up by Claude Code. Reinstalling in the correct layout now.`);
61
- }
62
- let fresh = 0;
63
- let updated = 0;
64
- for (const [key, content] of skillEntries) {
65
- const name = frontmatterName(content, key);
66
- const dir = join(target, name);
67
- const isUpdate = existsSync(dir);
68
- mkdirSync(dir, { recursive: true });
69
- writeFileSync(join(dir, 'SKILL.md'), content);
70
- if (isUpdate) {
71
- updated++;
72
- console.log(`update ${name}`);
73
- }
74
- else {
75
- fresh++;
76
- console.log(`install ${name}`);
29
+ return { installed: Object.keys(skills).length - missing.length, missing, stale, duplicates };
30
+ }
31
+ /** Both clients consume the same embedded portable SKILL.md source. */
32
+ export function runInstallSkills(opts, environment = {
33
+ cwd: process.cwd(), home: homedir(), skills: SKILLS, log: console.log,
34
+ }) {
35
+ const entries = Object.entries(environment.skills).map(([key, content]) => ({
36
+ ...parseSkillMetadata(content, key), content,
37
+ }));
38
+ if (!entries.length)
39
+ throw new Error('No bundled skills found in @slatesvideo/shared');
40
+ const targets = skillInstallTargets(opts.client ?? 'both', opts.global ? environment.home : environment.cwd);
41
+ for (const target of targets) {
42
+ let fresh = 0;
43
+ let updated = 0;
44
+ for (const { name, content } of entries) {
45
+ const directory = join(target.path, name);
46
+ const file = join(directory, 'SKILL.md');
47
+ if (existsSync(file))
48
+ updated++;
49
+ else
50
+ fresh++;
51
+ mkdirSync(directory, { recursive: true });
52
+ writeFileSync(file, content);
77
53
  }
54
+ environment.log(`Installed ${entries.length} ${target.client} skills (${fresh} new, ${updated} updated) into ${target.path}`);
78
55
  }
79
- const total = fresh + updated;
80
- console.log(`\nInstalled ${total} skill(s) (${fresh} new, ${updated} updated) into ${target}`);
81
- console.log(`Restart Claude Code, then ask: 'what slates skills do you have?' to verify.`);
56
+ environment.log('Skills reload automatically. In Claude Code, use /reload-skills if the skill root was just created; restart Codex if its list has not refreshed.');
82
57
  }
83
58
  //# sourceMappingURL=install-skills.js.map
@@ -0,0 +1,13 @@
1
+ export declare const CODEX_MCP_SETUP = "codex mcp add slates -- npx -y @slatesvideo/mcp-server";
2
+ /** Read configuration only. A detected entry does not prove authentication or connectivity. */
3
+ export declare function inspectCodexMcpConfig(environment?: {
4
+ cwd: string;
5
+ home: string;
6
+ codexHome: string | undefined;
7
+ }): {
8
+ files: string[];
9
+ configured: boolean;
10
+ disabled: boolean;
11
+ invalid: string[];
12
+ };
13
+ //# sourceMappingURL=mcp-config.d.ts.map
@@ -0,0 +1,31 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { homedir } from 'node:os';
4
+ import TOML from '@iarna/toml';
5
+ export const CODEX_MCP_SETUP = 'codex mcp add slates -- npx -y @slatesvideo/mcp-server';
6
+ /** Read configuration only. A detected entry does not prove authentication or connectivity. */
7
+ export function inspectCodexMcpConfig(environment = { cwd: process.cwd(), home: homedir(), codexHome: process.env.CODEX_HOME }) {
8
+ const files = [...new Set([join(environment.codexHome || join(environment.home, '.codex'), 'config.toml'), join(environment.cwd, '.codex', 'config.toml')])].filter(file => existsSync(file));
9
+ const invalid = [];
10
+ const servers = {};
11
+ for (const file of files) {
12
+ try {
13
+ const config = TOML.parse(readFileSync(file, 'utf8'));
14
+ const entries = config.mcp_servers;
15
+ if (entries && typeof entries === 'object' && !Array.isArray(entries)) {
16
+ for (const [name, entry] of Object.entries(entries)) {
17
+ if (entry && typeof entry === 'object' && !Array.isArray(entry))
18
+ servers[name] = { ...servers[name], ...entry };
19
+ }
20
+ }
21
+ }
22
+ catch {
23
+ // Parser excerpts can include credentials; report the path without quoting config contents.
24
+ invalid.push(file);
25
+ }
26
+ }
27
+ const slates = Object.entries(servers).filter(([name, server]) => name === 'slates' || (Array.isArray(server.args) && server.args.includes('@slatesvideo/mcp-server')));
28
+ const configured = slates.some(([, server]) => server.enabled !== false && (typeof server.command === 'string' || typeof server.url === 'string'));
29
+ return { files, configured: configured && invalid.length === 0, disabled: slates.length > 0 && !configured, invalid };
30
+ }
31
+ //# sourceMappingURL=mcp-config.js.map
@@ -1,9 +1,10 @@
1
1
  import { join, delimiter } from 'node:path';
2
2
  import { homedir, platform } from 'node:os';
3
3
  import { existsSync, readFileSync, writeFileSync, copyFileSync } from 'node:fs';
4
+ import { CODEX_MCP_SETUP, inspectCodexMcpConfig } from './mcp-config.js';
4
5
  // `slates mcp` — zero-to-configured MCP in one command.
5
6
  //
6
- // Detects installed MCP clients (Claude Code, Claude Desktop, Cursor) and
7
+ // Detects installed MCP clients (Codex, Claude Code, Claude Desktop, Cursor) and
7
8
  // prints the exact config for each one found. With --write, safely merges
8
9
  // the "slates" mcpServers entry into Claude Desktop's and Cursor's config
9
10
  // files (backing up the original to <file>.bak first). No interactive
@@ -27,7 +28,7 @@ function claudeDesktopConfigPath() {
27
28
  function cursorConfigPath() {
28
29
  return join(homedir(), '.cursor', 'mcp.json');
29
30
  }
30
- function claudeBinaryOnPath() {
31
+ function binaryOnPath(name) {
31
32
  const pathVar = process.env.PATH ?? '';
32
33
  const exts = platform() === 'win32' ? ['.cmd', '.exe', '.bat', ''] : [''];
33
34
  for (const dir of pathVar.split(delimiter)) {
@@ -35,7 +36,7 @@ function claudeBinaryOnPath() {
35
36
  continue;
36
37
  for (const ext of exts) {
37
38
  try {
38
- if (existsSync(join(dir, `claude${ext}`)))
39
+ if (existsSync(join(dir, `${name}${ext}`)))
39
40
  return true;
40
41
  }
41
42
  catch {
@@ -96,12 +97,16 @@ function indent(text, spaces) {
96
97
  export function runMcp(opts) {
97
98
  const desktopFile = claudeDesktopConfigPath();
98
99
  const cursorFile = cursorConfigPath();
99
- const hasClaudeCode = claudeBinaryOnPath();
100
+ const codex = inspectCodexMcpConfig();
101
+ const hasCodex = binaryOnPath('codex') || codex.files.length > 0;
102
+ const hasClaudeCode = binaryOnPath('claude');
100
103
  const hasClaudeDesktop = existsSync(desktopFile);
101
104
  const hasCursor = existsSync(cursorFile);
102
- const anyDetected = hasClaudeCode || hasClaudeDesktop || hasCursor;
105
+ const anyDetected = hasCodex || hasClaudeCode || hasClaudeDesktop || hasCursor;
103
106
  if (anyDetected) {
104
107
  const found = [];
108
+ if (hasCodex)
109
+ found.push('Codex');
105
110
  if (hasClaudeCode)
106
111
  found.push('Claude Code');
107
112
  if (hasClaudeDesktop)
@@ -111,7 +116,14 @@ export function runMcp(opts) {
111
116
  console.log(`Detected: ${found.join(', ')}`);
112
117
  }
113
118
  else {
114
- console.log('No MCP client detected — showing setup for all three.');
119
+ console.log('No MCP client detected — showing setup for all clients.');
120
+ }
121
+ if (hasCodex || !anyDetected) {
122
+ console.log('\n── Codex ──');
123
+ console.log(` Slates MCP entry: ${codex.configured ? 'configured' : codex.invalid.length ? 'config needs repair' : codex.disabled ? 'disabled' : 'not found'}`);
124
+ if (codex.invalid.length)
125
+ console.log(` Could not parse: ${codex.invalid.join(', ')}`);
126
+ console.log(` Run in your terminal:\n\n ${CODEX_MCP_SETUP}\n`);
115
127
  }
116
128
  if (hasClaudeCode || !anyDetected)
117
129
  printClaudeCodeSection();
@@ -132,7 +144,7 @@ export function runMcp(opts) {
132
144
  }
133
145
  if (!hasClaudeDesktop && !hasCursor) {
134
146
  console.log(' Nothing to write — no Claude Desktop or Cursor config file found.');
135
- console.log(' (--write only edits existing config files; Claude Code uses the one-liner above.)');
147
+ console.log(' (--write only edits existing config files; Codex and Claude Code use the one-liners above.)');
136
148
  }
137
149
  else if (wrote > 0) {
138
150
  console.log(' Restart the client(s) to pick up the new server.');
@@ -1,6 +1,8 @@
1
+ import { type SkillClient } from './install-skills.js';
1
2
  interface SetupOptions {
2
3
  global?: boolean;
3
4
  skipSkills?: boolean;
5
+ client?: SkillClient;
4
6
  }
5
7
  export declare function runSetup(opts: SetupOptions): void;
6
8
  export {};
@@ -4,14 +4,14 @@ import { runInstallSkills } from './install-skills.js';
4
4
  // `slates setup` — the one-command onboarding. Does the three setup steps in
5
5
  // order so a user (or an agent following a single instruction) can go from
6
6
  // "nothing" to "connected":
7
- // 1. Write the Slates MCP config into every detected client (Claude Desktop,
8
- // Claude Code, Cursor) — no manual JSON editing.
9
- // 2. Install the bundled agent skills into the current project.
7
+ // 1. Detect MCP clients, write Claude Desktop/Cursor configs, and print the
8
+ // supported setup commands for Codex and Claude Code.
9
+ // 2. Install the same bundled skills for Claude Code and Codex.
10
10
  // 3. Point at the account-connect step (magic link — interactive, so it
11
11
  // happens in the Slates desktop app or via `slates login`, not here).
12
12
  //
13
- // Steps 1-2 are mechanical and run automatically; step 3 is auth and only ever
14
- // guided, never silently performed.
13
+ // Config writes and skill installation run automatically; terminal setup and
14
+ // account sign-in remain visible instructions.
15
15
  export function runSetup(opts) {
16
16
  console.log('Slates setup — getting you connected.');
17
17
  // 1. MCP client config — always write in the one-command flow (that's the point).
@@ -23,7 +23,7 @@ export function runSetup(opts) {
23
23
  }
24
24
  else {
25
25
  console.log('\n② Installing agent skills');
26
- runInstallSkills({ global: !!opts.global });
26
+ runInstallSkills({ global: !!opts.global, client: opts.client });
27
27
  }
28
28
  // 3. Account connection — interactive (magic link), so guide rather than block.
29
29
  console.log('\n③ Connect your Slates account');
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { Command } from 'commander';
2
+ import { Command, Option } from 'commander';
3
3
  import { readFileSync } from 'node:fs';
4
4
  import { join, dirname } from 'node:path';
5
5
  import { fileURLToPath } from 'node:url';
@@ -8,7 +8,7 @@ import { runLogin } from './commands/login.js';
8
8
  import { runLogout } from './commands/logout.js';
9
9
  import { runStatus } from './commands/status.js';
10
10
  import { runOp } from './commands/op.js';
11
- import { runInstallSkills } from './commands/install-skills.js';
11
+ import { runInstallSkills, SKILL_CLIENTS } from './commands/install-skills.js';
12
12
  import { runMcp } from './commands/mcp.js';
13
13
  import { runSetup } from './commands/setup.js';
14
14
  import { runDoctor } from './commands/doctor.js';
@@ -34,7 +34,7 @@ import { ALL_OPERATIONS } from '@slatesvideo/shared';
34
34
  // slates run slates_generate_image --prompt "..." --resolution 1k --aspectRatio 16:9
35
35
  //
36
36
  // Run `slates install-skills` to copy the bundled skills into
37
- // .claude/skills/<name>/SKILL.md for higher-level recipes.
37
+ // Claude Code and Codex skill directories for higher-level recipes.
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'));
@@ -71,7 +71,8 @@ program
71
71
  program
72
72
  .command('setup')
73
73
  .description('One-command onboarding: write the MCP config into every detected client, install the skills, and point you at the account-connect step.')
74
- .option('--global', 'Install skills into ~/.claude/skills instead of the current project', false)
74
+ .option('--global', 'Install skills for every project instead of the current project', false)
75
+ .addOption(new Option('--client <client>', 'Choose native skill clients').choices(SKILL_CLIENTS).default('both'))
75
76
  .option('--skip-skills', 'Only write MCP configs; do not install skills', false)
76
77
  .action((opts) => runSetup(opts));
77
78
  program
@@ -81,8 +82,9 @@ program
81
82
  .action((opts) => runMcp(opts));
82
83
  program
83
84
  .command('install-skills')
84
- .description('Install the bundled skills into .claude/skills/<name>/SKILL.md (Claude Code layout).')
85
- .option('--global', 'Install into ~/.claude/skills instead of the current project', false)
85
+ .description('Install bundled skills for Claude Code and Codex from one portable source.')
86
+ .option('--global', 'Install skills for every project instead of the current project', false)
87
+ .addOption(new Option('--client <client>', 'Choose native skill clients').choices(SKILL_CLIENTS).default('both'))
86
88
  .action((opts) => runInstallSkills(opts));
87
89
  program
88
90
  .command('doctor')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slatesvideo/cli",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
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",
@@ -47,7 +47,8 @@
47
47
  "node": ">=18"
48
48
  },
49
49
  "dependencies": {
50
- "@slatesvideo/shared": "^0.7.0",
50
+ "@iarna/toml": "^2.2.5",
51
+ "@slatesvideo/shared": "^0.7.2",
51
52
  "commander": "^12.1.0",
52
53
  "zod": "^3.23.0"
53
54
  },