@apotech-os/cli 0.5.0-rc.1 → 0.7.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/README.md ADDED
@@ -0,0 +1,95 @@
1
+ # @apotech-os/cli
2
+
3
+ CLI for Wopilo OS apps: scaffold locally, preview the manifest diff against a
4
+ server, and deploy releases.
5
+
6
+ ```sh
7
+ npm install -g @apotech-os/cli
8
+ ```
9
+
10
+ ## Deploy
11
+
12
+ ```sh
13
+ apotech-os deploy --remote production
14
+ ```
15
+
16
+ One command, one version: it builds the artefact, publishes it, and installs it.
17
+ The install is what reconciles the registry (objects, indexes, pages, nav, roles,
18
+ functions) — always from the manifest inside the artefact that was just uploaded,
19
+ so the registry can never advance ahead of the shipped code.
20
+
21
+ Every change needs a `manifest.version` bump. Redeploying an unchanged version
22
+ is refused with `409 VERSION_NOT_INCREASED`; the CLI prints the bump instruction.
23
+
24
+ `--no-install` publishes the artefact without activating it, for CI pipelines
25
+ that gate activation behind a separate approval. If a deploy dies at the install
26
+ step the artefact is already stored but inert — activate it with
27
+ `apotech-os app:install --remote <name> --version <v>` rather than re-running
28
+ `deploy`, which would re-publish and hit the version gate.
29
+
30
+ ## Remotes and login
31
+
32
+ ```sh
33
+ apotech-os remote add --url https://your-server.example.com --as production
34
+ apotech-os login --remote production
35
+ ```
36
+
37
+ `login` starts a browser-based approval (device-code flow): the CLI prints a
38
+ confirmation code and opens the web app, a platform admin checks that the code
39
+ matches and clicks **Autoriser**, and the CLI receives an API key and stores it
40
+ in `~/.wopilo/credentials.json` (mode `0600`).
41
+
42
+ The key is an ordinary platform API key, labelled with the requesting machine
43
+ and revocable at any time under _Paramètres › Clés API_.
44
+
45
+ On a headless machine you can open the printed URL from another device, or skip
46
+ the browser entirely and paste a key you created by hand:
47
+
48
+ ```sh
49
+ apotech-os login --remote production --with-key
50
+ ```
51
+
52
+ Environment variables work too, and take no `--remote`:
53
+
54
+ - `WOPILO_API_URL` — server API root. No `/api` prefix is added automatically.
55
+ - `WOPILO_API_KEY` — Bearer token.
56
+
57
+ ## Commands
58
+
59
+ | Command | What it does |
60
+ | ----------------------------------------------- | ----------------------------------------------------- |
61
+ | `apotech-os deploy --remote <name>` | Build + publish + install — the everyday flow |
62
+ | `apotech-os dev` | Watch and sync the manifest locally (no artefact) |
63
+ | `apotech-os plan --remote <name>` | Diff the local manifest against the server (no write) |
64
+ | `apotech-os app:build --tarball` | Build the artefact into `.wopilo/output/` |
65
+ | `apotech-os app:publish --remote <name>` | Publish a versioned artefact (no install side-effect) |
66
+ | `apotech-os app:install --remote <name>` | Install/upgrade a published version |
67
+ | `apotech-os remote add --url <url> --as <name>` | Register a remote |
68
+ | `apotech-os login --remote <name>` | Obtain and store an API key |
69
+
70
+ `app:upgrade` is an alias of `app:install` — an upgrade is just an install at a
71
+ higher version. `app:build` / `app:publish` / `app:install` are the discrete
72
+ steps `deploy` runs, exposed for CI.
73
+
74
+ ## Migrating from `apply` (0.5.0 — breaking)
75
+
76
+ `apotech-os apply` has been removed in 0.5.0. It reconciled the registry straight
77
+ from the local manifest, ahead of any matching published artefact, so pages could
78
+ be registered whose `dist/ui/*.js` was never uploaded — the runtime then failed
79
+ with _"Failed to fetch dynamically imported module" / "Page introuvable"_.
80
+
81
+ - Replace `apotech-os apply --remote <r>` with `apotech-os deploy --remote <r>`,
82
+ which publishes **and** installs. Install runs the same reconciliation
83
+ server-side, so the schema changes still land.
84
+ - `--force` carries over: `deploy` plans before publishing and refuses a
85
+ destructive change unless you pass `--force`, the same gate `apply` had. The
86
+ plan runs before the upload, so a refusal costs no version number.
87
+ - Bump `manifest.version` for any change — registry and artefact only advance
88
+ together, on one version.
89
+ - `apotech-os app:publish` + `apotech-os app:install` remain available as
90
+ discrete CI steps.
91
+ - `apotech-os plan` is unchanged: still the read-only dry-run diff.
92
+ - `apotech-os --version` now reports the real package version (it was hardcoded
93
+ to `0.1.0` regardless of the installed build).
94
+
95
+ See `docs/app-platform/app-developer-guide.md` in the repo for the full guide.