octwin-cli 0.1.21 → 0.3.0
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/CHANGELOG.md +432 -350
- package/README.md +210 -188
- package/dist/index.js +1053 -91
- package/dist/lib/args-check.js +27 -10
- package/dist/lib/kb-path.js +76 -0
- package/dist/lib/page.js +61 -0
- package/dist/lib/render-check.js +20 -8
- package/dist/lib/validate.js +11 -2
- package/package.json +37 -37
- package/templates/starter/manifest.yaml +55 -54
package/README.md
CHANGED
|
@@ -1,188 +1,210 @@
|
|
|
1
|
-
# octwin-cli
|
|
2
|
-
|
|
3
|
-
> The **Octwin** external-pack developer CLI — scaffold, validate, deploy, and manage pure-YAML packs on your own tenant. By **CEQUENS**.
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/octwin-cli)
|
|
6
|
-
[](https://www.npmjs.com/package/octwin-cli)
|
|
7
|
-
[](https://nodejs.org)
|
|
8
|
-
|
|
9
|
-
Octwin is a pack-pluggable conversational-agent platform for WhatsApp and web. A **pack** is a
|
|
10
|
-
self-contained bot domain — its agent, conversation flows, prompts, and data model — declared
|
|
11
|
-
entirely in YAML. `octwin-cli` lets you build a **pure-YAML pack** in your own repo and deploy it
|
|
12
|
-
to a running Octwin platform to test live on your own tenant: no platform checkout, no build step,
|
|
13
|
-
and nothing untrusted to run (a pure-YAML pack is declarative data, so the platform can safely run
|
|
14
|
-
it alongside other tenants).
|
|
15
|
-
|
|
16
|
-
> The npm package is **`octwin-cli`**; the command it installs is **`octwin`**.
|
|
17
|
-
|
|
18
|
-
## Requirements
|
|
19
|
-
|
|
20
|
-
- **Node.js ≥ 20**
|
|
21
|
-
- Access to an **Octwin platform** (its base URL), a **tenant** (your workspace) on it, and a
|
|
22
|
-
**deploy token** (generated in the Octwin console — see [Authentication](#authentication)).
|
|
23
|
-
|
|
24
|
-
## Install
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
# zero-install — always the latest version
|
|
28
|
-
npx octwin-cli@latest <command>
|
|
29
|
-
|
|
30
|
-
# …or install the `octwin` command globally
|
|
31
|
-
npm install -g octwin-cli
|
|
32
|
-
octwin <command>
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Quick start
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
# 1. Scaffold a standalone pure-YAML pack (this is your repo)
|
|
39
|
-
octwin init ./my-pack --id my-pack --description "My business bot"
|
|
40
|
-
cd ./my-pack
|
|
41
|
-
git init && git add -A && git commit -m "init pack"
|
|
42
|
-
|
|
43
|
-
# 2. Author it — edit manifest.yaml, flows/tools/main.flow.yaml (+ its locale),
|
|
44
|
-
# and prompts/identity.md. Everything is pure YAML.
|
|
45
|
-
|
|
46
|
-
# 3. Point it at your platform — one command, no config file
|
|
47
|
-
# (Octwin console → your workspace → API tokens → Generate)
|
|
48
|
-
octwin login --url https://your-octwin.example.com --token oct_…
|
|
49
|
-
|
|
50
|
-
# 4. Validate → deploy → confirm it's live
|
|
51
|
-
octwin validate
|
|
52
|
-
octwin deploy --seed # --seed also loads any demo data the pack declares
|
|
53
|
-
octwin status # "✓ live and current" once it's warm
|
|
54
|
-
|
|
55
|
-
# 5. Chat with it on your tenant (web widget / console test page). Edit and
|
|
56
|
-
# `octwin deploy` again — a redeploy hot-loads with no restart.
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## Commands
|
|
60
|
-
|
|
61
|
-
| Command | What it does |
|
|
62
|
-
| --- | --- |
|
|
63
|
-
| `octwin init <dir>` | Scaffold a new pure-YAML pack into `<dir>` (writes a starter `manifest.yaml`, flow, prompt, `.gitignore` and `README.md` — pack content only). Options: `--id`, `--description`, `--display-name`. |
|
|
64
|
-
| `octwin validate` | Check the pack locally (structure + pure-YAML rules).
|
|
65
|
-
| `octwin login` | Save a deploy token for a platform URL **and make that URL the default target** (both stored in `~/.octwin/credentials.json`). `--url`, `--token`. |
|
|
66
|
-
| `octwin whoami` | Verify the saved/passed token is valid for a tenant. `--url`, `--tenant`. |
|
|
67
|
-
| `octwin deploy` | Upload + install the pack onto your tenant's project. `--seed` also runs the pack's demo seed. Reports the **marketplace-listing verdict** when the manifest carries `listing.public: true`. |
|
|
68
|
-
| `octwin status` | Report what the platform has live for this pack — installed version, the **content sha** the instance loaded vs. the one the catalog holds (a redeploy of the *same* version changes it), its flows, and whether it is live on the public marketplace. |
|
|
69
|
-
| `octwin pull <packId>` | Write a **deployed** pack's source back to disk — the inverse of `deploy`, and how a pack pushed from one machine is recovered. Defaults to the version installed on the target project; `--version` overrides, `--dir` defaults to `./<packId>`, a non-empty dir needs `--force`. You may pull a pack your tenant **owns**. |
|
|
70
|
-
| `octwin chat "msg"` | Drive a turn through the dev web channel and print **every render with its tap ids**. `--as <handle>` picks the test user; `--tap "<tap-id>"` presses a rendered button/list row; `--json` dumps the raw envelopes. |
|
|
71
|
-
| `octwin logs` | List recent conversations (handle, status, last activity; `--as` filters), or show one conversation's full event timeline — including what each turn rendered. `--json` for raw payloads. |
|
|
72
|
-
| `octwin records` | Inspect the pack's XRM data (needs a `records:read` token). No args = list entities. |
|
|
73
|
-
| `octwin cases` | Inspect casework (support tickets): the inbox, one case + its timeline and decisions, or `--queues` for queue keys + open counts. |
|
|
74
|
-
| `octwin
|
|
75
|
-
| `octwin
|
|
76
|
-
| `octwin
|
|
77
|
-
| `octwin
|
|
78
|
-
| `octwin
|
|
79
|
-
| `octwin
|
|
80
|
-
| `octwin
|
|
81
|
-
| `octwin
|
|
82
|
-
| `octwin
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
octwin
|
|
95
|
-
octwin
|
|
96
|
-
octwin
|
|
97
|
-
octwin
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
octwin
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
##
|
|
181
|
-
|
|
182
|
-
- **
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
1
|
+
# octwin-cli
|
|
2
|
+
|
|
3
|
+
> The **Octwin** external-pack developer CLI — scaffold, validate, deploy, and manage pure-YAML packs on your own tenant. By **CEQUENS**.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/octwin-cli)
|
|
6
|
+
[](https://www.npmjs.com/package/octwin-cli)
|
|
7
|
+
[](https://nodejs.org)
|
|
8
|
+
|
|
9
|
+
Octwin is a pack-pluggable conversational-agent platform for WhatsApp and web. A **pack** is a
|
|
10
|
+
self-contained bot domain — its agent, conversation flows, prompts, and data model — declared
|
|
11
|
+
entirely in YAML. `octwin-cli` lets you build a **pure-YAML pack** in your own repo and deploy it
|
|
12
|
+
to a running Octwin platform to test live on your own tenant: no platform checkout, no build step,
|
|
13
|
+
and nothing untrusted to run (a pure-YAML pack is declarative data, so the platform can safely run
|
|
14
|
+
it alongside other tenants).
|
|
15
|
+
|
|
16
|
+
> The npm package is **`octwin-cli`**; the command it installs is **`octwin`**.
|
|
17
|
+
|
|
18
|
+
## Requirements
|
|
19
|
+
|
|
20
|
+
- **Node.js ≥ 20**
|
|
21
|
+
- Access to an **Octwin platform** (its base URL), a **tenant** (your workspace) on it, and a
|
|
22
|
+
**deploy token** (generated in the Octwin console — see [Authentication](#authentication)).
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# zero-install — always the latest version
|
|
28
|
+
npx octwin-cli@latest <command>
|
|
29
|
+
|
|
30
|
+
# …or install the `octwin` command globally
|
|
31
|
+
npm install -g octwin-cli
|
|
32
|
+
octwin <command>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Quick start
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# 1. Scaffold a standalone pure-YAML pack (this is your repo)
|
|
39
|
+
octwin init ./my-pack --id my-pack --description "My business bot"
|
|
40
|
+
cd ./my-pack
|
|
41
|
+
git init && git add -A && git commit -m "init pack"
|
|
42
|
+
|
|
43
|
+
# 2. Author it — edit manifest.yaml, flows/tools/main.flow.yaml (+ its locale),
|
|
44
|
+
# and prompts/identity.md. Everything is pure YAML.
|
|
45
|
+
|
|
46
|
+
# 3. Point it at your platform — one command, no config file
|
|
47
|
+
# (Octwin console → your workspace → API tokens → Generate)
|
|
48
|
+
octwin login --url https://your-octwin.example.com --token oct_…
|
|
49
|
+
|
|
50
|
+
# 4. Validate → deploy → confirm it's live
|
|
51
|
+
octwin validate
|
|
52
|
+
octwin deploy --seed # --seed also loads any demo data the pack declares
|
|
53
|
+
octwin status # "✓ live and current" once it's warm
|
|
54
|
+
|
|
55
|
+
# 5. Chat with it on your tenant (web widget / console test page). Edit and
|
|
56
|
+
# `octwin deploy` again — a redeploy hot-loads with no restart.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Commands
|
|
60
|
+
|
|
61
|
+
| Command | What it does |
|
|
62
|
+
| --- | --- |
|
|
63
|
+
| `octwin init <dir>` | Scaffold a new pure-YAML pack into `<dir>` (writes a starter `manifest.yaml`, flow, prompt, `.gitignore` and `README.md` — pack content only). Options: `--id`, `--description`, `--display-name`. |
|
|
64
|
+
| `octwin validate` | Check the pack locally (structure + pure-YAML rules). `--remote` additionally runs the platform's **flow lint** — conventions the schema can't express, like an `assign:` whose value is a quoted literal, or a `$t()` key with no namespace. The lint needs a template-expanded `FlowDef`, which only the server builds, so it is a `--remote`-only check; a local ✓ does not cover it. |
|
|
65
|
+
| `octwin login` | Save a deploy token for a platform URL **and make that URL the default target** (both stored in `~/.octwin/credentials.json`). `--url`, `--token`. |
|
|
66
|
+
| `octwin whoami` | Verify the saved/passed token is valid for a tenant. `--url`, `--tenant`. |
|
|
67
|
+
| `octwin deploy` | Upload + install the pack onto your tenant's project. `--seed` also runs the pack's demo seed. Reports the **marketplace-listing verdict** when the manifest carries `listing.public: true`. |
|
|
68
|
+
| `octwin status` | Report what the platform has live for this pack — installed version, the **content sha** the instance loaded vs. the one the catalog holds (a redeploy of the *same* version changes it), its flows, and whether it is live on the public marketplace. |
|
|
69
|
+
| `octwin pull <packId>` | Write a **deployed** pack's source back to disk — the inverse of `deploy`, and how a pack pushed from one machine is recovered. Defaults to the version installed on the target project; `--version` overrides, `--dir` defaults to `./<packId>`, a non-empty dir needs `--force`. You may pull a pack your tenant **owns**. |
|
|
70
|
+
| `octwin chat "msg"` | Drive a turn through the dev web channel and print **every render with its tap ids**. `--as <handle>` picks the test user; `--tap "<tap-id>"` presses a rendered button/list row; `--json` dumps the raw envelopes. |
|
|
71
|
+
| `octwin logs` | List recent conversations (handle, status, last activity; `--as` filters), or show one conversation's full event timeline — including what each turn rendered. `--json` for raw payloads. |
|
|
72
|
+
| `octwin records` | Inspect the pack's XRM data (needs a `records:read` token). No args = list entities. |
|
|
73
|
+
| `octwin cases` | Inspect casework (support tickets): the inbox, one case + its timeline and decisions, or `--queues` for queue keys + open counts. |
|
|
74
|
+
| `octwin projects` | The `--project <slug>` values this token can name, with the plan's project cap. `--archived` includes archived ones. A `pack:deploy` token reaches it — it names a project in every other command, so this turns "guess the slug" into "read the list". |
|
|
75
|
+
| `octwin agents` | The agent roster with each agent's **effective** model / history window and **which layer set it** (project override → platform default → pack manifest) — an operator platform default can override what your manifest declares. `--prompt` prints the exact system prompt the LLM sees. Needs `agents:read`. |
|
|
76
|
+
| `octwin orders` | The orders a conversation produced. No args = the list; with a `reference_id` = line items, the subtotal/tax/shipping/discount/total breakdown, `payment_ref`, and the allowed transitions. Needs `orders:read` + the `orders` plan feature. |
|
|
77
|
+
| `octwin analytics` | Stage-by-stage conversion for **any** entity declared with a `pipeline:` (`--overview` / `--milestones` / `--trends` / `--cost`; `--stage <id>` lists the records currently at a stage). Needs `records:read`. |
|
|
78
|
+
| `octwin catalog` | Commerce products with price / availability / stock, plus the WhatsApp catalog binding. `--readiness` runs the Meta Graph checklist. Needs `catalog:read` + the `catalog` plan feature. |
|
|
79
|
+
| `octwin scheduling` | The scheduling engine's state, or `--slots <resourceRecordId>` for the slots one bookable resource actually computes — how you verify the availability rules `deploy --seed` created. Needs `scheduling:read`. |
|
|
80
|
+
| `octwin media generate "<prompt>"` | AI-generate an image, store it as a public asset, and print its `MEDIA-` handle + serve URL. `--out` downloads the bytes (WhatsApp renders only `.png`/`.jpg`); `--size`; `--json`. Pairs with `octwin chat --media` to drive media-collect flows. Needs `media:generate`. |
|
|
81
|
+
| `octwin platform-kb pull` | Pull the platform's capability reference into `.octwin/platform-kb/` for the **`octwin-pack`** Claude Code authoring plugin: guides as markdown, plus **one JSON file per capability** (`primitives/record_list.json`, `render-intents/carousel.json`, `declarations/xrm.json`, …) and an **`INDEX.md`** mapping every entry to its file — so a lookup is a small targeted read, not a whole catalog. |
|
|
82
|
+
| `octwin test` | Alias for `octwin validate --remote` — the platform's full manifest + flow-DSL check. |
|
|
83
|
+
| `octwin feedback` | Submit this pack's `FEEDBACK.md` to the platform team, with the pack version, your CLI version and the `content_hash` of the capability reference you pulled — the two facts that separate a real platform gap from something already fixed or a stale KB. |
|
|
84
|
+
| `octwin help` | Show usage. Every subcommand also answers `--help`. |
|
|
85
|
+
|
|
86
|
+
### Writing, not just reading
|
|
87
|
+
|
|
88
|
+
Every read command above has a write half behind a **leading verb**, so `octwin cases` reads and
|
|
89
|
+
`octwin cases note <id> "…"` writes. Each needs the matching `:write` scope — `octwin <cmd> --help`
|
|
90
|
+
lists the verbs and their exact flags.
|
|
91
|
+
|
|
92
|
+
| Command | Verbs |
|
|
93
|
+
| --- | --- |
|
|
94
|
+
| `octwin records` | `create <entity> --set k=v` · `patch <id> --entity <e>` · `stage <id> --to <s>` · `note <id> "…"` · `tasks` · `task complete <id>` |
|
|
95
|
+
| `octwin cases` | `assign <id> --to user:<uuid>\|none` · `note` · `transition <id> --to <status>` · `decide <id> --action <a> [--dry-run]` |
|
|
96
|
+
| `octwin orders` | `transition <ref> --to <status>` · `refund <ref> --force` |
|
|
97
|
+
| `octwin catalog` | `availability <sku> --to "in stock"` · `stock <sku> [--set-on-hand n]` |
|
|
98
|
+
| `octwin scheduling` | `rules --resource <id>` · `rule add\|rm` · `exception add\|rm` |
|
|
99
|
+
| `octwin agents` | `set <ref> [--model m] [--enable-tool t] [--disable-tool t]` |
|
|
100
|
+
|
|
101
|
+
`--set k=v` coerces JSON scalars (`--set rating=4.5` sends a number); `--fields-json` takes anything
|
|
102
|
+
nested. Destructive verbs want `--force` rather than a prompt — the CLI is non-interactive by
|
|
103
|
+
design. `cases decide --dry-run` previews the customer-facing copy and the resulting status without
|
|
104
|
+
committing, and needs only `cases:read`.
|
|
105
|
+
|
|
106
|
+
Every command that talks to the platform accepts `--dir <path>` (the pack directory; defaults to
|
|
107
|
+
the current directory) plus the target overrides `--url` / `--tenant` / `--project` / `--token`.
|
|
108
|
+
|
|
109
|
+
### Debugging a live conversation
|
|
110
|
+
|
|
111
|
+
The platform keeps **one open conversation per `--as` handle**, so consecutive `octwin chat` calls
|
|
112
|
+
with the same handle **continue the same conversation** — agent memory, suspended flows, and all:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
octwin chat "hi" --as tester1 # turn 1 — prints the menu with each row's tap id
|
|
116
|
+
octwin chat --tap "t:invoke:my-flow:x=1" --as tester1 # turn 2 — press a rendered row
|
|
117
|
+
octwin chat "3 bedrooms" --as tester1 # turn 3 — free text into the running flow
|
|
118
|
+
octwin logs --as tester1 # find the conversation, then:
|
|
119
|
+
octwin logs <conversationId> # the full timeline (taps, renders, tool events)
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Reading back the state your pack created
|
|
123
|
+
|
|
124
|
+
`chat`/`logs` show what the bot *said*; these show what it *did*. A 401/403 on any of them names the
|
|
125
|
+
token scope (and plan feature) that command needs, so you can mint a wider token instead of guessing.
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
octwin agents # effective model per agent + which layer set it
|
|
129
|
+
octwin agents my-pack::assistant --prompt # the exact system prompt the LLM sees
|
|
130
|
+
octwin orders # then: octwin orders <reference_id>
|
|
131
|
+
octwin analytics # then: octwin analytics <entity> [--stage <id>]
|
|
132
|
+
octwin catalog # products + stock + the WhatsApp binding
|
|
133
|
+
octwin scheduling --slots <resourceRecordId> # the slots your availability rules compute
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Three things worth knowing when you read the output:
|
|
137
|
+
|
|
138
|
+
- **A `pending` payment is usually correct.** The forward payment lifecycle is **webhook-owned**, and a
|
|
139
|
+
workspace with no gateway runs the credential-free `manual` driver — so `payment_request` takes its
|
|
140
|
+
`empty` port and your flow should confirm pay-on-delivery. `octwin orders <ref>` says this inline.
|
|
141
|
+
- **Your declared model may not be the one running.** An operator platform default overrides the pack
|
|
142
|
+
manifest; `octwin agents` is where that becomes visible.
|
|
143
|
+
- **An empty funnel has two causes** — the entity has no `pipeline:`, or your token's role has no `view`
|
|
144
|
+
grant on `record.<entity>`. The command prints both rather than a bare "no data".
|
|
145
|
+
|
|
146
|
+
## Configuration
|
|
147
|
+
|
|
148
|
+
**`octwin login` is the configuration.** There is no config file in your pack — a pack directory
|
|
149
|
+
holds pack content and nothing else, so the same repo deploys from any machine:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
octwin login --url https://your-octwin.example.com --token oct_…
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
That stores the token *and* makes the URL your default target, in `~/.octwin/credentials.json`:
|
|
156
|
+
|
|
157
|
+
```jsonc
|
|
158
|
+
{
|
|
159
|
+
"default_url": "https://your-octwin.example.com", // set by the last `octwin login`
|
|
160
|
+
"https://your-octwin.example.com": "oct_…" // token, keyed by platform url
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Tenant and project need no setting at all — the **token carries its own tenant**, plus an optional
|
|
165
|
+
project pin. `--tenant` / `--project` exist only as overrides (a multi-workspace human, or an
|
|
166
|
+
unpinned token that must name a project).
|
|
167
|
+
|
|
168
|
+
Each setting resolves **flag → environment variable → saved login**:
|
|
169
|
+
|
|
170
|
+
| Setting | Flag | Env var | Saved login |
|
|
171
|
+
| --- | --- | --- | --- |
|
|
172
|
+
| Platform URL | `--url` | `PACK_PLATFORM_URL` | `default_url` |
|
|
173
|
+
| Deploy token | `--token` | `PACK_TOKEN` | token for that URL |
|
|
174
|
+
| Tenant slug *(override)* | `--tenant` | `PACK_TENANT` | — *(from the token)* |
|
|
175
|
+
| Project slug *(override)* | `--project` | `PACK_PROJECT` | — *(from the token's pin)* |
|
|
176
|
+
|
|
177
|
+
For **CI**, skip `login` entirely and pass `PACK_PLATFORM_URL` + `PACK_TOKEN` as environment
|
|
178
|
+
variables (add `PACK_PROJECT` only if the token isn't pinned).
|
|
179
|
+
|
|
180
|
+
## Authentication
|
|
181
|
+
|
|
182
|
+
You authenticate with a tenant-scoped **deploy token** (prefixed `oct_…`) — not a password and not
|
|
183
|
+
an operator token. Generate it in the Octwin console (**your workspace → API tokens → Generate**).
|
|
184
|
+
It is **least-privilege** (scope `pack:deploy`): it can deploy packs to your tenant but cannot
|
|
185
|
+
manage members, billing, or other tenants, and it is revocable at any time.
|
|
186
|
+
|
|
187
|
+
Add the optional **`media:generate`** scope to let a `--seed` deploy AI-generate seed images
|
|
188
|
+
(for a demo record field like `photo: "generate:<prompt>"`); without it, such fields are seeded as
|
|
189
|
+
text only.
|
|
190
|
+
|
|
191
|
+
## What a pack may contain
|
|
192
|
+
|
|
193
|
+
A pack is **pure declarative data** — `.yaml` / `.yml` / `.md` / `.sql` / `.json` only. Executable
|
|
194
|
+
code (`.ts`/`.js`), HTTP routes, DB clients, and custom primitives are **not** allowed (this is what
|
|
195
|
+
makes an external pack safe to run on a shared platform; the server enforces it on deploy). For
|
|
196
|
+
domain records, use Octwin's first-class storage modules — **XRM** (records with stage pipelines),
|
|
197
|
+
**catalog** (products), or **casework** (tickets) — declared in `xrm.yaml` and `worklist.yaml`, so a
|
|
198
|
+
pack needs **no database of its own**. (Casework rides `worklist.yaml`'s `work.<entity>` block;
|
|
199
|
+
there is no ~~`cases.yaml`~~ grammar. `octwin platform-kb pull` ships the authoritative list of
|
|
200
|
+
declaration files — read its `INDEX.md` rather than this paragraph.)
|
|
201
|
+
|
|
202
|
+
## Links
|
|
203
|
+
|
|
204
|
+
- **npm:** <https://www.npmjs.com/package/octwin-cli>
|
|
205
|
+
- **Command help:** `octwin help` (each subcommand also answers `--help`)
|
|
206
|
+
- **Changelog:** [CHANGELOG.md](./CHANGELOG.md)
|
|
207
|
+
|
|
208
|
+
## License
|
|
209
|
+
|
|
210
|
+
[MIT](./LICENSE) © CEQUENS
|