pockethost 3.1.0 → 4.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 (4) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +21 -17
  3. package/dist/cli.js +2482 -6960
  4. package/package.json +1 -2
package/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  Formerly published as `phio`. Versions below 3.0.0 are phio's history.
4
4
 
5
+ ## 4.0.0
6
+
7
+ ### Major Changes
8
+
9
+ - The CLI signs in with a personal access token only. Email/password login is gone: `pockethost login` opens
10
+ Account → API Tokens and saves the token you paste (`pockethost login <token>` works too), and
11
+ `POCKETHOST_USERNAME`/`POCKETHOST_PASSWORD` are ignored with a message pointing to `POCKETHOST_TOKEN`. A login saved
12
+ by 3.x no longer works; run `pockethost login` once.
13
+ - `list`, `link` and `logs` work with a token and show only the instances the token can reach. `logs` streams over
14
+ the instance's HTTPS endpoint, so it works from CI.
15
+ - `sftp`, `deploy --sftp` and `dev --sftp` no longer register an SSH key for you, because tokens can't add SSH keys.
16
+ Add the CLI's public key under Account → Keys once; the CLI prints it when it's missing. Keys registered by earlier
17
+ versions keep working.
18
+ - `info` shows the token, linked instance and whether the SFTP key is on your account.
19
+ - Dropped the `pocketbase` dependency.
20
+
5
21
  ## 3.1.0
6
22
 
7
23
  ### Minor Changes
package/README.md CHANGED
@@ -16,14 +16,14 @@ npm install -g pockethost
16
16
  npm rm -g phio && npm i -g pockethost
17
17
  ```
18
18
 
19
- Everything carries over on first run: your login and deploy key are copied from phio's config folder (`~/.config/phio-nodejs` on Linux), `.phioconfig` is
19
+ Your deploy key is copied from phio's config folder (`~/.config/phio-nodejs` on Linux), `.phioconfig` is
20
20
  renamed to `.pockethostconfig` (commit it), and the `PHIO_*` environment variables keep working with a warning until
21
21
  you rename them to `POCKETHOST_*`.
22
22
 
23
23
  ## Commands
24
24
 
25
25
  ```bash
26
- pockethost login # or: pockethost login --token
26
+ pockethost login [token] # save a personal access token
27
27
  pockethost token [set|clear|status]
28
28
  pockethost logout
29
29
  pockethost info # alias: pockethost whoami
@@ -37,7 +37,8 @@ pockethost logs [instance]
37
37
 
38
38
  - **`pockethost dev`**: watch local changes and deploy them
39
39
  - **`pockethost deploy`**: deploy once
40
- - **`pockethost token`**: save, clear, or check a personal access token
40
+ - **`pockethost login`**: open Account → API Tokens and save the token you paste
41
+ - **`pockethost token`**: save, clear, or check the token
41
42
  - **`pockethost sftp`**: interactive SFTP session (uses system `sftp` when available)
42
43
  - **`pockethost logs`**: tail instance logs
43
44
 
@@ -84,13 +85,16 @@ on the instance that aren't in your project are removed. `node_modules` and `.gi
84
85
 
85
86
  ## Authentication
86
87
 
87
- `deploy` and `dev` use, in order:
88
+ The CLI signs in with a personal access token (`ph_pat_…`) only. Every command uses, in order:
88
89
 
89
- 1. `POCKETHOST_TOKEN` (a personal access token, `ph_pat_…`)
90
- 2. a token saved with `pockethost token set` (or `pockethost login --token`)
91
- 3. your email/password login (`pockethost login`, or `POCKETHOST_USERNAME`/`POCKETHOST_PASSWORD`)
90
+ 1. `POCKETHOST_TOKEN`
91
+ 2. the token saved by `pockethost login` (or `pockethost token set`)
92
92
 
93
- Create tokens under Account → API Tokens in the dashboard. Deploy from GitHub Actions:
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.
96
+
97
+ Deploy from GitHub Actions:
94
98
 
95
99
  ```yaml
96
100
  - run: npx pockethost@latest deploy myapp-${{ github.ref_name }}
@@ -100,12 +104,14 @@ Create tokens under Account → API Tokens in the dashboard. Deploy from GitHub
100
104
 
101
105
  Docs: https://pockethost.io/docs/deploy-from-ci
102
106
 
103
- ## Deploy key (`--sftp` and `pockethost sftp`)
107
+ ## SSH key (`--sftp` and `pockethost sftp`)
104
108
 
105
- `pockethost dev --sftp`, `pockethost deploy --sftp` and `pockethost sftp` use **SFTP** (`ftp.pockethost.io:2222`) using an Ed25519 deploy key
106
- stored under `POCKETHOST_HOME` (default `~/.config/pockethost/`). The CLI auto-registers a **`PocketHost CLI`** key
107
- under Account → Keys on first use (an existing **`Phio`** key from phio is reused). Run `pockethost info` to inspect
108
- key status.
109
+ `pockethost dev --sftp`, `pockethost deploy --sftp` and `pockethost sftp` use **SFTP** (`ftp.pockethost.io:2222`)
110
+ with an Ed25519 key stored under `POCKETHOST_HOME` (default `~/.config/pockethost/`), created on first use. Tokens
111
+ 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
113
+ with an earlier version (`PocketHost CLI` or `Phio`) keep working. `pockethost info` shows whether the key is on your
114
+ account.
109
115
 
110
116
  Customer docs: https://pockethost.io/docs/cli
111
117
 
@@ -113,16 +119,14 @@ Customer docs: https://pockethost.io/docs/cli
113
119
 
114
120
  | Variable | Purpose |
115
121
  | -------- | ------- |
116
- | `POCKETHOST_TOKEN` | Personal access token for `deploy`/`dev` (CI) |
117
- | `POCKETHOST_USERNAME` | Override saved email (non-interactive login) |
118
- | `POCKETHOST_PASSWORD` | Override saved password |
122
+ | `POCKETHOST_TOKEN` | Personal access token (CI); overrides the saved one |
119
123
  | `POCKETHOST_INSTANCE_NAME` | Override linked instance name |
120
124
  | `POCKETHOST_MOTHERSHIP_URL` | Override mothership API URL |
121
125
  | `POCKETHOST_HOME` | Override config directory |
122
126
  | `POCKETHOST_PROJECT_DIR` | Override project root detection |
123
127
 
124
128
  Environment variables take precedence over `.pockethostconfig`. The old `PHIO_*` names still work (with a deprecation
125
- warning) and will be removed in the next major version.
129
+ warning) and will be removed in a future major version.
126
130
 
127
131
  ## Development (monorepo)
128
132