@hagicode/hagiscript 0.1.15-dev.91.1.7ddec89 → 0.1.15-dev.95.1.042739d
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/README.md +237 -175
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/manifest-commands.d.ts +2 -0
- package/dist/commands/manifest-commands.js +136 -0
- package/dist/commands/manifest-commands.js.map +1 -0
- package/dist/commands/npm-sync-commands.js +63 -6
- package/dist/commands/npm-sync-commands.js.map +1 -1
- package/dist/commands/server-commands.js +181 -7
- package/dist/commands/server-commands.js.map +1 -1
- package/dist/index.d.ts +7 -4
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/runtime/manifest-manager.d.ts +57 -0
- package/dist/runtime/manifest-manager.js +213 -0
- package/dist/runtime/manifest-manager.js.map +1 -0
- package/dist/runtime/npm-sync.d.ts +3 -1
- package/dist/runtime/npm-sync.js +31 -3
- package/dist/runtime/npm-sync.js.map +1 -1
- package/dist/runtime/pm2-manager.d.ts +4 -2
- package/dist/runtime/pm2-manager.js +181 -53
- package/dist/runtime/pm2-manager.js.map +1 -1
- package/dist/runtime/runtime-executor.d.ts +6 -0
- package/dist/runtime/runtime-executor.js +55 -0
- package/dist/runtime/runtime-executor.js.map +1 -1
- package/dist/runtime/runtime-manager.d.ts +9 -0
- package/dist/runtime/runtime-manager.js +146 -16
- package/dist/runtime/runtime-manager.js.map +1 -1
- package/dist/runtime/runtime-manifest.d.ts +5 -1
- package/dist/runtime/runtime-manifest.js +23 -8
- package/dist/runtime/runtime-manifest.js.map +1 -1
- package/dist/runtime/runtime-paths.d.ts +11 -1
- package/dist/runtime/runtime-paths.js +41 -5
- package/dist/runtime/runtime-paths.js.map +1 -1
- package/dist/runtime/server-config.d.ts +21 -0
- package/dist/runtime/server-config.js +169 -0
- package/dist/runtime/server-config.js.map +1 -0
- package/dist/runtime/server-manager.d.ts +48 -4
- package/dist/runtime/server-manager.js +499 -66
- package/dist/runtime/server-manager.js.map +1 -1
- package/dist/runtime/server-version-state.d.ts +43 -0
- package/dist/runtime/server-version-state.js +156 -0
- package/dist/runtime/server-version-state.js.map +1 -0
- package/dist/runtime/tool-sync-catalog.config.json +0 -18
- package/dist/runtime/tool-sync-catalog.js +1 -1
- package/dist/runtime/tool-sync-catalog.js.map +1 -1
- package/package.json +23 -2
- package/runtime/lib/runtime-script-lib.mjs +128 -69
- package/runtime/manifest.yaml +96 -81
- package/runtime/scripts/configure-code-server.mjs +14 -3
- package/runtime/scripts/configure-omniroute.mjs +15 -5
- package/runtime/scripts/install-code-server.mjs +20 -23
- package/runtime/scripts/install-omniroute.mjs +19 -22
- package/runtime/scripts/install-pm2.mjs +39 -0
- package/runtime/scripts/remove-pm2.mjs +25 -0
- package/runtime/templates/code-server-config.yaml +2 -2
- package/runtime/templates/omniroute-config.yaml +1 -1
package/README.md
CHANGED
|
@@ -4,317 +4,379 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/@hagicode/hagiscript)
|
|
5
5
|
[](./LICENSE)
|
|
6
6
|
|
|
7
|
-
`@hagicode/hagiscript` is the
|
|
7
|
+
`@hagicode/hagiscript` is the CLI used to install and operate a managed HagiCode runtime. It manages the runtime layout, bundled services, managed npm tools, and the released backend server from a manifest-driven workflow.
|
|
8
8
|
|
|
9
|
-
## Install
|
|
9
|
+
## Install The CLI
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
npm install -g @hagicode/hagiscript
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Check the installed version:
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
```bash
|
|
18
|
+
hagiscript --version
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
For a first-time setup, run these commands in order:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install -g @hagicode/hagiscript
|
|
27
|
+
hagiscript runtime install
|
|
28
|
+
hagiscript server install
|
|
29
|
+
hagiscript server start
|
|
30
|
+
hagiscript server status
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
If you also want the npm tools declared in your runtime manifest:
|
|
19
34
|
|
|
20
|
-
|
|
35
|
+
```bash
|
|
36
|
+
hagiscript npm-sync --runtime-root ~/.hagicode/runtime
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
If you are working with a custom manifest or runtime root, use the same flow with explicit paths:
|
|
21
40
|
|
|
22
|
-
|
|
41
|
+
```bash
|
|
42
|
+
hagiscript runtime install \
|
|
43
|
+
--from-manifest ./runtime/manifest.yaml \
|
|
44
|
+
--runtime-root ~/.hagicode/runtime
|
|
23
45
|
|
|
24
|
-
|
|
46
|
+
hagiscript server install \
|
|
47
|
+
--from-manifest ./runtime/manifest.yaml \
|
|
48
|
+
--runtime-root ~/.hagicode/runtime
|
|
25
49
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
bin/
|
|
30
|
-
npm/
|
|
31
|
-
components/
|
|
32
|
-
runtime-data/
|
|
33
|
-
config/
|
|
34
|
-
logs/
|
|
35
|
-
data/
|
|
36
|
-
components/
|
|
37
|
-
state.json
|
|
50
|
+
hagiscript server start \
|
|
51
|
+
--from-manifest ./runtime/manifest.yaml \
|
|
52
|
+
--runtime-root ~/.hagicode/runtime
|
|
38
53
|
```
|
|
39
54
|
|
|
40
|
-
|
|
55
|
+
## What Hagiscript Manages
|
|
56
|
+
|
|
57
|
+
The packaged runtime manifest defines these default components:
|
|
41
58
|
|
|
42
|
-
- `
|
|
43
|
-
- `
|
|
59
|
+
- `node`: managed Node.js runtime
|
|
60
|
+
- `dotnet`: managed .NET runtime
|
|
61
|
+
- `omniroute`: bundled PM2-managed service
|
|
62
|
+
- `code-server`: bundled PM2-managed service
|
|
63
|
+
- `server`: released backend service package
|
|
44
64
|
|
|
45
|
-
The
|
|
65
|
+
The managed runtime layout separates immutable program files from mutable data:
|
|
46
66
|
|
|
47
|
-
- `
|
|
48
|
-
- `
|
|
49
|
-
- `server
|
|
50
|
-
- `
|
|
51
|
-
- `code-server` - vendored bundled runtime
|
|
67
|
+
- `program/`: installed runtime payloads, wrappers, bundled executables
|
|
68
|
+
- `runtime-data/`: mutable config, logs, PM2 state, managed npm packages
|
|
69
|
+
- `server/`: installed released server versions
|
|
70
|
+
- `server-data/`: server config, logs, PM2 runtime files, version state
|
|
52
71
|
|
|
53
|
-
|
|
72
|
+
By default, the packaged manifest installs into `~/.hagicode/runtime`, but you can override that with `--runtime-root`.
|
|
54
73
|
|
|
55
|
-
##
|
|
74
|
+
## Runtime Basics
|
|
56
75
|
|
|
57
|
-
|
|
76
|
+
Create a standalone editable manifest from Hagiscript's packaged default:
|
|
58
77
|
|
|
59
78
|
```bash
|
|
60
|
-
hagiscript
|
|
79
|
+
hagiscript manifest init ./hagiscript.manifest.yaml
|
|
61
80
|
```
|
|
62
81
|
|
|
63
|
-
|
|
82
|
+
Generate a manifest and set the managed layout at the same time:
|
|
64
83
|
|
|
65
|
-
|
|
84
|
+
```bash
|
|
85
|
+
hagiscript manifest init ./hagiscript.manifest.yaml \
|
|
86
|
+
--runtime-home program \
|
|
87
|
+
--runtime-data-root runtime-data \
|
|
88
|
+
--server-program-root server \
|
|
89
|
+
--server-data-root server-data
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Update an existing manifest after initialization:
|
|
66
93
|
|
|
67
94
|
```bash
|
|
68
|
-
hagiscript
|
|
95
|
+
hagiscript manifest set ./hagiscript.manifest.yaml \
|
|
96
|
+
--npm-package-version pm2=7.0.2 \
|
|
97
|
+
--npm-package-version @openai/codex=0.126.0 \
|
|
98
|
+
--server-active-version 0.1.0-beta.60
|
|
69
99
|
```
|
|
70
100
|
|
|
71
|
-
|
|
101
|
+
Print the current manifest summary in a friendlier format:
|
|
72
102
|
|
|
73
103
|
```bash
|
|
74
|
-
hagiscript
|
|
75
|
-
|
|
104
|
+
hagiscript manifest get ./hagiscript.manifest.yaml
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Install the default runtime:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
hagiscript runtime install
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Install from an explicit manifest into a specific root:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
hagiscript runtime install \
|
|
117
|
+
--from-manifest ./runtime/manifest.yaml \
|
|
118
|
+
--runtime-root ~/.hagicode/runtime
|
|
76
119
|
```
|
|
77
120
|
|
|
78
|
-
|
|
121
|
+
Show the current runtime state:
|
|
79
122
|
|
|
80
123
|
```bash
|
|
81
124
|
hagiscript runtime state
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Show machine-readable state:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
82
130
|
hagiscript runtime state --json
|
|
83
131
|
```
|
|
84
132
|
|
|
85
|
-
|
|
133
|
+
Preview what would be installed without changing files:
|
|
86
134
|
|
|
87
135
|
```bash
|
|
88
|
-
hagiscript runtime
|
|
89
|
-
hagiscript runtime remove --components code-server --purge
|
|
136
|
+
hagiscript runtime install --dry-run
|
|
90
137
|
```
|
|
91
138
|
|
|
92
|
-
|
|
139
|
+
Update installed components:
|
|
93
140
|
|
|
94
141
|
```bash
|
|
95
|
-
hagiscript runtime
|
|
96
|
-
hagiscript runtime state --from-manifest /path/to/runtime-manifest.yaml --json
|
|
142
|
+
hagiscript runtime update
|
|
97
143
|
```
|
|
98
144
|
|
|
99
|
-
|
|
145
|
+
Only check whether updates are needed:
|
|
100
146
|
|
|
101
147
|
```bash
|
|
102
|
-
|
|
148
|
+
hagiscript runtime update --check-only
|
|
103
149
|
```
|
|
104
150
|
|
|
105
|
-
|
|
151
|
+
Remove the runtime but keep retained data where supported:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
hagiscript runtime remove
|
|
155
|
+
```
|
|
106
156
|
|
|
107
|
-
|
|
157
|
+
Purge runtime data as well:
|
|
108
158
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
- per-component runtime data homes
|
|
113
|
-
- derived PM2 homes for managed services
|
|
114
|
-
- program/data path separation
|
|
159
|
+
```bash
|
|
160
|
+
hagiscript runtime remove --purge
|
|
161
|
+
```
|
|
115
162
|
|
|
116
|
-
|
|
163
|
+
Operate on selected components only:
|
|
117
164
|
|
|
118
|
-
|
|
165
|
+
```bash
|
|
166
|
+
hagiscript runtime install --components node,dotnet
|
|
167
|
+
hagiscript runtime update --components code-server,omniroute
|
|
168
|
+
hagiscript runtime remove --components code-server --purge
|
|
169
|
+
```
|
|
119
170
|
|
|
120
|
-
|
|
121
|
-
2. Apply changes: `hagiscript runtime install`, `update`, or `remove`
|
|
122
|
-
3. Re-check state to confirm the final layout
|
|
123
|
-
4. Operate services through `hagiscript pm2 ...`
|
|
171
|
+
## Runtime Install Workflow
|
|
124
172
|
|
|
125
|
-
|
|
173
|
+
The typical runtime flow is:
|
|
126
174
|
|
|
127
|
-
|
|
175
|
+
```bash
|
|
176
|
+
hagiscript runtime install
|
|
177
|
+
hagiscript runtime state
|
|
178
|
+
hagiscript runtime update
|
|
179
|
+
```
|
|
128
180
|
|
|
129
|
-
|
|
181
|
+
If you want a clean rebuild:
|
|
130
182
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
183
|
+
```bash
|
|
184
|
+
hagiscript runtime remove --purge
|
|
185
|
+
hagiscript runtime install
|
|
186
|
+
```
|
|
134
187
|
|
|
135
|
-
|
|
188
|
+
## Server Install And Management
|
|
136
189
|
|
|
137
|
-
|
|
138
|
-
- `restart`
|
|
139
|
-
- `stop`
|
|
140
|
-
- `status`
|
|
141
|
-
- `env`
|
|
190
|
+
The managed server is installed separately from the core runtime. `hagiscript server install` ensures runtime dependencies are available, resolves a released server package, and makes that version active.
|
|
142
191
|
|
|
143
|
-
|
|
192
|
+
Install the server from the default source:
|
|
144
193
|
|
|
145
194
|
```bash
|
|
146
|
-
hagiscript
|
|
147
|
-
hagiscript pm2 server restart
|
|
148
|
-
hagiscript pm2 server status
|
|
149
|
-
hagiscript pm2 server env
|
|
150
|
-
hagiscript pm2 server env --json
|
|
151
|
-
hagiscript pm2 omniroute status
|
|
152
|
-
hagiscript pm2 omniroute start
|
|
153
|
-
hagiscript pm2 code-server stop
|
|
195
|
+
hagiscript server install
|
|
154
196
|
```
|
|
155
197
|
|
|
156
|
-
|
|
198
|
+
Install the server against an explicit runtime manifest and root:
|
|
157
199
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
-
|
|
161
|
-
-
|
|
200
|
+
```bash
|
|
201
|
+
hagiscript server install \
|
|
202
|
+
--from-manifest ./runtime/manifest.yaml \
|
|
203
|
+
--runtime-root ~/.hagicode/runtime
|
|
204
|
+
```
|
|
162
205
|
|
|
163
|
-
|
|
206
|
+
Install from a local archive:
|
|
164
207
|
|
|
165
|
-
|
|
208
|
+
```bash
|
|
209
|
+
hagiscript server install --archive ./hagicode-server.zip
|
|
210
|
+
```
|
|
166
211
|
|
|
167
|
-
|
|
212
|
+
Install from a specific index version:
|
|
168
213
|
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
lib/PCode.Web.dll
|
|
172
|
-
lib/PCode.Web.deps.json
|
|
173
|
-
lib/PCode.Web.runtimeconfig.json
|
|
174
|
-
start.sh (or the platform equivalent from the release package)
|
|
214
|
+
```bash
|
|
215
|
+
hagiscript server install --index-version 0.1.0-beta.60
|
|
175
216
|
```
|
|
176
217
|
|
|
177
|
-
|
|
218
|
+
List installed server versions and the active version:
|
|
178
219
|
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
.pm2/
|
|
182
|
-
pm2-runtime/
|
|
220
|
+
```bash
|
|
221
|
+
hagiscript server list
|
|
183
222
|
```
|
|
184
223
|
|
|
185
|
-
|
|
224
|
+
Switch the active version:
|
|
186
225
|
|
|
187
|
-
|
|
226
|
+
```bash
|
|
227
|
+
hagiscript server use 0.1.0-beta.60
|
|
228
|
+
```
|
|
188
229
|
|
|
189
|
-
|
|
230
|
+
Remove an installed version:
|
|
190
231
|
|
|
191
232
|
```bash
|
|
192
|
-
hagiscript server
|
|
193
|
-
hagiscript server install --package-dir /srv/hagicode/packages
|
|
194
|
-
hagiscript server install --archive ./hagicode-1.2.3-linux-x64-nort.zip
|
|
195
|
-
hagiscript server install --url https://example.com/hagicode-1.2.3-linux-x64-nort.zip
|
|
196
|
-
hagiscript server install --github-repo HagiCode-org/releases --tag v1.2.3
|
|
233
|
+
hagiscript server remove 0.1.0-beta.60
|
|
197
234
|
```
|
|
198
235
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
- selects or downloads a server archive
|
|
202
|
-
- extracts and stages it into `program/components/server/current/`
|
|
203
|
-
- runs `hagiscript runtime install --components server`
|
|
204
|
-
- ensures `pm2` exists in the managed npm prefix
|
|
236
|
+
## Server Lifecycle
|
|
205
237
|
|
|
206
|
-
|
|
238
|
+
Start the managed server:
|
|
207
239
|
|
|
208
240
|
```bash
|
|
209
241
|
hagiscript server start
|
|
210
|
-
hagiscript server restart --instance demo
|
|
211
|
-
hagiscript server stop --instance demo
|
|
212
|
-
hagiscript server status --json
|
|
213
|
-
hagiscript server env --instance demo
|
|
214
242
|
```
|
|
215
243
|
|
|
216
|
-
|
|
244
|
+
Stop it:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
hagiscript server stop
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Restart it:
|
|
217
251
|
|
|
218
|
-
|
|
252
|
+
```bash
|
|
253
|
+
hagiscript server restart
|
|
254
|
+
```
|
|
219
255
|
|
|
220
|
-
|
|
256
|
+
Check status:
|
|
221
257
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
- `PATH` - rebuilt so managed Node, managed npm, and managed wrappers come first
|
|
258
|
+
```bash
|
|
259
|
+
hagiscript server status
|
|
260
|
+
```
|
|
226
261
|
|
|
227
|
-
|
|
262
|
+
Show the startup environment:
|
|
228
263
|
|
|
229
|
-
|
|
264
|
+
```bash
|
|
265
|
+
hagiscript server env
|
|
266
|
+
```
|
|
230
267
|
|
|
231
|
-
|
|
268
|
+
Emit JSON for status or environment:
|
|
232
269
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
- `paths.defaultPm2Home`
|
|
238
|
-
- component `runtimeDataDir`
|
|
239
|
-
- service `pm2.appName`
|
|
240
|
-
- service `pm2.cwd`
|
|
241
|
-
- service `pm2.script`
|
|
242
|
-
- service `pm2.args`
|
|
243
|
-
- service `pm2.env`
|
|
244
|
-
- service `pm2.pm2Home`
|
|
270
|
+
```bash
|
|
271
|
+
hagiscript server status --json
|
|
272
|
+
hagiscript server env --json
|
|
273
|
+
```
|
|
245
274
|
|
|
246
|
-
|
|
275
|
+
Override the PM2 instance name used for namespaced app names:
|
|
247
276
|
|
|
248
|
-
|
|
277
|
+
```bash
|
|
278
|
+
hagiscript server start --instance myruntime
|
|
279
|
+
```
|
|
249
280
|
|
|
250
|
-
|
|
281
|
+
## Server Configuration
|
|
251
282
|
|
|
252
|
-
|
|
283
|
+
Read the effective managed server config:
|
|
253
284
|
|
|
254
285
|
```bash
|
|
255
|
-
hagiscript
|
|
256
|
-
hagiscript install-node --target /opt/hagiscript/node22 --version 22
|
|
286
|
+
hagiscript server config get
|
|
257
287
|
```
|
|
258
288
|
|
|
259
|
-
|
|
289
|
+
Update host and port:
|
|
260
290
|
|
|
261
|
-
|
|
291
|
+
```bash
|
|
292
|
+
hagiscript server config set --host 127.0.0.1 --port 39150
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
Read the config as JSON:
|
|
262
296
|
|
|
263
297
|
```bash
|
|
264
|
-
hagiscript
|
|
298
|
+
hagiscript server config get --json
|
|
265
299
|
```
|
|
266
300
|
|
|
267
|
-
|
|
301
|
+
## Managed NPM Tool Sync
|
|
268
302
|
|
|
269
|
-
|
|
303
|
+
The runtime manifest can also declare managed npm packages under `npmSync`. These packages are installed into the managed npm prefix under `runtime-data/npm`, not into `program/`.
|
|
304
|
+
|
|
305
|
+
If the managed runtime has already been installed, `npm-sync` can read `runtime-data/state.json` under the selected runtime and automatically reuse the recorded `manifestPath` and managed npm prefix. In that case you do not need to pass `--from-manifest`.
|
|
306
|
+
|
|
307
|
+
Sync npm packages by pointing at the runtime root:
|
|
270
308
|
|
|
271
309
|
```bash
|
|
272
|
-
hagiscript npm-sync --
|
|
273
|
-
hagiscript npm-sync --runtime /opt/hagiscript/node --manifest ./manifest.json
|
|
274
|
-
hagiscript npm-sync --managed-runtime ~/.hagicode/runtime/program/components/node/runtime --prefix ~/.hagicode/runtime/program/npm --manifest ./manifest.json
|
|
310
|
+
hagiscript npm-sync --runtime-root ~/.hagicode/runtime
|
|
275
311
|
```
|
|
276
312
|
|
|
277
|
-
|
|
313
|
+
Sync npm packages declared in a runtime manifest:
|
|
278
314
|
|
|
279
|
-
|
|
315
|
+
```bash
|
|
316
|
+
hagiscript npm-sync --from-manifest ./runtime/manifest.yaml
|
|
317
|
+
```
|
|
280
318
|
|
|
281
|
-
|
|
319
|
+
`npm-sync` does not define its own program/data/server root layout. It reads the runtime manifest associated with the selected runtime root and follows that manifest's `npmSync` definition.
|
|
282
320
|
|
|
283
|
-
|
|
321
|
+
If you want to change the npm tool versions captured in a manifest, update the manifest first:
|
|
284
322
|
|
|
285
323
|
```bash
|
|
286
|
-
|
|
287
|
-
npm
|
|
288
|
-
npm
|
|
289
|
-
npm run pack:check
|
|
324
|
+
hagiscript manifest set ./hagiscript.manifest.yaml \
|
|
325
|
+
--npm-package-version pm2=7.0.2 \
|
|
326
|
+
--npm-package-version @openai/codex=0.126.0
|
|
290
327
|
```
|
|
291
328
|
|
|
292
|
-
|
|
329
|
+
Use an explicit managed Node runtime and prefix:
|
|
293
330
|
|
|
294
331
|
```bash
|
|
295
|
-
npm
|
|
296
|
-
|
|
297
|
-
|
|
332
|
+
hagiscript npm-sync \
|
|
333
|
+
--from-manifest ./runtime/manifest.yaml \
|
|
334
|
+
--managed-runtime ~/.hagicode/runtime/program/components/node/runtime \
|
|
335
|
+
--prefix ~/.hagicode/runtime/runtime-data/npm
|
|
298
336
|
```
|
|
299
337
|
|
|
300
|
-
|
|
338
|
+
Force re-sync even if installed versions already satisfy the requested target:
|
|
301
339
|
|
|
302
340
|
```bash
|
|
303
|
-
npm
|
|
341
|
+
hagiscript npm-sync --from-manifest ./runtime/manifest.yaml --force
|
|
304
342
|
```
|
|
305
343
|
|
|
306
|
-
|
|
344
|
+
## Common End-To-End Flow
|
|
345
|
+
|
|
346
|
+
For a fresh machine or a new runtime root, this is the usual sequence:
|
|
307
347
|
|
|
308
348
|
```bash
|
|
309
|
-
|
|
349
|
+
hagiscript runtime install
|
|
350
|
+
hagiscript server install
|
|
351
|
+
hagiscript server start
|
|
352
|
+
hagiscript server status
|
|
310
353
|
```
|
|
311
354
|
|
|
312
|
-
|
|
355
|
+
If you also want the manifest-declared npm tools:
|
|
313
356
|
|
|
314
357
|
```bash
|
|
315
|
-
|
|
358
|
+
hagiscript npm-sync --runtime-root ~/.hagicode/runtime
|
|
316
359
|
```
|
|
317
360
|
|
|
361
|
+
## Useful Flags
|
|
362
|
+
|
|
363
|
+
- `manifest init [path]`: generate an editable manifest from the packaged default
|
|
364
|
+
- `manifest get [path]`: print a readable summary of the current manifest
|
|
365
|
+
- `manifest set <path>`: update manifest paths, npmSync package versions, or server defaults
|
|
366
|
+
- `--from-manifest <path>`: use a specific runtime manifest YAML
|
|
367
|
+
- `--runtime-root <path>`: change the managed runtime root
|
|
368
|
+
- `--runtime-home <path>`: set the manifest's program root
|
|
369
|
+
- `--runtime-data-root <path>`: set the manifest's runtime-data root
|
|
370
|
+
- `--server-program-root <path>`: set the manifest's server program root
|
|
371
|
+
- `--server-data-root <path>`: set the manifest's server data root
|
|
372
|
+
- `--npm-package-version <package=version>`: update a manifest npmSync package entry
|
|
373
|
+
- `--server-active-version <version>`: set the manifest's preferred managed server version
|
|
374
|
+
- `--components <list>`: target specific runtime components
|
|
375
|
+
- `--dry-run`: print the plan without mutating files
|
|
376
|
+
- `--force`: force reinstall or update where supported
|
|
377
|
+
- `--purge`: remove retained mutable data during runtime removal
|
|
378
|
+
- `--json`: emit machine-readable output for `manifest get`, state, status, env, and config commands
|
|
379
|
+
|
|
318
380
|
## License
|
|
319
381
|
|
|
320
382
|
MIT. See [LICENSE](./LICENSE).
|
package/dist/cli.js
CHANGED
|
@@ -3,6 +3,7 @@ import { realpathSync } from "node:fs";
|
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { Command } from "commander";
|
|
5
5
|
import { createRuntimeInfo, packageVersion } from "./index.js";
|
|
6
|
+
import { registerManifestCommands } from "./commands/manifest-commands.js";
|
|
6
7
|
import { registerNpmSyncCommand } from "./commands/npm-sync-commands.js";
|
|
7
8
|
import { registerNodeRuntimeCommands } from "./commands/node-runtime-commands.js";
|
|
8
9
|
import { registerPm2Commands } from "./commands/pm2-commands.js";
|
|
@@ -22,6 +23,7 @@ export function createCli() {
|
|
|
22
23
|
process.stdout.write(`${JSON.stringify(info, null, 2)}\n`);
|
|
23
24
|
});
|
|
24
25
|
registerNodeRuntimeCommands(program);
|
|
26
|
+
registerManifestCommands(program);
|
|
25
27
|
registerNpmSyncCommand(program);
|
|
26
28
|
registerPm2Commands(program);
|
|
27
29
|
registerRuntimeCommands(program);
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OA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