@photon-ai/cli 0.3.3 → 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.
Files changed (3) hide show
  1. package/README.md +53 -29
  2. package/dist/photon.js +80 -80
  3. package/package.json +4 -3
package/README.md CHANGED
@@ -3,60 +3,86 @@
3
3
  Typed terminal UI for the [Photon Dashboard](https://photon.codes). Replaces the web UI for everyday work — manage projects, Spectrum users / lines / platforms, billing, and your developer profile from a terminal.
4
4
 
5
5
  ```sh
6
- npx @photon-ai/cli login # try it without installing
7
- bun add -g @photon-ai/cli # or install for daily use
6
+ npx @photon-ai/cli login # try it without installing
7
+ npm install -g @photon-ai/cli # or install for daily use
8
8
  ```
9
9
 
10
+ Runs on Node.js >= 18. Bun is also supported but not required.
11
+
10
12
  ---
11
13
 
12
14
  ## Install
13
15
 
14
- Four options. Pick whichever fits.
16
+ ### One-off — no install
17
+
18
+ ```sh
19
+ npx @photon-ai/cli login
20
+ npx @photon-ai/cli projects ls
21
+ ```
22
+
23
+ Each invocation pulls the latest release on demand. Good for scripts, throwaway machines, or trying the CLI before committing. Works with `npx`, `pnpx`, or `bunx`.
15
24
 
16
- ### 1. Homebrew (macOS / Linux)
25
+ ### Global install
17
26
 
18
27
  ```sh
19
- brew install photon-hq/photon/photon
28
+ npm install -g @photon-ai/cli
20
29
  photon login
21
30
  ```
22
31
 
23
- Auto-updates with `brew upgrade photon`. No runtime dependencies — the formula installs a self-contained binary.
32
+ After install, both `photon` and the shorter `pho` alias are on your `PATH`.
24
33
 
25
- ### 2. One-off — no install (`npx` / `bunx`)
34
+ Also works with other package managers:
26
35
 
27
36
  ```sh
28
- npx @photon-ai/cli login
29
- bunx @photon-ai/cli projects ls
37
+ pnpm add -g @photon-ai/cli
38
+ yarn global add @photon-ai/cli
39
+ bun add -g @photon-ai/cli
30
40
  ```
31
41
 
32
- Each invocation pulls the latest release on demand. Good for scripts, throwaway machines, or trying the CLI before committing. Requires Bun on `PATH` (the bundle has a `#!/usr/bin/env bun` shebang) — install it once with:
42
+ ### Standalone binary
43
+
44
+ For CI environments or systems where you don't want any runtime. Replace `<os>` and `<arch>` with your platform:
33
45
 
34
46
  ```sh
35
- curl -fsSL https://bun.sh/install | bash
47
+ # <os>: darwin | linux <arch>: arm64 | x64
48
+ curl -L -o /usr/local/bin/photon \
49
+ https://github.com/photon-hq/cli/releases/latest/download/photon-<os>-<arch>
50
+ chmod +x /usr/local/bin/photon
51
+ photon --version
36
52
  ```
37
53
 
38
- ### 3. Global install — daily use (`bun add -g`)
54
+ Available for macOS (arm64 / x64) and Linux (x64 / arm64). Each binary ships with a corresponding `.sha256` checksum on the same release page.
55
+
56
+ ---
57
+
58
+ ## Update
59
+
60
+ The CLI shows a notification when a new version is available. To update:
39
61
 
40
62
  ```sh
41
- bun add -g @photon-ai/cli
42
- photon login
63
+ npm update -g @photon-ai/cli
64
+ photon --version
43
65
  ```
44
66
 
45
- After install, `photon` is on your `PATH`. The `pho` alias (see below) is created automatically the first time you run `photon`.
67
+ Or with other package managers:
46
68
 
47
- ### 4. Standalone binary — no Bun, no Node
69
+ ```sh
70
+ pnpm update -g @photon-ai/cli
71
+ yarn global upgrade @photon-ai/cli
72
+ bun update -g @photon-ai/cli
73
+ ```
48
74
 
49
- For CI environments or systems where you don't want any runtime:
75
+ If you're using a standalone binary, re-download the latest release:
50
76
 
51
77
  ```sh
52
- # pick your platform from https://github.com/photon-hq/cli/releases/latest
53
78
  curl -L -o /usr/local/bin/photon \
54
- https://github.com/photon-hq/cli/releases/latest/download/photon-darwin-arm64
79
+ https://github.com/photon-hq/cli/releases/latest/download/photon-<os>-<arch>
55
80
  chmod +x /usr/local/bin/photon
56
- photon --version
57
81
  ```
58
82
 
59
- Available for macOS (arm64 / x64) and Linux (x64 / arm64). Each binary ships with a corresponding `.sha256` checksum on the same release page.
83
+ `npx` / `pnpx` / `bunx` users always get the latest release automatically — no manual update needed.
84
+
85
+ To suppress the update notification, set `PHOTON_NO_UPDATE_NOTIFIER=1`.
60
86
 
61
87
  ---
62
88
 
@@ -78,14 +104,14 @@ photon billing show
78
104
 
79
105
  ### The `pho` alias
80
106
 
81
- `pho` is a shortcut for `photon`, useful for high-frequency commands. It's created automatically as a sibling symlink the first time you run `photon` after installing — so no setup needed for global installs:
107
+ `pho` is a shortcut for `photon`, useful for high-frequency commands. Every global install (npm / pnpm / yarn / bun) wires up both `photon` and `pho` automatically — they're declared as sibling `bin` entries that point at the same binary, so no setup is needed:
82
108
 
83
109
  ```sh
84
110
  pho ls # photon projects ls
85
111
  pho whoami
86
112
  ```
87
113
 
88
- (`npx` / `bunx` users don't get `pho` since they're already typing the full package name; the alias is only created when running through an installed `photon` binary.)
114
+ For `npx` / `bunx`, the package name itself is what you type, so `npx @photon-ai/cli` runs `photon` (the first declared bin). To run `pho` explicitly through `npx`, use `npx --package=@photon-ai/cli pho`.
89
115
 
90
116
  ---
91
117
 
@@ -180,6 +206,7 @@ photon
180
206
  │ ├── delete [id] [-y] permanent delete
181
207
  │ ├── regenerate-secret [id] [-y] rotate Spectrum secret
182
208
  │ ├── open [id] open dashboard in browser
209
+ │ ├── upgrade [id] [tier] subscribe / open Stripe portal
183
210
  │ └── check-phone <number> availability check
184
211
  ├── profile show / init / update developer / org profile
185
212
  ├── spectrum
@@ -191,7 +218,7 @@ photon
191
218
  └── billing
192
219
  ├── plans available plans
193
220
  ├── show current subscription
194
- ├── checkout --plan <price-id> Stripe Checkout (browser)
221
+ ├── checkout [tier] [--plan <price-id>] Stripe Checkout (browser)
195
222
  └── manage Stripe Customer Portal
196
223
  ```
197
224
 
@@ -229,7 +256,7 @@ The CLI's config root is resolved in this order:
229
256
 
230
257
  If a legacy `~/.config/photon-dashboard/` directory exists from a prior pre-rename install, it migrates automatically to the new path on first run.
231
258
 
232
- Other env vars: `PHOTON_TYPES_SRC` (maintainer-only, for `bun run sync:api`), `PHOTON_NO_UPDATE_NOTIFIER=1` (mute update prompt).
259
+ Other env vars: `PHOTON_NO_UPDATE_NOTIFIER=1` (mute update prompt).
233
260
 
234
261
  ---
235
262
 
@@ -251,12 +278,9 @@ bun run typecheck
251
278
 
252
279
  # Build (produces dist/photon.js)
253
280
  bun run build
254
-
255
- # Sync API types from a sibling `dashboard` checkout (maintainer)
256
- bun run sync:api
257
281
  ```
258
282
 
259
- The CLI's API contract comes from the `@photon-ai/api-public` type bundle, vendored at `types/api.d.ts`. To refresh after the dashboard's API surface changes, run `bun run sync:api` (looks for the sibling checkout by default; set `PHOTON_TYPES_SRC` to override).
283
+ The CLI's API contract comes from the [`@photon-ai/dashboard-api`](https://www.npmjs.com/package/@photon-ai/dashboard-api) package, a types-only bundle of the dashboard's public API (the `PublicApp` Elysia type, used with `@elysiajs/eden` treaty). To pick up dashboard API changes, bump that dependency — its version tracks the dashboard release tag.
260
284
 
261
285
  See [`docs/cli-design.md`](docs/cli-design.md) and [`docs/cli-build-plan.md`](docs/cli-build-plan.md) for the full architecture notes.
262
286