pockethost 1.6.1 → 3.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 (44) hide show
  1. package/CHANGELOG.md +123 -84
  2. package/README.md +96 -0
  3. package/dist/cli.js +21542 -0
  4. package/package.json +55 -53
  5. package/changesetx.ts +0 -110
  6. package/common.ts +0 -1
  7. package/core.ts +0 -1
  8. package/readme.md +0 -129
  9. package/src/cli/commands/ConfigCommand/index.ts +0 -28
  10. package/src/cli/commands/PluginCommand/index.ts +0 -81
  11. package/src/cli/commands/PluginCommand/util.ts +0 -140
  12. package/src/cli/commands/ServeCommand/index.ts +0 -36
  13. package/src/cli/index.ts +0 -70
  14. package/src/common/CleanupManager.ts +0 -65
  15. package/src/common/Logger.ts +0 -174
  16. package/src/common/ResourceAllocator.ts +0 -49
  17. package/src/common/TimerManager.ts +0 -64
  18. package/src/common/assert.ts +0 -26
  19. package/src/common/debug.ts +0 -8
  20. package/src/common/error.ts +0 -16
  21. package/src/common/events.ts +0 -53
  22. package/src/common/index.ts +0 -12
  23. package/src/common/mergeConfig.ts +0 -27
  24. package/src/common/mkSingleton.ts +0 -28
  25. package/src/common/plugin/action.ts +0 -164
  26. package/src/common/plugin/filter.ts +0 -197
  27. package/src/common/plugin/index.ts +0 -21
  28. package/src/common/promiseSerializer.ts +0 -22
  29. package/src/common/schema/BaseFields.ts +0 -10
  30. package/src/common/schema/Instance.ts +0 -46
  31. package/src/common/schema/InstanceLog.ts +0 -12
  32. package/src/common/schema/index.ts +0 -3
  33. package/src/common/schema/util.ts +0 -7
  34. package/src/constants.ts +0 -70
  35. package/src/core/Settings.ts +0 -119
  36. package/src/core/asyncExecutionGuard.ts +0 -49
  37. package/src/core/config.ts +0 -108
  38. package/src/core/exit.ts +0 -11
  39. package/src/core/index.ts +0 -8
  40. package/src/core/internal.ts +0 -3
  41. package/src/core/smartFetch.ts +0 -32
  42. package/src/core/tryFetch.ts +0 -69
  43. package/src/plugin.ts +0 -54
  44. package/src/server.ts +0 -129
package/CHANGELOG.md CHANGED
@@ -1,128 +1,167 @@
1
- # pockethost
1
+ # pockethost (CLI)
2
2
 
3
- ## 1.6.1
3
+ Formerly published as `phio`. Versions below 3.0.0 are phio's history.
4
4
 
5
- ### Patch Changes
5
+ ## 3.0.0
6
6
 
7
- - dc8f70b: Updated docs
7
+ ### Major Changes
8
8
 
9
- ## 1.6.0
9
+ - Renamed from `phio` to `pockethost`. Install with `npm i -g pockethost`; the command is `pockethost`. The `phio`
10
+ npm package is deprecated.
11
+ - Installs and runs on plain Node (>=20): the CLI ships as a single bundled `dist/cli.js` and no longer needs `tsx`
12
+ on your PATH (a clean `npm i -g phio@0.4.0` failed with `/usr/bin/env: 'tsx': No such file or directory`).
13
+ - New names, migrated automatically on first run:
14
+ - project file `.phioconfig` → `.pockethostconfig`
15
+ - config folder `~/.config/phio-nodejs` → `~/.config/pockethost` (Linux; macOS/Windows equivalents) (login and deploy key are copied over)
16
+ - environment variables `PHIO_*` → `POCKETHOST_*` (old names still work, with a warning)
17
+ - new deploy keys are labeled `PocketHost CLI`; existing `Phio` keys are reused
18
+ - Removed the undocumented library entry point (`main`/`types`); the package is CLI-only.
19
+ - `list` help text now says "List your instances".
10
20
 
11
- ### Minor Changes
21
+ ## 1.0.0 (never published; shipped as 3.0.0)
22
+
23
+ ### Major Changes
12
24
 
