@siteoshq/cli 1.0.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,190 @@
1
+ # SiteOS CLI
2
+
3
+ `@siteoshq/cli` is the single command-line client for SiteOS Auth, Pulse, Forms, and Search. The
4
+ package exposes one binary, `siteos`, and starts its public release line at `1.0.0`.
5
+
6
+ ## Install
7
+
8
+ Run without installing:
9
+
10
+ ```sh
11
+ npx @siteoshq/cli --help
12
+ ```
13
+
14
+ Or install the binary globally:
15
+
16
+ ```sh
17
+ npm install --global @siteoshq/cli
18
+ siteos --version
19
+ ```
20
+
21
+ Node.js 22 or newer is required.
22
+
23
+ ## Authenticate
24
+
25
+ The CLI authenticates once with central SiteOS Auth. Auth owns the user session and Organization
26
+ selection; each product still owns its own Projects.
27
+
28
+ ```sh
29
+ siteos auth start --email developer@example.com --json
30
+ siteos auth complete --token <one-time-token> --json
31
+ siteos auth organizations --json
32
+ siteos auth select --organization <organization-id> --json
33
+ siteos auth status --json
34
+ ```
35
+
36
+ The one-time token is secret and should only be passed to `auth complete`. The durable session is
37
+ stored privately in `~/.siteos/auth.json`. Product commands exchange it for a short-lived,
38
+ audience-bound service grant; the durable session is never sent to Pulse, Forms, or Search.
39
+
40
+ ## Select product Projects
41
+
42
+ There is no global SiteOS Project. Pulse, Forms, and Search each create and authorize their own
43
+ Projects inside the selected Auth Organization.
44
+
45
+ ```sh
46
+ siteos pulse project list --json
47
+ siteos pulse project create --slug storefront --name "Storefront" --json
48
+ siteos pulse project use storefront --json
49
+
50
+ siteos forms project list --json
51
+ siteos forms project create --slug storefront-forms --name "Storefront Forms" --json
52
+ siteos forms project use storefront-forms --json
53
+
54
+ siteos search project list --json
55
+ siteos search project create --slug storefront-search --name "Storefront Search" --json
56
+ siteos search project use storefront-search --json
57
+ ```
58
+
59
+ Creating or selecting a Project in one service never creates, selects, links, or mutates a Project
60
+ in another service. `project use` writes a secret-free product reference into the repository and a
61
+ private immutable-ID binding into `~/.siteos/project-bindings.json`.
62
+
63
+ Tracked repository files:
64
+
65
+ | Service | File | Purpose |
66
+ | --- | --- | --- |
67
+ | Pulse | `siteos.config.json` | Project slug and versioned Playwright Check configuration |
68
+ | Forms | `.siteos/forms/project.json` | Forms Project name and slug, schema version 1 |
69
+ | Search | `.siteos/search/project.json` | Search Project name and slug, schema version 1 |
70
+
71
+ Private CLI files:
72
+
73
+ | File | Purpose |
74
+ | --- | --- |
75
+ | `~/.siteos/auth.json` | Central Auth session and selected Organization |
76
+ | `~/.siteos/project-bindings.json` | Version 1 bindings keyed by service, API origin, and real repository path |
77
+
78
+ Set `SITEOS_HOME` to place both private files in another directory. Writes are atomic and preserve
79
+ private file permissions. Do not commit either private file.
80
+
81
+ ## Pulse
82
+
83
+ Initialize a Playwright monitoring project, validate it locally, and deploy an immutable bundle:
84
+
85
+ ```sh
86
+ siteos pulse init --project storefront --base-url https://example.com
87
+ siteos pulse project create --slug storefront --name "Storefront" --json
88
+ siteos pulse project use storefront --json
89
+ siteos pulse validate --json
90
+ siteos pulse test
91
+ siteos pulse deploy --dry-run --json
92
+ siteos pulse deploy --json
93
+ ```
94
+
95
+ `deploy --dry-run` builds the same versioned JSON manifest and archive without requiring Auth or
96
+ uploading data. A normal deploy requires an explicit Pulse binding for the current repository and
97
+ uses the bound immutable Project ID. Use `SITEOS_PULSE_API_URL` to override the Pulse origin; the
98
+ default is `https://siteos-pulse.xui.se`.
99
+
100
+ ## Forms
101
+
102
+ After selecting a Forms Project, manage its Environments, definitions, and scoped credentials:
103
+
104
+ ```sh
105
+ siteos forms environment create --slug production --name "Production" --json
106
+ siteos forms definition check --manifest .siteos/forms/manifest.json --json
107
+ siteos forms definition sync --environment production --manifest .siteos/forms/manifest.json --json
108
+ siteos forms credential issue --environment production --install --json
109
+ ```
110
+
111
+ `definition check` is local and does not need Auth. Management commands obtain a short-lived Forms
112
+ service grant. `credential issue --install` writes the scoped runtime credential to the repository
113
+ `.env` without printing its value. `forms submit` reads `SITEOS_FORMS_SUBMISSION_CREDENTIAL` and
114
+ does not reuse management authority.
115
+
116
+ Use `SITEOS_FORMS_PUBLIC_URL` to override the Forms origin. The development default is
117
+ `http://localhost:3070`.
118
+
119
+ ## Search
120
+
121
+ After selecting a Search Project, manage explicit Environments and separate query/indexing
122
+ credentials:
123
+
124
+ ```sh
125
+ siteos search environment create --slug production --name "Production" --json
126
+ siteos search diagnostics --environment production --json
127
+ siteos search credential issue --environment production --install --json
128
+ siteos search indexing-credential issue --environment production --install --json
129
+ ```
130
+
131
+ Installed query and indexing credentials remain separate. The CLI writes the appropriate
132
+ `SITEOS_SEARCH_TOKEN`, `SITEOS_SEARCH_INDEXING_CREDENTIAL`, `SITEOS_SEARCH_ENV`, and
133
+ `SITEOS_SEARCH_PUBLIC_URL` assignments without printing credential values.
134
+
135
+ Use `SITEOS_SEARCH_PUBLIC_URL` to override the Search origin. The development default is
136
+ `http://localhost:3080`.
137
+
138
+ ## Local diagnostics
139
+
140
+ ```sh
141
+ siteos health-check --json
142
+ ```
143
+
144
+ The health check is read-only. It reports the CLI version, private configuration home, repository
145
+ discovery, and the status of each product-owned Project reference. It does not contact APIs, read
146
+ runtime credentials, or recognize the removed global `.siteos/project.json` format.
147
+
148
+ ## Migrating from the old Pulse CLI
149
+
150
+ The old Pulse executable package is not retained. On `pulse project status` or `pulse deploy`, the
151
+ new CLI can safely import a matching version 2 binding from:
152
+
153
+ ```text
154
+ ${XDG_CONFIG_HOME:-~/.config}/siteos/pulse/project-bindings.json
155
+ ```
156
+
157
+ Import occurs only when the API origin, real repository path, selected Auth Organization, and
158
+ `siteos.config.json` Project slug all match. The CLI writes and reads back the new shared binding,
159
+ then leaves the legacy file unchanged for manual comparison or rollback. It never imports the old
160
+ global `.siteos/project.json` contract because that model incorrectly coupled Projects across
161
+ products.
162
+
163
+ ## Environment overrides
164
+
165
+ | Variable | Purpose |
166
+ | --- | --- |
167
+ | `SITEOS_HOME` | Private CLI state directory; defaults to `~/.siteos` |
168
+ | `SITEOS_AUTH_BASE_URL` | Central Auth origin; defaults to `https://siteos-auth.xui.se` |
169
+ | `SITEOS_PULSE_API_URL` | Pulse API origin |
170
+ | `SITEOS_FORMS_PUBLIC_URL` | Forms API and public origin |
171
+ | `SITEOS_SEARCH_PUBLIC_URL` | Search API and public origin |
172
+
173
+ Run `siteos <service> --help` for the complete command surface. JSON output is intended for agents
174
+ and automation. Exit code `0` means success, `2` means invalid usage, and Pulse reserves `3`, `4`,
175
+ and `5` for authorization, conflict, and unavailable-service failures. Other operational failures
176
+ return `1`.
177
+
178
+ ## Development and publication checks
179
+
180
+ From this workspace:
181
+
182
+ ```sh
183
+ pnpm --dir packages/cli format:check
184
+ pnpm --dir packages/cli typecheck
185
+ pnpm --dir packages/cli test
186
+ pnpm --dir packages/cli build
187
+ pnpm --dir packages/cli pack:check
188
+ ```
189
+
190
+ `pack:check` creates the publishable tarball locally. It does not publish the package.