@sylphx/cli 0.9.1 → 0.10.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 +26 -0
- package/README.md +35 -20
- package/dist/main.js +4191 -2910
- package/dist/main.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @sylphx/cli
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1063](https://github.com/SylphxAI/platform/pull/1063) [`f7bce5d`](https://github.com/SylphxAI/platform/commit/f7bce5d4869cc3904fc21edb1c0e6cfcbcab0d9a) Thanks [@shtse8](https://github.com/shtse8)! - Add an agent-safe `SYLPHX_TOKEN_FILE` auth source for the CLI, preserve OAuth refresh-token expiry through the token endpoint contract, and surface refresh-expiry diagnostics in `sylphx doctor`.
|
|
8
|
+
|
|
9
|
+
Agents and CI can now mount a raw token or `SYLPHX_TOKEN=...` secret file instead of sharing a human `sylphx login` OAuth refresh chain. The CLI resolves auth as `SYLPHX_TOKEN` → `SYLPHX_TOKEN_FILE` → stored OAuth, skips OAuth refresh for machine credentials, and fails closed when a configured token file is invalid.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#1078](https://github.com/SylphxAI/platform/pull/1078) [`b1d0edf`](https://github.com/SylphxAI/platform/commit/b1d0edfbd8386ea2421d8f0ae769d21e86c0db3a) Thanks [@shtse8](https://github.com/shtse8)! - Increase deploy fallback wait budget for production rollouts and rely on corrected Management API deployment status projection after log-stream disconnects.
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`f7bce5d`](https://github.com/SylphxAI/platform/commit/f7bce5d4869cc3904fc21edb1c0e6cfcbcab0d9a)]:
|
|
16
|
+
- @sylphx/sdk@0.12.2
|
|
17
|
+
|
|
18
|
+
## 0.9.2
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- [#1061](https://github.com/SylphxAI/platform/pull/1061) [`7d143ec`](https://github.com/SylphxAI/platform/commit/7d143ec5811b0a671aef428f3cc8794306e71940) Thanks [@shtse8](https://github.com/shtse8)! - Route deliberate CLI BaaS SDK dogfood calls through a single platform-baas adapter and add CI guards for the CLI SDK boundary, Core SDK boundary, and BaaS runtime `/v1` path SSOT.
|
|
23
|
+
|
|
24
|
+
Make SDK platform detection edge-safe by removing top-level Node-only runtime probes from shared constants.
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [[`7d143ec`](https://github.com/SylphxAI/platform/commit/7d143ec5811b0a671aef428f3cc8794306e71940), [`adf814e`](https://github.com/SylphxAI/platform/commit/adf814ec0b402b0f3443caa3442cb256515a4ad6)]:
|
|
27
|
+
- @sylphx/sdk@0.12.1
|
|
28
|
+
|
|
3
29
|
## 0.9.1
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -42,11 +42,11 @@ The CLI supports three auth paths (ADR-059 + ADR-074):
|
|
|
42
42
|
|---|---|---|
|
|
43
43
|
| **OAuth device flow** (default) | Interactive dev | `sylphx login` — browser-backed device flow, 15-min access + 30-day refresh token stored at `~/.sylphx/config.json` (`0600`), auto-refresh built in |
|
|
44
44
|
| **`SYLPHX_TOKEN` env var** | CI / CD / agents | `export SYLPHX_TOKEN=svc_...` — no login step, no disk write, stateless. Service tokens (`svc_*`, ADR-089 §2.10) or short-lived OAuth access JWTs (`eyJ…`) both work |
|
|
45
|
-
| **`SYLPHX_TOKEN_FILE`
|
|
45
|
+
| **`SYLPHX_TOKEN_FILE` secret file** | Local agent fleets / mounted secrets | `export SYLPHX_TOKEN_FILE=~/.sylphx/agent-token.env` — reads a raw token or `SYLPHX_TOKEN=...` file, skips OAuth refresh, and never falls back to a human OAuth session when the file is invalid |
|
|
46
46
|
|
|
47
47
|
Legacy `slx_*` personal access tokens were eliminated 2026-04-21 (ADR-059 §1.4) and are no longer accepted by the API.
|
|
48
48
|
|
|
49
|
-
Under ADR-059, OAuth tokens are stored as an atomic `{ accessToken, refreshToken, expiresAt, refreshExpiresAt }`
|
|
49
|
+
Under ADR-059, OAuth tokens are stored as an atomic `{ accessToken, refreshToken, expiresAt, refreshExpiresAt }` record with mode `0600` on disk. The refresh interceptor (`utils/oauth-refresh.ts`) transparently rotates the access token when it's within the refresh window; a failed refresh prompts re-login.
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
52
|
# Interactive (developers)
|
|
@@ -57,13 +57,13 @@ sylphx logout
|
|
|
57
57
|
# Non-interactive (CI / agents)
|
|
58
58
|
export SYLPHX_TOKEN=svc_…
|
|
59
59
|
sylphx whoami # → "Auth: SYLPHX_TOKEN env var"
|
|
60
|
-
sylphx deploy --env=production
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
export SYLPHX_TOKEN_FILE=~/.config/sylphx/agent.token
|
|
61
|
+
printf '%s\n' 'SYLPHX_TOKEN=svc_…' > ~/.sylphx/agent-token.env
|
|
62
|
+
chmod 600 ~/.sylphx/agent-token.env
|
|
63
|
+
export SYLPHX_TOKEN_FILE=~/.sylphx/agent-token.env
|
|
66
64
|
sylphx whoami # → "Auth: SYLPHX_TOKEN_FILE (...)"
|
|
65
|
+
|
|
66
|
+
sylphx deploy --env=production
|
|
67
67
|
sylphx status --project=proj_abc123 --org=my-org
|
|
68
68
|
sylphx logs --project=proj_abc123 --org=my-org --tail=100
|
|
69
69
|
sylphx env set DATABASE_URL=postgres://... --project=proj_abc123 --org=my-org --secret
|
|
@@ -79,22 +79,22 @@ sylphx releases list --project=proj_abc123 --org=my-org
|
|
|
79
79
|
|
|
80
80
|
### Non-interactive use (CI / agents)
|
|
81
81
|
|
|
82
|
-
Set `SYLPHX_TOKEN` or `SYLPHX_TOKEN_FILE` and every CLI command honours
|
|
83
|
-
|
|
82
|
+
Set `SYLPHX_TOKEN` or `SYLPHX_TOKEN_FILE` and every CLI command honours it
|
|
83
|
+
as a Bearer token — no `sylphx login`, no browser, no
|
|
84
84
|
`~/.sylphx/config.json` write:
|
|
85
85
|
|
|
86
|
-
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
- The env var **wins** over any stored OAuth session — useful when a
|
|
87
|
+
developer's machine doubles as a CI runner.
|
|
88
|
+
- `SYLPHX_TOKEN_FILE` is next in precedence and supports a raw token,
|
|
89
|
+
`SYLPHX_TOKEN=svc_...`, or `export SYLPHX_TOKEN="svc_..."`.
|
|
90
|
+
- If `SYLPHX_TOKEN_FILE` is set but unreadable or empty, the CLI fails
|
|
91
|
+
closed instead of silently using a stored human OAuth session.
|
|
92
|
+
- The OAuth refresh interceptor is **skipped** when the env var is
|
|
93
|
+
active or a token file is configured. Service tokens have no refresh
|
|
94
|
+
token (rotate via `sylphx tokens rotate` instead); JWTs supplied here
|
|
95
|
+
are operator-rotated.
|
|
92
96
|
- Empty string (`SYLPHX_TOKEN=`) is treated as unset and falls back to
|
|
93
97
|
the stored session — defends against misconfigured CI shell exports.
|
|
94
|
-
- If `SYLPHX_TOKEN_FILE` is set but unreadable or empty, auth fails
|
|
95
|
-
loudly and does not fall back to a stored interactive session. This
|
|
96
|
-
prevents local agents from accidentally operating as the human logged
|
|
97
|
-
into the same machine.
|
|
98
98
|
- The same `SYLPHX_TOKEN` GitHub Actions output minted by `sylphx ci
|
|
99
99
|
github-actions` is the variable the CLI itself consumes. One contract,
|
|
100
100
|
no shell glue.
|
|
@@ -107,6 +107,21 @@ GitHub Actions example:
|
|
|
107
107
|
SYLPHX_TOKEN: ${{ secrets.SYLPHX_TOKEN }}
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
+
Local agent example:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
install -m 700 -d ~/.sylphx
|
|
114
|
+
printf '%s\n' 'SYLPHX_TOKEN=svc_...' > ~/.sylphx/agent-token.env
|
|
115
|
+
chmod 600 ~/.sylphx/agent-token.env
|
|
116
|
+
export SYLPHX_TOKEN_FILE=~/.sylphx/agent-token.env
|
|
117
|
+
sylphx doctor
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Agents should prefer a scope-limited `svc_*` service token or OIDC-issued
|
|
121
|
+
short-lived token. Do not copy `~/.sylphx/config.json` between agents:
|
|
122
|
+
the OAuth refresh token is single-use rotation state for one interactive
|
|
123
|
+
user session, and sharing it can revoke the chain.
|
|
124
|
+
|
|
110
125
|
## Configuration
|
|
111
126
|
|
|
112
127
|
Stored at `~/.sylphx/config.json`:
|
|
@@ -137,7 +152,7 @@ Per-project deployment intent lives in `./sylphx.toml` (git-committable); the ho
|
|
|
137
152
|
| Variable | Description |
|
|
138
153
|
|---|---|
|
|
139
154
|
| `SYLPHX_TOKEN` | Bearer token for non-interactive auth (CI / agents). Accepts `svc_*` service tokens or `eyJ…` OAuth access JWTs. Wins over any stored OAuth session; refresh interceptor is skipped (stateless). Empty string is treated as unset. |
|
|
140
|
-
| `SYLPHX_TOKEN_FILE` | Path to a
|
|
155
|
+
| `SYLPHX_TOKEN_FILE` | Path to a non-interactive auth secret file. Accepts a raw token, `SYLPHX_TOKEN=...`, or `export SYLPHX_TOKEN="..."`. Used after `SYLPHX_TOKEN` and before stored OAuth; fails closed when set but invalid. |
|
|
141
156
|
| `SYLPHX_CONFIG_DIR` | Advanced automation override for the CLI config directory. Use in CI, tests, and hermetic agent sandboxes to avoid reading or writing the operator's real `~/.sylphx` credentials. |
|
|
142
157
|
| `SYLPHX_API_URL` | Override API base URL (default: `https://sylphx.com`) |
|
|
143
158
|
|