13
- - 40bbb3c: Improve tryFetch by accepting node-fetch params
14
- - 12f029a: Add changeset maker
15
- - b7277cf: Add public instance URL calculators and refactor HTTP protocol detection
16
- - 45a8f45: Add internal app (remote control) support
17
- - 55b43a1: Remove unneeded params from GetOrProvisionInstanceUrl filter
18
- - 5be2c9e: Initial commit
19
- - a236f3e: Added several more filters
20
- - 35edc77: Enhancement: actions execute sequentially
21
- - 879845a: Enhancement: unsubscribe from filters
22
- - c473ed9: Added support for priorities in actions
23
- - 795fcd7: New action: KillInstance
24
- - c32b845: Added support for Settings filter whereby all settings are collected and displayed in DEBUG() mode
25
- - cce72b3: New action: AfterPluginsLoaded
26
- - 82dde2d: Enhancement: filters now have extensible data types
27
-
28
- ### Patch Changes
29
-
30
- - b55c585: Clean up dead code
31
- - 0e4bf43: Updated commit parser deps
32
- - f79b067: Added serve command details
33
- - dd3ceaa: Added filter debugging
34
- - 7931204: Fixed a bug where adding plugins was not saved correctly
35
- - 6e14f57: Updated plugin authoring guide
36
- - 7604930: Minor fix to GetOrProvisionInstanceUrl filter
37
- - 52b70cb: Fixed bug where --extra-plugins was not defaulting to '' correctly
38
- - Updated dependencies [c32b845]
39
- - @pockethost/plugin-launcher-spawn@1.0.0
40
- - @pockethost/plugin-auto-admin@1.0.0
41
- - @pockethost/plugin-console-logger@1.0.0
42
-
43
- ## 1.5.0
25
+ - SFTP-only deploy vendor: dropped legacy FTPS/FTP codepath and `basic-ftp` dependency
26
+ - Node `>=18` (hosting stack still requires Node 24)
27
+ - Dropped `fs-extra` and `email-validator`; leaner install
28
+
29
+ ## 0.4.0
44
30
 
45
31
  ### Minor Changes
46
32
 
47
- - 5e9ed51: Added `--extra-plugins` global switch to temporarily load extra plugins from CLI
48
- - 2376b0d: Add InstanceConfig filter, fix instance logger namespace, add core instance app lib
49
- - 737b4b8: logSettings now exported from core
50
- - 114b1d2: Add namespace() export to core Logger service
33
+ - SFTP deploy and dev sync (`ftp.pockethost.io:2222`, Ed25519 key auth)
34
+ - `phio sftp` — interactive SFTP via system client (`--print` for the command line)
35
+ - Auto-provision deploy key labeled `Phio` under Account → Keys
36
+ - Project instance linking via `.phioconfig` (migrates legacy `package.json` / `pockethost.json`)
37
+ - Walk up to project root from subdirectories before sync
38
+
39
+ ## 0.3.5
51
40
 
52
41
  ### Patch Changes
53
42
 
54
- - 211fba6: Plugin authoring docs update
55
- - 675e634: Added docs and updated maildev with plugin hook guards
56
- - 3daf7f5: Fix: [INFO] logging prefixes
57
- - 139468f: Updated documentation
58
- - 1e5321b: Fix: improve plugin loading order
59
- - Updated dependencies [517f602]
60
- - @pockethost/plugin-launcher-spawn@0.3.0
61
- - @pockethost/plugin-console-logger@0.2.1
62
- - @pockethost/plugin-auto-admin@0.1.1
43
+ - Fix: add support for bun.lock
63
44
 
64
- ## 1.4.0
45
+ ## 0.3.4
65
46
 
66
- ### Minor Changes
47
+ ### Patch Changes
48
+
49
+ - 24988ee: Feat: logout command
50
+ - de7168b: Fix: various auth fixes
51
+ - 6262058: Fix: use correct token for log watching
52
+ - 5d28256: Enhance logs command with improved streaming and error handling
53
+
54
+ ## 0.3.3
67
55
 
68
- - b7e4323: Added ability for plugins to respond to `pockethost serve`
56
+ ### Patch Changes
57
+
58
+ - 4bf6d1e: Fix: use client auth token instead of stored token
69
59
 
70
- ## 1.3.2
60
+ ## 0.3.2
71
61
 
72
62
  ### Patch Changes
73
63
 
74
- - b0a78d8: Updated plugin authoring guide
75
- - ac63ea7: Updated plugin documentation
76
- - Updated dependencies [eb0d011]
77
- - Updated dependencies [38d2c93]
78
- - @pockethost/plugin-launcher-spawn@0.2.0
79
- - @pockethost/plugin-console-logger@0.2.0
80
- - @pockethost/plugin-auto-admin@0.1.0
64
+ - b85e156: Fix: nodev22 compat
81
65
 
