@slatesvideo/cli 0.6.7 → 0.6.9
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 +1 -1
- package/dist/commands/login.d.ts +1 -1
- package/dist/commands/login.js +15 -10
- package/dist/commands/op.js +1 -1
- package/dist/index.js +2 -19
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Requires Node.js 18+ and the Slates desktop app ([slates.video](https://slates.v
|
|
|
14
14
|
|
|
15
15
|
| Command | What it does |
|
|
16
16
|
|---|---|
|
|
17
|
-
| `slates login` | Authorize this machine via magic link (or `--token slates_sk_...`) |
|
|
17
|
+
| `slates login` | Authorize this machine via magic link (or `--token-stdin` to pipe in a `slates_sk_...` key) |
|
|
18
18
|
| `slates logout` | Clear the stored cloud token |
|
|
19
19
|
| `slates status` | Show connection state, account, and credit balance |
|
|
20
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) |
|
package/dist/commands/login.d.ts
CHANGED
package/dist/commands/login.js
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import { setCloudToken } from '@slatesvideo/shared';
|
|
1
|
+
import { DEFAULT_CLOUD_BASE_URL as CLOUD_BASE_URL, setCloudToken } from '@slatesvideo/shared';
|
|
2
2
|
import { promptInput } from '../util/prompt.js';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
async function readStdin() {
|
|
4
|
+
let text = '';
|
|
5
|
+
for await (const chunk of process.stdin)
|
|
6
|
+
text += chunk;
|
|
7
|
+
return text;
|
|
8
|
+
}
|
|
5
9
|
export async function runLogin(opts) {
|
|
6
|
-
// Manual
|
|
7
|
-
//
|
|
8
|
-
if (opts.
|
|
9
|
-
|
|
10
|
+
// Manual path, for a key minted on the web UI or for CI. Read from stdin: an
|
|
11
|
+
// argument sits in the process list and the shell history.
|
|
12
|
+
if (opts.tokenStdin) {
|
|
13
|
+
const token = (await readStdin()).trim();
|
|
14
|
+
if (!token.startsWith('slates_sk_')) {
|
|
10
15
|
console.error('Token must start with slates_sk_. Aborting.');
|
|
11
16
|
process.exit(1);
|
|
12
17
|
}
|
|
13
|
-
setCloudToken(
|
|
18
|
+
setCloudToken(token);
|
|
14
19
|
console.log('Cloud token saved. You\'re logged in.');
|
|
15
20
|
return;
|
|
16
21
|
}
|
|
@@ -33,10 +38,10 @@ export async function runLogin(opts) {
|
|
|
33
38
|
}
|
|
34
39
|
console.log(`\nA sign-in link is on its way to ${trimmed}.`);
|
|
35
40
|
// Newer slates-api versions return a short user code (e.g. XK4-P2N) that
|
|
36
|
-
// the authorization page
|
|
41
|
+
// the authorization page makes the user type — anti-phishing pairing.
|
|
37
42
|
// Older servers omit the field; show nothing in that case.
|
|
38
43
|
if (reqBody.userCode) {
|
|
39
|
-
console.log(`
|
|
44
|
+
console.log(`Type this code on the authorization page: ${reqBody.userCode}`);
|
|
40
45
|
}
|
|
41
46
|
console.log('Click the link, then return here. Waiting (10 min max)...\n');
|
|
42
47
|
const start = Date.now();
|
package/dist/commands/op.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ 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';
|
|
6
|
-
import {
|
|
6
|
+
import { clearCloudToken, refreshLatestVersion, updateNotice, setDesktopClientIdentity } 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';
|
|
@@ -59,7 +59,7 @@ program
|
|
|
59
59
|
.description('Authorize this CLI to use your Slates account (magic link).')
|
|
60
60
|
.option('--email <email>', 'Slates account email (otherwise prompted)')
|
|
61
61
|
.option('--client-name <name>', 'Label this connection (shows in Slates Settings)', 'Slates CLI')
|
|
62
|
-
.option('--token
|
|
62
|
+
.option('--token-stdin', 'Skip the magic-link flow and read a slates_sk_ token from stdin.')
|
|
63
63
|
.action((opts) => runLogin(opts));
|
|
64
64
|
program
|
|
65
65
|
.command('logout')
|
|
@@ -172,24 +172,7 @@ program
|
|
|
172
172
|
saveImages: valueOf('save-images') ?? options.saveImages,
|
|
173
173
|
});
|
|
174
174
|
});
|
|
175
|
-
// Hidden helper for skills that just need the cloud token.
|
|
176
|
-
program
|
|
177
|
-
.command('print-cloud-token', { hidden: true })
|
|
178
|
-
.action(() => {
|
|
179
|
-
const c = readConnection();
|
|
180
|
-
if (!c.cloud.token) {
|
|
181
|
-
console.error('No cloud token. Run `slates login`.');
|
|
182
|
-
process.exit(1);
|
|
183
|
-
}
|
|
184
|
-
process.stdout.write(c.cloud.token);
|
|
185
|
-
});
|
|
186
175
|
// Hidden helper for tests / scripting.
|
|
187
|
-
program
|
|
188
|
-
.command('set-cloud-token <token>', { hidden: true })
|
|
189
|
-
.action((token) => {
|
|
190
|
-
setCloudToken(token);
|
|
191
|
-
console.log('Cloud token written.');
|
|
192
|
-
});
|
|
193
176
|
program
|
|
194
177
|
.command('clear-cloud-token', { hidden: true })
|
|
195
178
|
.action(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slatesvideo/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.9",
|
|
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,9 +47,9 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@iarna/toml": "^2.2.5",
|
|
50
|
-
"@slatesvideo/shared": "^0.7.
|
|
50
|
+
"@slatesvideo/shared": "^0.7.15",
|
|
51
51
|
"commander": "^12.1.0",
|
|
52
|
-
"zod": "^
|
|
52
|
+
"zod": "^4.6.7"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/node": "^20.0.0",
|