@neottia/cli 0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dragos Cirjan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # @neottia/cli
2
+
3
+ `@neottia/cli` publishes the `neottia` command for reviewing and applying asset installation plans.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ pnpm add --global @neottia/cli
9
+ ```
10
+
11
+ ## Commands
12
+
13
+ ```sh
14
+ neottia plan --manifest manifest.json --output install.plan.json
15
+ neottia apply --plan install.plan.json
16
+ neottia plan --action update --manifest manifest.json --output update.plan.json
17
+ neottia uninstall --receipt .neottia/install/default.receipt.json --output uninstall.plan.json
18
+ neottia doctor --manifest manifest.json
19
+ neottia recover --receipt .neottia/install/default.receipt.json
20
+ ```
21
+
22
+ `plan` prints the complete plan and can save the same JSON. `apply` accepts only a saved plan whose digest and checksums still match. If planning reports conflicts, approve each exact ID with a repeated `--approve <id>` option and generate the plan again. The CLI has no force option.
23
+
24
+ The CLI accepts `--project`, `--home`, `--xdg-config`, and `--xdg-state` on commands that inspect an installation. Defaults are resolved in the CLI before it calls the distribution library. Harness adapters receive no machine paths.
25
+
26
+ See the [distribution guide](../../docs/distribution/) for manifest production, ownership rules, configuration, and recovery.
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { main } from './index.js';
3
+ process.exitCode = await main();
4
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGlC,OAAO,CAAC,QAAQ,GAAG,MAAM,IAAI,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cli.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.spec.d.ts","sourceRoot":"","sources":["../src/cli.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,32 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { main } from './index.js';
3
+ function capture() {
4
+ const logs = [];
5
+ const errors = [];
6
+ return {
7
+ logs,
8
+ errors,
9
+ output: {
10
+ log(message) {
11
+ logs.push(message);
12
+ },
13
+ error(message) {
14
+ errors.push(message);
15
+ },
16
+ },
17
+ };
18
+ }
19
+ describe('Neottia CLI', () => {
20
+ it('documents the explicit plan and apply workflow', async () => {
21
+ const result = capture();
22
+ expect(await main(['help'], result.output)).toBe(0);
23
+ expect(result.logs.join('\n')).toContain('neottia plan');
24
+ expect(result.logs.join('\n')).toContain('neottia apply');
25
+ });
26
+ it('returns a failure for an unknown command', async () => {
27
+ const result = capture();
28
+ expect(await main(['unknown'], result.output)).toBe(1);
29
+ expect(result.errors).toEqual(['Unknown command: unknown']);
30
+ });
31
+ });
32
+ //# sourceMappingURL=cli.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.spec.js","sourceRoot":"","sources":["../src/cli.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,IAAI,EAAkB,MAAM,YAAY,CAAC;AAGlD,SAAS,OAAO;IACd,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,OAAO;QACL,IAAI;QACJ,MAAM;QACN,MAAM,EAAE;YACN,GAAG,CAAC,OAAO;gBACT,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACrB,CAAC;YACD,KAAK,CAAC,OAAO;gBACX,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,gDAAgD,EAAE,KAAK,IAAI,EAAE;QAC9D,MAAM,MAAM,GAAG,OAAO,EAAE,CAAC;QACzB,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QACzD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,MAAM,GAAG,OAAO,EAAE,CAAC;QACzB,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACvD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export interface CliOutput {
2
+ log(message: string): void;
3
+ error(message: string): void;
4
+ }
5
+ export declare function main(argv?: readonly string[], output?: CliOutput, env?: NodeJS.ProcessEnv): Promise<number>;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAGD,wBAAsB,IAAI,CACxB,IAAI,GAAE,SAAS,MAAM,EAA0B,EAC/C,MAAM,GAAE,SAAmB,EAC3B,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAAC,MAAM,CAAC,CAiBjB"}
package/dist/index.js ADDED
@@ -0,0 +1,137 @@
1
+ import { readFile, writeFile } from 'node:fs/promises';
2
+ import { homedir } from 'node:os';
3
+ import { resolve } from 'node:path';
4
+ import { parseArgs } from 'node:util';
5
+ import { applyInstallationPlan, authorizePlan, canonicalJson, createInstallationPlan, decodeInstallationPlan, diagnoseSnapshot, inspectInstallation, inspectUninstall, recoverInstallation, runDoctor, validateManifest, } from '@neottia/distribution';
6
+ export async function main(argv = process.argv.slice(2), output = console, env = process.env) {
7
+ try {
8
+ const [command, ...arguments_] = argv;
9
+ if (command === undefined || command === 'help' || command === '--help') {
10
+ output.log(help());
11
+ return 0;
12
+ }
13
+ if (command === 'apply')
14
+ return applyCommand(arguments_, output);
15
+ if (command === 'recover')
16
+ return recoverCommand(arguments_, output);
17
+ if (command === 'doctor')
18
+ return doctorCommand(arguments_, output, env);
19
+ if (command === 'uninstall')
20
+ return uninstallCommand(arguments_, output, env);
21
+ if (command === 'plan')
22
+ return planCommand(arguments_, output, env);
23
+ throw new TypeError(`Unknown command: ${command}`);
24
+ }
25
+ catch (error) {
26
+ output.error(error instanceof Error ? error.message : String(error));
27
+ return 1;
28
+ }
29
+ }
30
+ async function planCommand(arguments_, output, env) {
31
+ const values = parseCommon(arguments_);
32
+ if (values.manifest === undefined)
33
+ throw new TypeError('plan requires --manifest.');
34
+ if (values.action !== 'install' && values.action !== 'update')
35
+ throw new TypeError('plan --action must be install or update.');
36
+ const manifest = await readManifest(values.manifest);
37
+ const snapshot = await inspectInstallation(manifest, roots(values, env));
38
+ const plan = authorizePlan(createInstallationPlan(snapshot, values.action), values.approve);
39
+ await emitPlan(plan, values.output, output);
40
+ return plan.conflicts.some((conflict) => !conflict.approved) ? 2 : 0;
41
+ }
42
+ async function uninstallCommand(arguments_, output, env) {
43
+ const values = parseCommon(arguments_);
44
+ if (values.receipt === undefined)
45
+ throw new TypeError('uninstall requires --receipt.');
46
+ const snapshot = await inspectUninstall(resolve(values.receipt), roots(values, env));
47
+ const plan = authorizePlan(createInstallationPlan(snapshot, 'uninstall'), values.approve);
48
+ await emitPlan(plan, values.output, output);
49
+ return plan.conflicts.some((conflict) => !conflict.approved) ? 2 : 0;
50
+ }
51
+ async function applyCommand(arguments_, output) {
52
+ const { values } = parseArgs({
53
+ args: [...arguments_],
54
+ strict: true,
55
+ allowPositionals: false,
56
+ options: { plan: { type: 'string' } },
57
+ });
58
+ if (values.plan === undefined)
59
+ throw new TypeError('apply requires --plan.');
60
+ const plan = decodeInstallationPlan(JSON.parse(await readFile(values.plan, 'utf8')));
61
+ const result = await applyInstallationPlan(plan);
62
+ output.log(canonicalJson(result));
63
+ return 0;
64
+ }
65
+ async function doctorCommand(arguments_, output, env) {
66
+ const values = parseCommon(arguments_);
67
+ if (values.manifest === undefined)
68
+ throw new TypeError('doctor requires --manifest.');
69
+ const manifest = await readManifest(values.manifest);
70
+ const rootValues = roots(values, env);
71
+ const snapshot = await inspectInstallation(manifest, rootValues);
72
+ const results = [...(await runDoctor(manifest, rootValues, env)), ...diagnoseSnapshot(snapshot)];
73
+ output.log(canonicalJson(results));
74
+ return results.some((result) => result.status === 'error') ? 2 : 0;
75
+ }
76
+ async function recoverCommand(arguments_, output) {
77
+ const { values } = parseArgs({
78
+ args: [...arguments_],
79
+ strict: true,
80
+ allowPositionals: false,
81
+ options: { receipt: { type: 'string' } },
82
+ });
83
+ if (values.receipt === undefined)
84
+ throw new TypeError('recover requires --receipt.');
85
+ output.log(canonicalJson({ status: await recoverInstallation(resolve(values.receipt)) }));
86
+ return 0;
87
+ }
88
+ function parseCommon(arguments_) {
89
+ const { values } = parseArgs({
90
+ args: [...arguments_],
91
+ strict: true,
92
+ allowPositionals: false,
93
+ options: {
94
+ manifest: { type: 'string' },
95
+ receipt: { type: 'string' },
96
+ output: { type: 'string' },
97
+ action: { type: 'string', default: 'install' },
98
+ approve: { type: 'string', multiple: true, default: [] },
99
+ project: { type: 'string' },
100
+ home: { type: 'string' },
101
+ 'xdg-config': { type: 'string' },
102
+ 'xdg-state': { type: 'string' },
103
+ },
104
+ });
105
+ return values;
106
+ }
107
+ function roots(values, env) {
108
+ const home = resolve(typeof values.home === 'string' ? values.home : (env.HOME ?? homedir()));
109
+ return {
110
+ project: resolve(typeof values.project === 'string' ? values.project : process.cwd()),
111
+ home,
112
+ xdgConfig: resolve(typeof values['xdg-config'] === 'string' ? values['xdg-config'] : (env.XDG_CONFIG_HOME ?? `${home}/.config`)),
113
+ xdgState: resolve(typeof values['xdg-state'] === 'string' ? values['xdg-state'] : (env.XDG_STATE_HOME ?? `${home}/.local/state`)),
114
+ };
115
+ }
116
+ async function readManifest(path) {
117
+ const manifest = JSON.parse(await readFile(path, 'utf8'));
118
+ validateManifest(manifest);
119
+ return manifest;
120
+ }
121
+ async function emitPlan(plan, path, output) {
122
+ const content = canonicalJson(plan);
123
+ output.log(content);
124
+ if (path !== undefined)
125
+ await writeFile(path, content, { encoding: 'utf8', mode: 0o600 });
126
+ }
127
+ function help() {
128
+ return [
129
+ 'Usage:',
130
+ ' neottia plan --manifest FILE [--action install|update] [--output FILE] [--approve ID]...',
131
+ ' neottia apply --plan FILE',
132
+ ' neottia uninstall --receipt FILE [--output FILE] [--approve ID]...',
133
+ ' neottia doctor --manifest FILE',
134
+ ' neottia recover --receipt FILE',
135
+ ].join('\n');
136
+ }
137
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,SAAS,EACT,gBAAgB,GAIjB,MAAM,uBAAuB,CAAC;AAS/B,MAAM,CAAC,KAAK,UAAU,IAAI,CACxB,OAA0B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAC/C,SAAoB,OAAO,EAC3B,MAAy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,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,cAAc,IAAI,GAAG,IAAI,eAAe,CAAC,CAC/G;KACF,CAAC;AACJ,CAAC;AAGD,KAAK,UAAU,YAAY,CAAC,IAAY;IACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAkB,CAAC;IAC3E,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3B,OAAO,QAAQ,CAAC;AAClB,CAAC;AAGD,KAAK,UAAU,QAAQ,CAAC,IAAsB,EAAE,IAAwB,EAAE,MAAiB;IACzF,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpB,IAAI,IAAI,KAAK,SAAS;QAAE,MAAM,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAC5F,CAAC;AAGD,SAAS,IAAI;IACX,OAAO;QACL,QAAQ;QACR,4FAA4F;QAC5F,6BAA6B;QAC7B,sEAAsE;QACtE,kCAAkC;QAClC,kCAAkC;KACnC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@neottia/cli",
3
+ "version": "0.2.0",
4
+ "description": "Command-line planner, installer, updater, uninstaller, and doctor for Neottia assets",
5
+ "author": "Dragos Cirjan",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "sideEffects": false,
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/dragoscirjan/neottia.git",
12
+ "directory": "packages/cli"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/dragoscirjan/neottia/issues"
16
+ },
17
+ "homepage": "https://github.com/dragoscirjan/neottia#readme",
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "main": "./dist/index.js",
22
+ "types": "./dist/index.d.ts",
23
+ "exports": {
24
+ ".": {
25
+ "types": "./dist/index.d.ts",
26
+ "default": "./dist/index.js"
27
+ }
28
+ },
29
+ "bin": {
30
+ "neottia": "./dist/cli.js"
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "README.md",
35
+ "LICENSE"
36
+ ],
37
+ "engines": {
38
+ "node": ">=22.20.0"
39
+ },
40
+ "dependencies": {
41
+ "@neottia/distribution": "^0.2.0"
42
+ },
43
+ "devDependencies": {
44
+ "@templ-project/tsconfig": "^0.2.2",
45
+ "@types/node": "^25.0.3",
46
+ "typescript": "^5.9.3",
47
+ "vitest": "^4.1.11"
48
+ },
49
+ "scripts": {
50
+ "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json",
51
+ "test": "vitest run --root ../.. packages/cli/src",
52
+ "typecheck": "tsc --noEmit"
53
+ }
54
+ }