pockethost 4.1.0 → 4.2.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 (4) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +46 -11
  3. package/dist/cli.js +7150 -6272
  4. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  Formerly published as `phio`. Versions below 3.0.0 are phio's history.
4
4
 
5
+ ## 4.2.0
6
+
7
+ ### Minor Changes
8
+
9
+ - Manage instances from the CLI, with the same token you deploy with: `show`, `power on|off`, `rename`, `version`,
10
+ `versions`, `domain set|clear`, `dev-mode`, `admin-sync`, `auto-vacuum`, `secrets list|set|unset`,
11
+ `webhooks list|add|rm`, `create` and `delete`. Settings that need the instance off take `--cycle` to power it off,
12
+ apply the change and power it back on. The token needs write access, and `create` needs a token for all instances.
13
+ - `deploy` and `dev` ship your production `node_modules` when `package.json` has `dependencies`: the packages in
14
+ `dependencies` and what they need, never `devDependencies`. Works with npm, pnpm, Bun and workspaces, and follows
15
+ symlinks so the instance gets plain files. `--no-node-modules` turns it off.
16
+ - `deploy --dry-run` lists what would be deployed, and `deploy --out <dir>` writes it to a local folder.
17
+ - Links to API tokens and SSH keys point at `pockethost.io/account/…` (the old `app.pockethost.io` links landed on the
18
+ home page).
19
+
5
20
  ## 4.1.0
6
21
 
7
22
  ### Minor Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # pockethost: the PocketHost CLI
2
2
 