82
- ## 1.3.1
66
+ ## 0.3.1
83
67
 
84
68
  ### Patch Changes
85
69
 
86
- - 8288197: Added plugin authoring guide
70
+ - fd128bc: Node v22 compat
87
71
 
88
- ## 1.3.0
72
+ ## 0.3.0
89
73
 
90
74
  ### Minor Changes
91
75
 
92
- - 96f355a: Now auto-creates first admin account by default
93
- - 2fc2eeb: Added before/after instance start/stop events
94
- - 3f99ea0: Added subdomain to request action and filter context
95
- - 1384a86: BREAKING: refactored actions/filters
76
+ - 82b4c6b: Add support for PHIO_USERNAME, PHIO_PASSWORD, and PHIO_INSTANCE_NAME env vars
77
+ - 82b4c6b: Migrate to instance names only (no IDs)
78
+ - 82b4c6b: Remove support for global instance name - local package.json or pockethost.json required now
79
+
80
+ ### Patch Changes
81
+
82
+ - 1b46e08: Alphabetize instance lists
83
+ - 82b4c6b: Improved error message reporting
84
+
85
+ ## 0.2.5
86
+
87
+ ### Patch Changes
88
+
89
+ - 283da4e: Add 'info' command
90
+ - b17fca2: Add error handling when 'link' returns no instances
91
+ - 8aaa611: Add 'ls' alias
92
+
93
+ ## 0.2.4
94
+
95
+ ### Patch Changes
96
+
97
+ - Fix: --include and --exclude now parse comma separated values correctly
98
+
99
+ ## 0.2.3
96
100
 
97
101
  ### Patch Changes
98
102
 
99
- - 6812784: Added improved error parsing support
100
- - da82667: Fix: properly determine hostname when running on nonstandard port
101
- - cc4aa02: Moved mothership-related code into mothership plugin
102
- - Updated dependencies [9d626ec]
103
- - @pockethost/plugin-launcher-spawn@0.1.0
104
- - @pockethost/plugin-console-logger@0.1.0
103
+ - Fix: bad include path
105
104
 
106
- ## 1.2.0
105
+ ## 0.2.2
106
+
107
+ ### Patch Changes
108
+
109
+ - 467c4ba: Enh: Validate auth before tailing instance logs
110
+ - 4e8ddb5: Fix: auth token now stored correctly after refresh
111
+
112
+ ## 0.2.1
113
+
114
+ ### Patch Changes
115
+
116
+ - Fix: Link now uses package.json
117
+
118
+ ## 0.2.0
107
119
 
108
120
  ### Minor Changes
109
121
 
110
- - 72a6c6d: --version now displays version number
111
- - ac10d1f: Display notification when new pockethost update is available.
112
- - f9aea10: Debugging info removed from `plugin ls`
122
+ - Introduced deploy command
123
+
124
+ ### Patch Changes
125
+
126
+ - Command refactoring
127
+
128
+ ## 0.1.2
113
129
 
114
130
  ### Patch Changes
115
131
 
116
- - 76d57f6: CHANGELOG.md is now published with package.
117
- - 3783447: plugin-console-logger and plugin-launcher-spawn are now automatically installed.
132
+ - Enh: add --verbose flag to dev mode
118
133
 
119
- ## 1.1.0
134
+ ## 0.1.1
135
+
136
+ ### Patch Changes
137
+
138
+ - Fix: include and exclude defaults
139
+
140
+ ## 0.1.0
120
141
 
121
142
  ### Minor Changes
122
143
 
123
- - 1695b59: New feature: list plugins (pockethost plugin ls)
144
+ - afc6e91: Added `link` command to link to a specific instance
145
+ - fff79df: pockethost.io now runs `bun install` when uploading a `bun.lockb`
146
+ - 9fc57d6: Added whoami command
147
+ - 9fc57d6: Added list command
148
+ - afc6e91: Added --include and --exclude options to dev watch mode
149
+
150
+ ### Patch Changes
151
+
152
+ - afc6e91: Fix: log tailer will now restart on disconnect
153
+ - fff79df: Enh: watcher now looks for package.json and bun.lockb
154
+ - fff79df: Fix: watcher was incorrectly applying --include and --exclude
155
+ - fff79df: Enh: watcher now queues successive deployments that happen in rapid succession
156
+
157
+ ## 0.0.2
158
+
159
+ ### Patch Changes
160
+
161
+ - Forgot tsx dep
162
+
163
+ ## 0.0.1
124
164
 
