@slatesvideo/cli 0.5.19 → 0.5.21

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 -->92<!-- /gen:tool-count --> tool schemas into context.
4
4
 
5
5
  ## Install
6
6
 
@@ -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('---'))
@@ -148,8 +148,21 @@ export async function runDoctor() {
148
148
  : `${mcpConfigs.length} client config(s) detected, none mentions slates`,
149
149
  fix: 'Run `slates mcp --write` (or `slates setup`), then restart the client.',
150
150
  });
151
- // ── Report ──
151
+ // ── Package version ──
152
152
  const version = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'package.json'), 'utf8'));
153
+ const latest = await refreshLatestVersion('@slatesvideo/cli');
154
+ const behind = latest !== null && compareVersions(version.version, latest) < 0;
155
+ checks.push({
156
+ name: 'CLI version',
157
+ ok: !behind,
158
+ detail: latest === null
159
+ ? `v${version.version} installed; registry unreachable, could not compare`
160
+ : behind
161
+ ? `v${version.version} installed, v${latest} published`
162
+ : `v${version.version} is the latest`,
163
+ fix: 'Run `npm i -g @slatesvideo/cli@latest`, then `slates install-skills` to refresh skill files.',
164
+ });
165
+ // ── Report ──
153
166
  console.log(`slates doctor — CLI v${version.version}\n`);
154
167
  for (const c of checks) {
155
168
  console.log(`${c.ok ? ' ok ' : ' ✗ '}${c.name}: ${c.detail}`);
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';
@@ -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).')
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@slatesvideo/cli",
3
- "version": "0.5.19",
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.5.21",
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.9",
50
+ "@slatesvideo/shared": "^0.6.11",
51
51
  "commander": "^12.1.0",
52
52
  "zod": "^3.23.0"
53
53
  },