pockethost 4.0.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,36 @@
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
+
20
+ ## 4.1.0
21
+
22
+ ### Minor Changes
23
+
24
+ - New file commands that work over HTTPS with your token, replacing SFTP:
25
+ - `pockethost files [path] [-r]` lists files on the instance.
26
+ - `pockethost pull [paths...]` downloads files into the current folder (everything except `pb_data` by default;
27
+ `--data` includes it, and `node_modules` is skipped unless you name it). Files that haven't changed since the last
28
+ pull are skipped.
29
+ - `pockethost upload <local> [remote]` uploads a file or folder, for example an existing `pb_data` or your
30
+ `node_modules` (deploys never touch `node_modules`). Large files go up in 32 MB chunks, eight files at a time.
31
+ - `pockethost rm <paths...> [-r]` deletes files, for example a migration that keeps the instance from starting.
32
+ - Add `-I <instance>` to target an instance other than the linked one. `pb_data` needs the instance powered off.
33
+ - `pockethost sftp`, `deploy --sftp` and `dev --sftp` print a notice: SFTP shuts down on February 6, 2027.
34
+
5
35
  ## 4.0.0
6
36
 
7
37
  ### Major Changes
package/LICENSE.md ADDED
@@ -0,0 +1,16 @@
1
+ The MIT License (MIT)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software
4
+ and associated documentation files (the "Software"), to deal in the Software without restriction,
5
+ including without limitation the rights to use, copy, modify, merge, publish, distribute,
6
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
7
+ is furnished to do so, subject to the following conditions:
8
+
9
+ The above copyright notice and this permission notice shall be included in all copies or
10
+ substantial portions of the Software.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
13
+ BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
14
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
15
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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
 
@@ -31,24 +31,64 @@ pockethost list # alias: pockethost ls
31
31
  pockethost link [instance]
32
32
  pockethost dev [instance]
33
33
  pockethost deploy [instance]
34
- pockethost sftp [instance]
34
+ pockethost files [path]
35
+ pockethost pull [paths...]
36
+ pockethost upload <local> [remote]
37
+ pockethost rm <paths...>
38
+ pockethost sftp [instance] # shuts down Feb 6, 2027
35
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>
36
56
  ```
37
57
 
38
58
  - **`pockethost dev`**: watch local changes and deploy them
39
59
  - **`pockethost deploy`**: deploy once
40
60
  - **`pockethost login`**: open Account → API Tokens and save the token you paste
41
61
  - **`pockethost token`**: save, clear, or check the token
42
- - **`pockethost sftp`**: interactive SFTP session (uses system `sftp` when available)
62
+ - **`pockethost files`**: list files on the instance (`-r` for everything below a folder)
63
+ - **`pockethost pull`**: download instance files into this folder (`--data` includes `pb_data`)
64
+ - **`pockethost upload`**: upload a file or folder, such as an existing `pb_data`
65
+ - **`pockethost rm`**: delete files on the instance
66
+ - **`pockethost sftp`**: interactive SFTP session. SFTP shuts down on February 6, 2027
43
67
  - **`pockethost logs`**: tail instance logs
44
68
 
45
- `dev` and `deploy` accept `-v/--verbose`, `-i/--include`, `-e/--exclude`, and `--sftp` (sync over SFTP instead of
46
- 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).
47
72
 
48
73
  Default includes: `pb_*`, `package.json`, `bun.lock`, `bun.lockb`, `patches/**`.
49
74
 
50
75
  Default excludes: `pb_data/**`.
51
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
+
52
92
  ## Configuration
53
93
 
54
94
  Link a project directory to an instance:
@@ -77,11 +117,14 @@ Older project files (`.phioconfig`, `package.json` → `pockethost.instanceName`
77
117
  3. Commit: the server swaps the file set in atomically (stopping the instance when anything outside `pb_public`
78
118
  changes) and starts the instance again.
79
119
 
80
- PocketHost doesn't install npm packages. `package.json`, `bun.lock(b)` and `patches/` are copied as plain files. Bundle
81
- 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.
82
124
 
83
- Only `pb_*` folders (never `pb_data`), `package.json`, `bun.lock(b)` and `patches/` are deployed. Files in those folders
84
- 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.
85
128
 
86
129
  ## Authentication
87
130
 
@@ -90,9 +133,9 @@ The CLI signs in with a personal access token (`ph_pat_…`) only. Every command
90
133
  1. `POCKETHOST_TOKEN`
91
134
  2. the token saved by `pockethost login` (or `pockethost token set`)
92
135
 
93
- Create tokens under [Account → API Tokens](https://app.pockethost.io/account/tokens). A token sees only the instances
94
- you give it; `list`, `link` and `logs` need read access, `deploy` and `dev` need write access. Email/password login
95
- 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.
96
139
 
97
140
  Deploy from GitHub Actions:
98
141
 
@@ -109,7 +152,7 @@ Docs: https://pockethost.io/docs/deploy-from-ci
109
152
  `pockethost dev --sftp`, `pockethost deploy --sftp` and `pockethost sftp` use **SFTP** (`ftp.pockethost.io:2222`)
110
153
  with an Ed25519 key stored under `POCKETHOST_HOME` (default `~/.config/pockethost/`), created on first use. Tokens
111
154
  can't add SSH keys, so add the public key (`pockethost_deploy_ed25519.pub`) under
112
- [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
113
156
  with an earlier version (`PocketHost CLI` or `Phio`) keep working. `pockethost info` shows whether the key is on your
114
157
  account.
115
158