3
- Deploy, sync, and tail logs for your [PocketHost](https://pockethost.io) instances.
3
+ Deploy, sync, tail logs and manage your [PocketHost](https://pockethost.io) instances.
4
4
 
5
5
  Install globally (Node.js 20+):
6
6
 
@@ -37,6 +37,22 @@ pockethost upload <local> [remote]
37
37
  pockethost rm <paths...>
38
38
  pockethost sftp [instance] # shuts down Feb 6, 2027
39
39
  pockethost logs [instance]
40
+
41
+ # Instances (same as the dashboard)
42
+ pockethost show [instance]
43
+ pockethost power on|off [instance]
44
+ pockethost rename <new-name> [instance]
45
+ pockethost version <version> [instance]
46
+ pockethost versions
47
+ pockethost domain set <host> [instance]
48
+ pockethost domain clear [instance]
49
+ pockethost dev-mode on|off [instance]
50
+ pockethost admin-sync on|off [instance]
51
+ pockethost auto-vacuum on|off [instance]
52
+ pockethost secrets list|set|unset
53
+ pockethost webhooks list|add|rm
54
+ pockethost create [name]
55
+ pockethost delete <instance>
40
56
  ```
41
57
 
42
58
  - **`pockethost dev`**: watch local changes and deploy them
@@ -50,13 +66,29 @@ pockethost logs [instance]
50
66
  - **`pockethost sftp`**: interactive SFTP session. SFTP shuts down on February 6, 2027
51
67
  - **`pockethost logs`**: tail instance logs
52
68
 
53
- `dev` and `deploy` accept `-v/--verbose`, `-i/--include`, `-e/--exclude`, and `--sftp` (sync over SFTP instead of
54
- HTTPS). `deploy` also takes `--commit <sha>` and `-m/--message <note>`.
69
+ `dev` and `deploy` accept `-v/--verbose`, `-i/--include`, `-e/--exclude`, `--no-node-modules`, and `--sftp` (sync
70
+ over SFTP instead of HTTPS). `deploy` also takes `--commit <sha>`, `-m/--message <note>`, `--dry-run` (list what would
71
+ be deployed) and `--out <dir>` (write the deploy set to a local folder instead of deploying).
55
72
 
56
73
  Default includes: `pb_*`, `package.json`, `bun.lock`, `bun.lockb`, `patches/**`.
57
74
 
58
75
  Default excludes: `pb_data/**`.
59
76
 
77
+ ## Managing instances
78
+
79
+ Everything the dashboard does to an instance has a command. They use the linked instance unless you name one
80
+ (`secrets` and `webhooks` take `-I <instance>`).
81
+
82
+ - **`show`**: power, URLs, domain, version, settings, secret names and webhooks (`--json` for scripts)
83
+ - **`power on|off`**: `off --wait` waits until the instance has stopped
84
+ - **`rename`**, **`version`**, **`domain set|clear`**, **`dev-mode`**, **`admin-sync`**, **`auto-vacuum`**: these need
85
+ the instance powered off. Add `--cycle` to power it off, apply the change and power it back on in one step
86
+ - **`secrets set KEY=value…`**: changes only the secrets you name. Give just `KEY` to type the value at a prompt so it
87
+ stays out of your shell history. `secrets list` shows names only, never values
88
+ - **`webhooks add <endpoint> "<cron>"`**, **`webhooks rm <endpoint>`**, **`webhooks list`**
89
+ - **`create [name]`**: a random available name if you don't give one. `--link` links this folder to it
90
+ - **`delete <instance>`**: the instance must be powered off. Asks you to type its name unless you pass `--yes`
91
+
60
92
  ## Configuration
61
93
 
62
94
  Link a project directory to an instance:
@@ -85,11 +117,14 @@ Older project files (`.phioconfig`, `package.json` → `pockethost.instanceName`
85
117
  3. Commit: the server swaps the file set in atomically (stopping the instance when anything outside `pb_public`
86
118
  changes) and starts the instance again.
87
119
 
88
- PocketHost doesn't install npm packages. `package.json`, `bun.lock(b)` and `patches/` are copied as plain files. Bundle
89
- any npm code your hooks need into `pb_hooks`.
120
+ PocketHost doesn't run `npm install`. Instead, when `package.json` has `dependencies`, the CLI ships your production
121
+ `node_modules` with the deploy: the packages in `dependencies` and everything they need, never `devDependencies`.
122
+ It works with npm, pnpm, Bun and workspaces, and follows symlinks, so the instance gets plain files. Install first
123
+ (`npm install` or similar), then deploy. `--no-node-modules` leaves the instance's `node_modules` alone.
90
124
 
91
- Only `pb_*` folders (never `pb_data`), `package.json`, `bun.lock(b)` and `patches/` are deployed. Files in those folders
92
- on the instance that aren't in your project are removed. `node_modules` and `.git*` are never touched.
125
+ Only `pb_*` folders (never `pb_data`), `package.json`, `bun.lock(b)`, `patches/` and the production `node_modules` are
126
+ deployed. Files in those folders on the instance that aren't in your project are removed. `.git*` files are never
127
+ touched.
93
128
 
94
129
  ## Authentication
95
130
 
@@ -98,9 +133,9 @@ The CLI signs in with a personal access token (`ph_pat_…`) only. Every command
98
133
  1. `POCKETHOST_TOKEN`
99
134
  2. the token saved by `pockethost login` (or `pockethost token set`)
100
135
 
101
- Create tokens under [Account → API Tokens](https://app.pockethost.io/account/tokens). A token sees only the instances
102
- you give it; `list`, `link` and `logs` need read access, `deploy` and `dev` need write access. Email/password login
103
- was removed in 4.0.
136
+ Create tokens under [Account → API Tokens](https://pockethost.io/account/tokens). A token sees only the instances
137
+ you give it. `list`, `link`, `show` and `logs` work with any token. `deploy`, `dev` and the instance commands need
138
+ write access, and `create` needs a token for all instances. Email/password login was removed in 4.0.
104
139
 
105
140
  Deploy from GitHub Actions:
106
141
 
@@ -117,7 +152,7 @@ Docs: https://pockethost.io/docs/deploy-from-ci
117
152
  `pockethost dev --sftp`, `pockethost deploy --sftp` and `pockethost sftp` use **SFTP** (`ftp.pockethost.io:2222`)
118
153
  with an Ed25519 key stored under `POCKETHOST_HOME` (default `~/.config/pockethost/`), created on first use. Tokens
119
154
  can't add SSH keys, so add the public key (`pockethost_deploy_ed25519.pub`) under
120
- [Account → Keys](https://app.pockethost.io/account/keys) once; the CLI prints it if it's missing. Keys you registered
155
+ [Account → Keys](https://pockethost.io/account/keys) once; the CLI prints it if it's missing. Keys you registered
121
156
  with an earlier version (`PocketHost CLI` or `Phio`) keep working. `pockethost info` shows whether the key is on your
122
157
  account.
123
158