octwin-cli 0.1.0 → 0.1.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 +2 -2
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ octwin validate
|
|
|
32
32
|
|
|
33
33
|
# 4. Log in with a DEPLOY TOKEN from the console (Workspace → API tokens →
|
|
34
34
|
# Generate), then deploy. Point pack.json at your platform + tenant first.
|
|
35
|
-
octwin login --url https://platform.example.com --token
|
|
35
|
+
octwin login --url https://platform.example.com --token oct_…
|
|
36
36
|
octwin whoami --tenant my-tenant
|
|
37
37
|
octwin deploy --tenant my-tenant --project main # add --seed to seed demo data
|
|
38
38
|
|
|
@@ -45,7 +45,7 @@ octwin status --tenant my-tenant --project main
|
|
|
45
45
|
|
|
46
46
|
## Auth — the deploy token
|
|
47
47
|
|
|
48
|
-
You authenticate with a tenant-scoped **deploy token** (`
|
|
48
|
+
You authenticate with a tenant-scoped **deploy token** (`oct_…`), not a password
|
|
49
49
|
and not an operator token. It is least-privilege (scope `pack:deploy`) and
|
|
50
50
|
revocable in the console. Add the **`media:generate`** scope to let a `--seed`
|
|
51
51
|
deploy AI-generate seed images (a demo field `photo: 'generate:<prompt>'`).
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* octwin init <dir> [--id my-pack] [--description "..."] [--display-name "..."]
|
|
11
11
|
* octwin validate [--dir .]
|
|
12
|
-
* octwin login --url <platformUrl> --token
|
|
12
|
+
* octwin login --url <platformUrl> --token oct_…
|
|
13
13
|
* octwin whoami [--url <url>] [--tenant <slug>]
|
|
14
14
|
* octwin deploy [--dir .] [--url <url>] [--tenant <slug>] [--project <slug>] [--token <t>] [--seed]
|
|
15
15
|
* octwin status [--dir .] # did my deploy land? which version is live?
|
|
@@ -193,7 +193,7 @@ function resolveTarget(flags, packDir) {
|
|
|
193
193
|
if (!tenant)
|
|
194
194
|
die('no tenant — set it in pack.json, --tenant, or PACK_TENANT');
|
|
195
195
|
if (!token)
|
|
196
|
-
die('no token — generate a deploy token in the console (Settings → API tokens), then `octwin login --url <url> --token
|
|
196
|
+
die('no token — generate a deploy token in the console (Settings → API tokens), then `octwin login --url <url> --token oct_…` or pass --token');
|
|
197
197
|
return { url, tenant, project, token };
|
|
198
198
|
}
|
|
199
199
|
async function cmdWhoami(flags) {
|
|
@@ -201,7 +201,7 @@ async function cmdWhoami(flags) {
|
|
|
201
201
|
const { url, tenant, token } = resolveTarget(flags, packDir);
|
|
202
202
|
const res = await fetch(`${url}/api/admin/tenants/${tenant}/packs`, { headers: { authorization: `Bearer ${token}` } });
|
|
203
203
|
if (res.ok) {
|
|
204
|
-
console.log(`✓ Token valid for tenant '${tenant}' at ${url} (${token.startsWith('
|
|
204
|
+
console.log(`✓ Token valid for tenant '${tenant}' at ${url} (${token.startsWith('oct_') ? 'deploy token' : 'session token'})`);
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
207
207
|
const why = res.status === 401 ? 'invalid / expired / revoked token'
|
|
@@ -296,7 +296,7 @@ function help() {
|
|
|
296
296
|
|
|
297
297
|
octwin init <dir> [--id my-pack] [--description "..."] [--display-name "..."]
|
|
298
298
|
octwin validate [--dir .]
|
|
299
|
-
octwin login --url <platformUrl> --token
|
|
299
|
+
octwin login --url <platformUrl> --token oct_… # a deploy token from the console
|
|
300
300
|
octwin whoami [--url <url>] [--tenant <slug>] # verify the token works
|
|
301
301
|
octwin deploy [--dir .] [--url <url>] [--tenant <slug>] [--project <slug>] [--token <t>] [--seed]
|
|
302
302
|
octwin status [--dir .] [--url <url>] [--tenant <slug>] [--project <slug>] [--token <t>]
|
package/package.json
CHANGED