@sylphx/cli 0.7.5 → 0.8.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 CHANGED
@@ -1,5 +1,29 @@
1
1
  # @sylphx/cli
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1004](https://github.com/SylphxAI/platform/pull/1004) [`e51d39c`](https://github.com/SylphxAI/platform/commit/e51d39c47da0efd26c676f5908035e6c6b0fa3f7) Thanks [@shtse8](https://github.com/shtse8)! - Add `SYLPHX_TOKEN_FILE` as a non-interactive CLI auth source for local agent fleets, with explicit doctor/whoami reporting and hard-fail behavior when the configured token file is unreadable or empty.
8
+
9
+ - [#759](https://github.com/SylphxAI/platform/pull/759) [`3257675`](https://github.com/SylphxAI/platform/commit/325767586a2fa5e53f00cd81e438d561d0e37c41) Thanks [@shtse8](https://github.com/shtse8)! - Align the Management SDK runners module with the contract-derived runner API surface.
10
+
11
+ Runner management methods now derive request paths, HTTP methods, input types, and result types from `@sylphx/contract`. The create input no longer advertises unsupported `labels` or `maxJobs` fields; callers should pass the contract-owned `name`, `platform`, and `arch` fields.
12
+
13
+ The `sylphx runners register` CLI command no longer exposes the unsupported `--labels` or `--max-jobs` flags and now submits only the contract-owned runner registration fields.
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies []:
18
+ - @sylphx/sdk@0.11.1
19
+
20
+ ## 0.7.6
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [[`df3c86e`](https://github.com/SylphxAI/platform/commit/df3c86e210f165070ed1e2f715eeed11ece6f07b), [`af6c46f`](https://github.com/SylphxAI/platform/commit/af6c46fa785acf52da428d19db50da3d834ef873)]:
25
+ - @sylphx/sdk@0.11.0
26
+
3
27
  ## 0.7.5
4
28
 
5
29
  ### Patch Changes
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  The official CLI for the [Sylphx Platform](https://sylphx.com). Deploy and operate your applications across deployment, logs, env vars, domains, managed databases, object storage, monitoring, webhooks, feature flags, and more directly from your terminal.
8
8
 
9
- Full documentation: [sylphx.com/docs/cli](https://sylphx.com/docs/cli)
9
+ Full documentation: [sylphx.com/docs](https://sylphx.com/docs)
10
10
 
11
11
  ## Installation
12
12
 
@@ -36,16 +36,17 @@ sylphx deploy
36
36
 
37
37
  ## Authentication
38
38
 
39
- The CLI supports two auth paths (ADR-059 + ADR-074):
39
+ The CLI supports three auth paths (ADR-059 + ADR-074):
40
40
 
41
41
  | Mode | Use case | How |
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` env var** | Local agent fleets | `export SYLPHX_TOKEN_FILE=~/.config/sylphx/agent.token` — reads a raw token or dotenv-style `SYLPHX_TOKEN=...` from a local file, with the same stateless refresh behavior as `SYLPHX_TOKEN` |
45
46
 
46
47
  Legacy `slx_*` personal access tokens were eliminated 2026-04-21 (ADR-059 §1.4) and are no longer accepted by the API.
47
48
 
48
- Under ADR-059, OAuth tokens are stored as an atomic `{ accessToken, refreshToken, expiresAt }` triple 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.
49
+ Under ADR-059, OAuth tokens are stored as an atomic `{ accessToken, refreshToken, expiresAt, refreshExpiresAt }` credential 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.
49
50
 
50
51
  ```bash
51
52
  # Interactive (developers)
@@ -57,6 +58,12 @@ sylphx logout
57
58
  export SYLPHX_TOKEN=svc_…
58
59
  sylphx whoami # → "Auth: SYLPHX_TOKEN env var"
59
60
  sylphx deploy --env=production
61
+
62
+ # Local agent fleet, shared shell, or secret-file handoff
63
+ printf '%s\n' 'SYLPHX_TOKEN=svc_…' > ~/.config/sylphx/agent.token
64
+ chmod 600 ~/.config/sylphx/agent.token
65
+ export SYLPHX_TOKEN_FILE=~/.config/sylphx/agent.token
66
+ sylphx whoami # → "Auth: SYLPHX_TOKEN_FILE (...)"
60
67
  sylphx status --project=proj_abc123 --org=my-org
61
68
  sylphx logs --project=proj_abc123 --org=my-org --tail=100
62
69
  sylphx env set DATABASE_URL=postgres://... --project=proj_abc123 --org=my-org --secret
@@ -72,16 +79,22 @@ sylphx releases list --project=proj_abc123 --org=my-org
72
79
 
73
80
  ### Non-interactive use (CI / agents)
74
81
 
75
- Set `SYLPHX_TOKEN` and every CLI command honours it as a Bearer token —
76
- no `sylphx login`, no browser, no `~/.sylphx/config.json` write:
82
+ Set `SYLPHX_TOKEN` or `SYLPHX_TOKEN_FILE` and every CLI command honours
83
+ it as a Bearer token — no `sylphx login`, no browser, no
84
+ `~/.sylphx/config.json` write:
77
85
 
78
- - The env var **wins** over any stored OAuth session useful when a
79
- developer's machine doubles as a CI runner.
80
- - The OAuth refresh interceptor is **skipped** when the env var is
86
+ - `SYLPHX_TOKEN` **wins** over `SYLPHX_TOKEN_FILE`, and both win over any
87
+ stored OAuth session — useful when a developer's machine doubles as a
88
+ CI runner.
89
+ - The OAuth refresh interceptor is **skipped** when external auth is
81
90
  active. Service tokens have no refresh token (rotate via `sylphx
82
91
  tokens rotate` instead); JWTs supplied here are operator-rotated.
83
92
  - Empty string (`SYLPHX_TOKEN=`) is treated as unset and falls back to
84
93
  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.
85
98
  - The same `SYLPHX_TOKEN` GitHub Actions output minted by `sylphx ci
86
99
  github-actions` is the variable the CLI itself consumes. One contract,
87
100
  no shell glue.
@@ -103,7 +116,8 @@ Stored at `~/.sylphx/config.json`:
103
116
  "oauth": {
104
117
  "accessToken": "eyJ...",
105
118
  "refreshToken": "ref_...",
106
- "expiresAt": "2026-04-23T15:00:00.000Z"
119
+ "expiresAt": "2026-04-23T15:00:00.000Z",
120
+ "refreshExpiresAt": "2026-05-23T15:00:00.000Z"
107
121
  },
108
122
  "defaultOrg": "my-org",
109
123
  "apps": {
@@ -123,6 +137,7 @@ Per-project deployment intent lives in `./sylphx.toml` (git-committable); the ho
123
137
  | Variable | Description |
124
138
  |---|---|
125
139
  | `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 local file containing a raw token or `SYLPHX_TOKEN=...`. Used for local agent fleets and secret-file handoff. Used after `SYLPHX_TOKEN`, before stored OAuth; unreadable/empty files fail loudly instead of falling back. |
126
141
  | `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. |
127
142
  | `SYLPHX_API_URL` | Override API base URL (default: `https://sylphx.com`) |
128
143