@slatesvideo/cli 0.6.0 → 0.6.2
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 +7 -7
- package/dist/commands/doctor.js +56 -37
- package/dist/commands/install-skills.d.ts +27 -2
- package/dist/commands/install-skills.js +50 -75
- package/dist/commands/mcp-config.d.ts +13 -0
- package/dist/commands/mcp-config.js +31 -0
- package/dist/commands/mcp.js +19 -7
- package/dist/commands/setup.d.ts +2 -0
- package/dist/commands/setup.js +6 -6
- package/dist/index.js +8 -6
- package/package.json +3 -3
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 -->
|
|
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 -->180<!-- /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
|
|
21
|
-
| `slates install-skills` | Install the bundled
|
|
22
|
-
| `slates run <op>` | Invoke any Slates operation by id; `--list` shows all <!-- gen:tool-count -->
|
|
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 -->180<!-- /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 -->
|
|
30
|
+
<!-- gen:skill-count -->44<!-- /gen:skill-count --> agent skills ship embedded in `@slatesvideo/shared`: <!-- gen:workflow-skill-count -->28<!-- /gen:workflow-skill-count --> workflow recipes (<!-- gen:workflow-skills -->blocking-to-prompt, camera-language, captions, character-identity, chatgpt-images, cinematic-look, content-policy, cost-discipline, cuts, dialogue-blocking, direct-response-ad, edit-and-iterate, layer-brand-captions, layer-lower-third, layer-title, model-selection, motion, one-prompt-film, previs-blocking, project-organization, restyle-from-blocking, script-craft, shot-variety, storyboard-from-script, style-prompting, transitions, 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, Seedance 2.0, Seedance 2.5, Gemini Omni Flash 1.1, Wan 3.0, Kling 4.0, 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.1, GPT Image 2.5 Flare, GPT Image 2.5 Sunburst, FLUX 3 Image, 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
|
|
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
|
|
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
|
package/dist/commands/doctor.js
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import { readFileSync, existsSync
|
|
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
|
-
|
|
8
|
-
|
|
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. */
|
|
@@ -20,21 +13,34 @@ const REQUIRED_CAPABILITIES = [
|
|
|
20
13
|
['shots', 'Shots — the whole shot-list surface'],
|
|
21
14
|
['background-generation', 'background: true on any generate op'],
|
|
22
15
|
['image-references', 'reference images on image generation'],
|
|
23
|
-
['image-models-v2', 'nano-banana-pro / nano-banana-2-lite'],
|
|
24
16
|
['image-models-v3', 'gpt-image-2-5-flare / gpt-image-2-5-sunburst (five quality tiers)'],
|
|
17
|
+
['image-models-v4', 'nano-banana-2-1 / flux-3'],
|
|
25
18
|
['edit-image', 'image edits'],
|
|
26
19
|
['edit-video', 'video edits'],
|
|
27
20
|
['audio-generation', 'the audio lane'],
|
|
28
21
|
['voices', 'the preset voice shelf'],
|
|
29
22
|
['timeline', 'the timeline'],
|
|
30
23
|
['timeline-tracks', 'timeline tracks and settings'],
|
|
24
|
+
['timeline-overlays', 'text and image overlays'],
|
|
25
|
+
['timeline-keyframes', 'clip keyframes'],
|
|
26
|
+
['timeline-transitions', 'transitions on cuts'],
|
|
27
|
+
['timeline-editing', 'trim, roll, ripple, slip, move, split and clip settings'],
|
|
28
|
+
['clip-look', "a clip's blend, grain and colour"],
|
|
29
|
+
['transcripts', 'transcribing speech on this machine'],
|
|
30
|
+
['captions', 'captions'],
|
|
31
|
+
['transcript-edit', 'correcting a transcript'],
|
|
32
|
+
['caption-components', 'captions drawn by a caption component'],
|
|
33
|
+
['caption-html', 'caption layers an agent writes (html)'],
|
|
34
|
+
['html-clips', 'HTML motion layers and the motion block library'],
|
|
31
35
|
['export', 'video and XML export'],
|
|
36
|
+
['ad-variant-export', 'variant batch export, grid, delivery framing and selection'],
|
|
32
37
|
['chatgpt-image-generation', 'connected ChatGPT images'],
|
|
33
38
|
['external-image-metadata', 'saving an external image with its generation record'],
|
|
34
39
|
['selection', 'reading the live selection'],
|
|
35
40
|
['view', 'the window layout'],
|
|
36
41
|
['pins', 'pinned references'],
|
|
37
42
|
['asset-favorite', 'favorites'],
|
|
43
|
+
['asset-naming', 'naming an upload and renaming an asset'],
|
|
38
44
|
['asset-export', 'exporting media'],
|
|
39
45
|
['library', 'the Library'],
|
|
40
46
|
['templates', 'templates'],
|
|
@@ -51,6 +57,24 @@ const REQUIRED_CAPABILITIES = [
|
|
|
51
57
|
['named-cuts', 'named cuts and batch export'],
|
|
52
58
|
['timeline-markers', 'timeline markers'],
|
|
53
59
|
['project-relocate', 'moving a project into the current projects folder'],
|
|
60
|
+
['manual-pictures', "the manual's pictures of each screen"],
|
|
61
|
+
['ui-pointer', 'pointing at a control in the window'],
|
|
62
|
+
['composer', 'reading and staging the prompt box'],
|
|
63
|
+
['reorder', 'reordering folders and pins'],
|
|
64
|
+
['usage', 'usage'],
|
|
65
|
+
['app-settings', 'app settings'],
|
|
66
|
+
['agent-host', "choosing who does Slates Director's thinking"],
|
|
67
|
+
['asset-detail', 'reading one asset in full'],
|
|
68
|
+
['asset-link', 'linking a clip to its picture'],
|
|
69
|
+
['frame-extract', 'extracting a frame from a clip'],
|
|
70
|
+
['view-v2', 'showing and opening things in the window'],
|
|
71
|
+
['selection-set', 'ticking cards and shots'],
|
|
72
|
+
['first-frames', 'using pictures as first frames'],
|
|
73
|
+
['grid-extract', 'extracting cells from a grid picture'],
|
|
74
|
+
['frame-preferred-clip', 'choosing the clip a slot uses'],
|
|
75
|
+
['trim-pieces', 'cutting a clip into pieces'],
|
|
76
|
+
['shot-from-asset', 'saving a result as a Shot'],
|
|
77
|
+
['media-folder', 'choosing the folder a generation or upload lands in'],
|
|
54
78
|
];
|
|
55
79
|
export async function runDoctor() {
|
|
56
80
|
const checks = [];
|
|
@@ -131,28 +155,18 @@ export async function runDoctor() {
|
|
|
131
155
|
fix: 'Update Slates (Settings → Check for Updates). The ops that need these will refuse until you do.',
|
|
132
156
|
});
|
|
133
157
|
}
|
|
134
|
-
//
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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));
|
|
158
|
+
// Native skill files are optional with MCP. Inspect both scopes for each client.
|
|
159
|
+
for (const target of skillInstallTargets('both', process.cwd())) {
|
|
160
|
+
const globalTarget = skillInstallTargets(target.client, homedir())[0];
|
|
161
|
+
const state = inspectSkillInstallation([target.path, globalTarget.path]);
|
|
162
|
+
const absent = state.installed === 0;
|
|
149
163
|
checks.push({
|
|
150
|
-
name:
|
|
151
|
-
ok: missing.length
|
|
152
|
-
detail:
|
|
153
|
-
?
|
|
154
|
-
: `${
|
|
155
|
-
fix:
|
|
164
|
+
name: `Agent skills (${target.client})`,
|
|
165
|
+
ok: absent || (!state.missing.length && !state.stale.length),
|
|
166
|
+
detail: absent
|
|
167
|
+
? 'not installed; MCP guides remain available'
|
|
168
|
+
: `${state.installed} of ${Object.keys(SKILLS).length} installed; ${state.missing.length} missing, ${state.stale.length} outdated, ${state.duplicates.length} duplicate names`,
|
|
169
|
+
fix: `Run slates install-skills --client ${target.client}; also add --global if you have a global copy.`,
|
|
156
170
|
});
|
|
157
171
|
}
|
|
158
172
|
// 6. MCP client configs — present is enough; `slates mcp` owns the detail.
|
|
@@ -170,13 +184,18 @@ export async function runDoctor() {
|
|
|
170
184
|
return false;
|
|
171
185
|
}
|
|
172
186
|
});
|
|
187
|
+
const codex = inspectCodexMcpConfig();
|
|
173
188
|
checks.push({
|
|
174
189
|
name: 'MCP client config',
|
|
175
|
-
ok: wired.length > 0,
|
|
176
|
-
detail:
|
|
177
|
-
?
|
|
178
|
-
:
|
|
179
|
-
|
|
190
|
+
ok: codex.configured || wired.length > 0,
|
|
191
|
+
detail: codex.configured
|
|
192
|
+
? 'Slates entry found in Codex config (configuration only; connection checked separately)'
|
|
193
|
+
: wired.length > 0
|
|
194
|
+
? `slates entry found in ${wired.length} of ${mcpConfigs.length} detected JSON config(s)`
|
|
195
|
+
: codex.invalid.length
|
|
196
|
+
? `Codex config could not be parsed: ${codex.invalid.join(', ')}`
|
|
197
|
+
: `${mcpConfigs.length + codex.files.length} client config(s) detected; no enabled Slates entry found`,
|
|
198
|
+
fix: `For Codex, run ${CODEX_MCP_SETUP}; for Claude Desktop or Cursor, run slates mcp --write. Restart the client.`,
|
|
180
199
|
});
|
|
181
200
|
// ── Package version ──
|
|
182
201
|
const version = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'package.json'), 'utf8'));
|
|
@@ -1,6 +1,31 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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,
|
|
4
|
-
import { SKILLS } from '@slatesvideo/shared';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
-
|
|
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
|
package/dist/commands/mcp.js
CHANGED
|
@@ -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
|
|
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,
|
|
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
|
|
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
|
|
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
|
|
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.');
|
package/dist/commands/setup.d.ts
CHANGED
package/dist/commands/setup.js
CHANGED
|
@@ -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.
|
|
8
|
-
//
|
|
9
|
-
// 2. Install the bundled
|
|
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
|
-
//
|
|
14
|
-
//
|
|
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
|
-
//
|
|
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
|
|
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
|
|
85
|
-
.option('--global', 'Install
|
|
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.
|
|
3
|
+
"version": "0.6.2",
|
|
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",
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
"claude",
|
|
40
40
|
"claude-code",
|
|
41
41
|
"agent-skills",
|
|
42
|
-
"veo",
|
|
43
42
|
"kling",
|
|
44
43
|
"seedance"
|
|
45
44
|
],
|
|
@@ -47,7 +46,8 @@
|
|
|
47
46
|
"node": ">=18"
|
|
48
47
|
},
|
|
49
48
|
"dependencies": {
|
|
50
|
-
"@
|
|
49
|
+
"@iarna/toml": "^2.2.5",
|
|
50
|
+
"@slatesvideo/shared": "^0.7.7",
|
|
51
51
|
"commander": "^12.1.0",
|
|
52
52
|
"zod": "^3.23.0"
|
|
53
53
|
},
|