@nvwa-os/cli 0.1.0 → 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.
Files changed (2) hide show
  1. package/README.md +37 -12
  2. package/package.json +10 -3
package/README.md CHANGED
@@ -2,31 +2,48 @@
2
2
 
3
3
  Unified Nvwa developer CLI. Terminal command: **`nvwa-os`** (npm package `@nvwa-os/cli`).
4
4
 
5
- ## Install
5
+ ## npm status
6
6
 
7
- ```bash
8
- # one-shot (after npm publish)
9
- npx @nvwa-os/cli login --project <code> --studio https://studio.example.com
7
+ **Not published to npm yet.** `npm install -g @nvwa-os/cli` will fail until you publish from this monorepo.
10
8
 
11
- # global
12
- npm install -g @nvwa-os/cli
13
- nvwa-os whoami
14
- ```
9
+ Why local `npm install -g` fails today:
15
10
 
16
- Monorepo development:
11
+ - `"private": true` blocks accidental publish
12
+ - `@nvwa-os/common` is a **devDependency** with `workspace:*` (monorepo only; runtime code is bundled into `dist/cli.js`)
13
+ - `@nvwa-os/common` itself is not on npm
14
+
15
+ ### Use in monorepo (now)
17
16
 
18
17
  ```bash
19
- bun run --cwd packages/cli build
18
+ bun run build:cli
20
19
  packages/cli/bin/nvwa-os whoami
20
+ packages/cli/bin/nvwa-os login --project <code> --studio <url>
21
21
  ```
22
22
 
23
- Requires **Bun ≥ 1.x** at runtime (same as Agent Pod image).
23
+ Requires **Bun ≥ 1.1** (shebang in `bin/nvwa-os`).
24
+
25
+ ### After npm publish (future)
26
+
27
+ ```bash
28
+ npx @nvwa-os/cli login --project <code> --studio https://studio.example.com
29
+ # or
30
+ npm install -g @nvwa-os/cli
31
+ nvwa-os whoami
32
+ ```
33
+
34
+ ## Publish checklist (maintainer)
35
+
36
+ 1. `bun run verify:pack` (or repo root `bun run verify:cli-pack`) — must pass
37
+ 2. Remove `"private": true` from [`package.json`](./package.json) (or publish from a release branch without it)
38
+ 3. Ensure packed `dependencies` has **no** `workspace:*` (verify script checks this)
39
+ 4. `npm publish --access public` from `packages/cli`
40
+ 5. Smoke: `npx @nvwa-os/cli@latest whoami`
24
41
 
25
42
  ## Configure
26
43
 
27
44
  Recommended: device login writes `.nvwa/config.json` (see Studio **Agent 接入**).
28
45
 
29
- Config resolution priority (via `@nvwa-os/common`):
46
+ Config resolution priority (bundled from `@nvwa-os/common`):
30
47
 
31
48
  1. `NVWA_INTEGRATION_DOCS_TOKEN` + API base env
32
49
  2. env token + `job.json` `integrationDocsHints` (Agent Pod)
@@ -61,4 +78,12 @@ nvwa-os ops deploy-status
61
78
  bun run build # → dist/cli.js (bundled for npm / local bin)
62
79
  ```
63
80
 
81
+ Verify publish artifact (build → npm pack → temp install → `nvwa-os whoami`):
82
+
83
+ ```bash
84
+ bun run verify:pack
85
+ # or from repo root:
86
+ bun run verify:cli-pack
87
+ ```
88
+
64
89
  Agent image also bundles this entry via `packages/agent/scripts/build-runtime.ts`.
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@nvwa-os/cli",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
+ "description": "Nvwa developer CLI (nvwa-os): login, integration-docs, ops, Agent run",
5
6
  "bin": {
6
7
  "nvwa-os": "./bin/nvwa-os"
7
8
  },
@@ -13,15 +14,21 @@
13
14
  "scripts": {
14
15
  "check": "tsc --noEmit",
15
16
  "test": "bun test",
16
- "build": "bun run scripts/build.ts"
17
+ "build": "bun run scripts/build.ts",
18
+ "verify:pack": "bun run scripts/verify-pack.ts",
19
+ "prepublishOnly": "bun run build"
17
20
  },
18
21
  "dependencies": {
19
- "@nvwa-os/common": "workspace:*"
22
+ "yaml": "^2.8.2"
20
23
  },
21
24
  "devDependencies": {
25
+ "@nvwa-os/common": "workspace:*",
22
26
  "@types/bun": "latest",
23
27
  "typescript": "^5.8.0"
24
28
  },
29
+ "engines": {
30
+ "bun": ">=1.1.0"
31
+ },
25
32
  "publishConfig": {
26
33
  "access": "public"
27
34
  }