125
165
  ### Patch Changes
126
166
 
127
- - 2514c09: Fix: make sure PH_PLUGINS contains only unique values.
128
- - 1228840: Fixed extra newline when listing configs
167
+ - a5bf2f3: Initial version
package/README.md ADDED
@@ -0,0 +1,96 @@
1
+ # pockethost: the PocketHost CLI
2
+
3
+ Deploy, sync, and tail logs for your [PocketHost](https://pockethost.io) instances.
4
+
5
+ Install globally (Node.js 20+):
6
+
7
+ ```bash
8
+ npm install -g pockethost
9
+ ```
10
+
11
+ ### Upgrading from `phio`
12
+
13
+ `phio` is now `pockethost`. Swap the package:
14
+
15
+ ```bash
16
+ npm rm -g phio && npm i -g pockethost
17
+ ```
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
20
+ renamed to `.pockethostconfig` (commit it), and the `PHIO_*` environment variables keep working with a warning until
21
+ you rename them to `POCKETHOST_*`.
22
+
23
+ ## Commands
24
+
25
+ ```bash
26
+ pockethost login
27
+ pockethost logout
28
+ pockethost info # alias: pockethost whoami
29
+ pockethost list # alias: pockethost ls
30
+ pockethost link [instance]
31
+ pockethost dev [instance]
32
+ pockethost deploy [instance]
33
+ pockethost sftp [instance]
34
+ pockethost logs [instance]
35
+ ```
36
+
37
+ - **`pockethost dev`**: watch local changes and sync over SFTP
38
+ - **`pockethost deploy`**: one-shot SFTP sync
39
+ - **`pockethost sftp`**: interactive SFTP session (uses system `sftp` when available)
40
+ - **`pockethost logs`**: tail instance logs
41
+
42
+ `dev` and `deploy` accept `-v/--verbose`, `-i/--include`, and `-e/--exclude`.
43
+
44
+ Default includes: `pb_*`, `package.json`, `bun.lock`, `bun.lockb`, `patches/**`.
45
+
46
+ Default excludes: `pb_data/**`.
47
+
48
+ ## Configuration
49
+
50
+ Link a project directory to an instance:
51
+
52
+ ```bash
53
+ pockethost link my-instance
54
+ ```
55
+
56
+ This writes `.pockethostconfig`:
57
+
58
+ ```json
59
+ {
60
+ "instanceName": "my-instance"
61
+ }
62
+ ```
63
+
64
+ Older project files (`.phioconfig`, `package.json` → `pockethost.instanceName`, `pockethost.json`) are migrated to
65
+ `.pockethostconfig` automatically on first use.
66
+
67
+ ## Deploy key
68
+
69
+ `pockethost dev` and `pockethost deploy` sync over **SFTP** (`ftp.pockethost.io:2222`) using an Ed25519 deploy key
70
+ stored under `POCKETHOST_HOME` (default `~/.config/pockethost/`). The CLI auto-registers a **`PocketHost CLI`** key
71
+ under Account → Keys on first use (an existing **`Phio`** key from phio is reused). Run `pockethost info` to inspect
72
+ key status.
73
+
74
+ Customer docs: https://pockethost.io/docs/cli
75
+
76
+ ## Environment variables
77
+
78
+ | Variable | Purpose |
79
+ | -------- | ------- |
80
+ | `POCKETHOST_USERNAME` | Override saved email (non-interactive login) |
81
+ | `POCKETHOST_PASSWORD` | Override saved password |
82
+ | `POCKETHOST_INSTANCE_NAME` | Override linked instance name |
83
+ | `POCKETHOST_MOTHERSHIP_URL` | Override mothership API URL |
84
+ | `POCKETHOST_HOME` | Override config directory |
85
+ | `POCKETHOST_PROJECT_DIR` | Override project root detection |
86
+
87
+ Environment variables take precedence over `.pockethostconfig`. The old `PHIO_*` names still work (with a deprecation
88
+ warning) and will be removed in the next major version.
89
+
90
+ ## Development (monorepo)
91
+
92
+ ```bash
93
+ pnpm dev:cli-client -- --help # from the repo root, runs src/ with tsx
94
+ pnpm --filter pockethost build # bundle to dist/cli.js
95
+ pnpm --filter pockethost test
96
+ ```