@gluecharm-lab/easyspecs-cli 0.0.10 → 0.0.11
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 +164 -130
- package/commands.md +15 -16
- package/dist/main.cjs +99 -55
- package/dist/main.cjs.map +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# EasySpecs CLI
|
|
2
2
|
|
|
3
|
-
Headless **EasySpecs** command-line tool for **context analysis**, **diagnoses**, **macro pipelines**, **upload to EasySpecs**, **auth**, and **ACE** — the same orchestration
|
|
3
|
+
Headless **EasySpecs** command-line tool for **context analysis**, **diagnoses**, **macro pipelines**, **upload to EasySpecs**, **auth**, and **ACE** — the same orchestration ideas as the **EasySpecs VS Code extension**, without an editor.
|
|
4
4
|
|
|
5
5
|
Published as **`@gluecharm-lab/easyspecs-cli`** (npm org **gluecharm-lab**; **EasySpecs** is the product). The executable on your `PATH` is **`easyspecs-cli`**.
|
|
6
6
|
|
|
7
7
|
## Requirements
|
|
8
8
|
|
|
9
9
|
- **Node.js** ≥ 18
|
|
10
|
-
- **
|
|
11
|
-
- A **git repository** with **`.gluecharm/`** (documentation + context layout) when running analysis, diagnose, or upload against a project
|
|
10
|
+
- **OpenCode** (`opencode` on `PATH`) for flows that run agents — install from OpenCode’s own documentation
|
|
11
|
+
- A **git repository** with **`.gluecharm/`** (documentation + context layout) when running analysis, diagnose, or upload against a project
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
@@ -40,7 +40,7 @@ easyspecs-cli doctor --inspect-config
|
|
|
40
40
|
easyspecs-cli help
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
Use **`config init`** to create **`.easyspecs/config.json`** with defaults (add **`--overwrite`** to replace an existing file). Set **`easyspecs.easyspecsProjectId`** and **`easyspecs.defaultGitRemoteUrl`** from the shell with **`config set-project-id <id>`** and **`config set-git-remote <url>`** (each overwrites that field). Use **`--ci`** for non-interactive CI: no prompts, stricter defaults (e.g. macro outer-iteration cap). Tunables
|
|
43
|
+
Use **`config init`** to create **`.easyspecs/config.json`** with defaults (add **`--overwrite`** to replace an existing file). Set **`easyspecs.easyspecsProjectId`** and **`easyspecs.defaultGitRemoteUrl`** from the shell with **`config set-project-id <id>`** and **`config set-git-remote <url>`** (each overwrites that field). Use **`--ci`** for non-interactive CI: no prompts, stricter defaults (e.g. macro outer-iteration cap). Tunables belong in **`<repo>/.easyspecs/config.json`** — do not rely on **`EASYSPECS_*`** environment variables for product settings.
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
46
|
easyspecs-cli diagnose coordination-duplicates --cwd /your/repo --ci --json
|
|
@@ -48,154 +48,188 @@ easyspecs-cli diagnose coordination-duplicates --cwd /your/repo --ci --json
|
|
|
48
48
|
|
|
49
49
|
## Commands (overview)
|
|
50
50
|
|
|
51
|
+
| Area | Examples |
|
|
52
|
+
| ---- | ---------- |
|
|
53
|
+
| **Health** | `doctor` (`--readiness`, `--inspect-config`), `version` |
|
|
54
|
+
| **Config** | `doctor --inspect-config`, `config init`, `config set-project-id`, `config set-git-remote` |
|
|
55
|
+
| **Auth** | `auth login --email … --password …`, `auth logout`, `auth status` |
|
|
56
|
+
| **Run synthesis** | `run synthesis`; **`run synthesis resume-missing`** / **`resume-synthesis`** |
|
|
57
|
+
| **Analysis** (full macro pipeline) | `analysis` (optional **`--upload`** after login; **`--synthesis-only`** stops after synthesis) |
|
|
58
|
+
| **Diagnose** | `diagnose reference-coverage`, `coordination-duplicates`, `coverage-report`, … |
|
|
59
|
+
| **Upload** | `upload context`, `upload republish` |
|
|
60
|
+
| **ACE** | `ace clear`, `ace learn`, `ace auto-learn` |
|
|
51
61
|
|
|
52
|
-
|
|
53
|
-
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
|
54
|
-
| **Health** | `doctor` (`--readiness`, `--inspect-config`), `version` |
|
|
55
|
-
| **Config** | `doctor --inspect-config` (inspect merged settings), `config init`, `config set-project-id`, `config set-git-remote` |
|
|
56
|
-
| **Auth** | `auth login --email … --password …`, `auth logout`, `auth status` |
|
|
57
|
-
| **Run synthesis** | `run synthesis`; **`run synthesis resume-missing`** / **`resume-synthesis`** |
|
|
58
|
-
| **Analysis** (full macro pipeline) | `analysis` (optional **`--upload`** after login; **`--synthesis-only`** stops after synthesis) |
|
|
59
|
-
| **Diagnose** | `diagnose reference-coverage`, `coordination-duplicates`, `coverage-report`, … |
|
|
60
|
-
| **Upload** | `upload context`, `upload republish` |
|
|
61
|
-
| **ACE** | `ace clear`, `ace learn`, `ace auto-learn` |
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
Run **`easyspecs-cli help`** and **`easyspecs-cli <command> --help`** for the full tree and flags.
|
|
62
|
+
Run **`easyspecs-cli help`** for the full command tree. This README does not duplicate every flag; the built-in help matches the installed package version.
|
|
65
63
|
|
|
66
64
|
## Configuration
|
|
67
65
|
|
|
68
|
-
Primary configuration file: **`<repo>/.easyspecs/config.json`** (auto-created when needed). **`auth login --email … --password …`** stores tokens for upload commands (optional **`--session-path`** tail updates **`easyspecs.cliSessionPath`** in **`config.json`**).
|
|
69
|
-
|
|
70
|
-
After **`auth login`**, session data is stored at **`easyspecs.cliSessionPath`** in **`config.json`** when set (otherwise **`~/.easyspecs/cli-session.json`**).
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
66
|
+
Primary configuration file: **`<repo>/.easyspecs/config.json`** (auto-created when needed, except for **`help`**, **`version`**, and **`doctor`** which do not create the file on first run). **`auth login --email … --password …`** stores tokens for upload commands (optional **`--session-path`** on the command tail updates **`easyspecs.cliSessionPath`** in **`config.json`**).
|
|
67
|
+
|
|
68
|
+
After **`auth login`**, session data is stored at **`easyspecs.cliSessionPath`** in **`config.json`** when that path is set (otherwise **`~/.easyspecs/cli-session.json`**). Tools such as the VS Code extension may spawn **`easyspecs-cli`** with global **`--session-path <file>`** so this process uses a temporary session file without editing **`config.json`**.
|
|
69
|
+
|
|
70
|
+
### Default **`config.json`** (from **`easyspecs-cli config init`**)
|
|
71
|
+
|
|
72
|
+
Run **`easyspecs-cli config init`** in your repo (add **`--overwrite`** to replace an existing file). A fresh install writes **`.easyspecs/config.json`** equivalent to the following default shape:
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"schemaVersion": 2,
|
|
77
|
+
"easyspecs": {
|
|
78
|
+
"deploymentEnvironment": "production",
|
|
79
|
+
"apiBaseUrl": "https://api.easyspecs.ai",
|
|
80
|
+
"easyspecsProjectId": "",
|
|
81
|
+
"defaultGitRemoteUrl": "",
|
|
82
|
+
"cliSessionPath": "",
|
|
83
|
+
"openCode": {
|
|
84
|
+
"executable": "opencode",
|
|
85
|
+
"skipCredentialsCheck": false
|
|
86
|
+
},
|
|
87
|
+
"analysis": {
|
|
88
|
+
"promoteContextToWorkspace": true
|
|
89
|
+
},
|
|
90
|
+
"orchestration": {},
|
|
91
|
+
"openCodeRuntime": {
|
|
92
|
+
"executable": "opencode",
|
|
93
|
+
"skipCredentialsCheck": false,
|
|
94
|
+
"credentialsPath": ".opencode/auth.json",
|
|
95
|
+
"providers": {},
|
|
96
|
+
"run": {
|
|
97
|
+
"argvTemplate": [
|
|
98
|
+
"run",
|
|
99
|
+
"--agent",
|
|
100
|
+
"{agentId}",
|
|
101
|
+
"Execute the task described in the attached EasySpecs prompt file.",
|
|
102
|
+
"-f",
|
|
103
|
+
"{promptFile}"
|
|
104
|
+
],
|
|
105
|
+
"timeoutMs": 600000
|
|
106
|
+
},
|
|
107
|
+
"coordinationRepairs": {
|
|
108
|
+
"listJsonSchemaRepairAttempts": 1,
|
|
109
|
+
"markdownEvidenceRepairAttempts": 2,
|
|
110
|
+
"markdownOpenQuestionIterations": 5
|
|
111
|
+
},
|
|
112
|
+
"pool": {
|
|
113
|
+
"maxConcurrentAgents": 30
|
|
114
|
+
},
|
|
115
|
+
"projectConfigOverlay": {}
|
|
116
|
+
},
|
|
117
|
+
"diagnose": {
|
|
118
|
+
"zeroReference": {
|
|
119
|
+
"maxPercentNonReferenced": null
|
|
120
|
+
},
|
|
121
|
+
"coordinationDuplicates": {
|
|
122
|
+
"strict": true
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"upload": {
|
|
126
|
+
"contextDirectory": ""
|
|
127
|
+
},
|
|
128
|
+
"macro": {
|
|
129
|
+
"debug": false
|
|
130
|
+
},
|
|
131
|
+
"cli": {
|
|
132
|
+
"bundledResourcesRoot": ""
|
|
133
|
+
},
|
|
134
|
+
"auth": {
|
|
135
|
+
"ciLogin": {}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
86
140
|
|
|
87
|
-
|
|
141
|
+
### Config keys (reference)
|
|
88
142
|
|
|
89
|
-
|
|
143
|
+
Merge order for **`easyspecs-cli`**: **`.easyspecs/config.json`** plus global CLI flags (for example **`--api-base-url`**, **`--environment`**). The CLI does **not** read **`EASYSPECS_*`** or **`VITE_*`** for product settings.
|
|
90
144
|
|
|
91
|
-
|
|
145
|
+
| Path | Purpose |
|
|
146
|
+
| ---- | ------- |
|
|
147
|
+
| `schemaVersion` | Integer (e.g. `2`) for future migrations. |
|
|
148
|
+
| `easyspecs.deploymentEnvironment` | `production` or `staging` (default `production`). Used with built-in System Manager URLs when `apiBaseUrl` is empty. |
|
|
149
|
+
| `easyspecs.apiBaseUrl` | Explicit System Manager origin; wins after `--api-base-url`. Default non-empty value uses the production API host. Use **`""`** if you want the built-in URL from **`deploymentEnvironment`** / **`--environment`** only. |
|
|
150
|
+
| `easyspecs.easyspecsProjectId` | EasySpecs **project** id (Content application UUID) for uploads. Set with **`config set-project-id`** or the EasySpecs app; legacy **`applicationId`** in older files may be migrated into this field. |
|
|
151
|
+
| `easyspecs.defaultGitRemoteUrl` | Optional primary **`git remote`** URL (HTTPS or SSH) for reference; analysis still uses the live repo. |
|
|
152
|
+
| `easyspecs.cliSessionPath` | Repo-relative or absolute path to **`cli-session.json`**. Empty **`""`** → **`~/.easyspecs/cli-session.json`**. Precedence: global **`--session-path`** → **`cliSessionPath`** → home default. |
|
|
153
|
+
| `easyspecs.openCode` | `executable`, `skipCredentialsCheck` (shortcut; see **`openCodeRuntime`**). |
|
|
154
|
+
| `easyspecs.analysis.*` | Pipeline: argv template, timeouts, repair attempts, concurrency, `promoteContextToWorkspace`. |
|
|
155
|
+
| `easyspecs.orchestration.*` | Macro delays, outer iterations, ping-pong cap. |
|
|
156
|
+
| `easyspecs.openCodeRuntime` | Providers (`apiKey`, `defaultModel` per provider), `run`, `coordinationRepairs`, `pool`, `projectConfigOverlay`. |
|
|
157
|
+
| `easyspecs.diagnose.zeroReference.maxPercentNonReferenced` | Number or **`null`**. **`null`** means **`diagnose reference-coverage`** does not fail on percentage alone. |
|
|
158
|
+
| `easyspecs.diagnose.coordinationDuplicates.strict` | Boolean (default **`true`**). |
|
|
159
|
+
| `easyspecs.upload.contextDirectory` | Repo-relative or absolute override for **`upload republish`**; empty **`""`** → automatic resolution from the analysis snapshot. |
|
|
160
|
+
| `easyspecs.macro.debug` | When **`true`**, macro phase transitions log extra lines to stderr. |
|
|
161
|
+
| `easyspecs.cli.bundledResourcesRoot` | Optional absolute or repo-relative path to the bundled **`resources/`** directory. Empty → resolve next to the installed CLI package. |
|
|
162
|
+
| `easyspecs.auth.ciLogin.email` / `password` | Used with **`--ci`** when **`--email` / `--password`** are omitted on the command line. Prefer CI-generated **`config.json`**; avoid committing secrets. |
|
|
92
163
|
|
|
93
|
-
|
|
164
|
+
**Resolved API base URL:** `--api-base-url` → non-empty **`easyspecs.apiBaseUrl`** → built-in URL from **`--environment`** or **`easyspecs.deploymentEnvironment`** or **`production`**.
|
|
94
165
|
|
|
95
|
-
|
|
96
|
-
easyspecs-cli help
|
|
97
|
-
```
|
|
166
|
+
**OpenCode providers:** put API keys under **`easyspecs.openCodeRuntime.providers`** in **`config.json`**. They are passed to the **`opencode`** child process and are redacted in **`doctor --inspect-config`** output.
|
|
98
167
|
|
|
99
|
-
|
|
168
|
+
## Global flags
|
|
100
169
|
|
|
101
|
-
|
|
170
|
+
`--cwd`, `--ci`, `--json`, `--verbose`, `--api-base-url`, **`--session-path`**, `--environment`, `--promote` / `--no-promote` — details in **`easyspecs-cli --help`**.
|
|
102
171
|
|
|
103
|
-
|
|
172
|
+
### Global options (table)
|
|
104
173
|
|
|
105
174
|
| Flag | Effect |
|
|
106
|
-
|
|
107
|
-
| `--cwd <dir>` | Repository root for git resolution and
|
|
108
|
-
| `--ci` | Non-interactive mode;
|
|
109
|
-
| `--json` | On supported exits,
|
|
175
|
+
| ---- | ------ |
|
|
176
|
+
| `--cwd <dir>` | Repository root for git resolution and paths (default: current working directory). |
|
|
177
|
+
| `--ci` | Non-interactive mode; affects merged settings (e.g. macro outer-iteration default). **`EASYSPECS_CI` is not read** — use this flag. |
|
|
178
|
+
| `--json` | On supported exits, one JSON summary line on stdout. |
|
|
110
179
|
| `--verbose` | Extra stderr logging where implemented. |
|
|
111
|
-
| `--api-base-url <url>` | System Manager API origin for this process (overrides `easyspecs.apiBaseUrl`
|
|
112
|
-
| `--environment production` \|
|
|
113
|
-
| `--promote` | After
|
|
114
|
-
| `--no-promote` | Disable that promotion
|
|
115
|
-
| `--help`, `-h` |
|
|
116
|
-
| `--version`, `-V` |
|
|
117
|
-
| `--config <path>` |
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## Shared configuration (SRS-43)
|
|
122
|
-
|
|
123
|
-
### File: `<repoRoot>/.easyspecs/config.json`
|
|
124
|
-
|
|
125
|
-
Canonical JSON created on first need (except **`help`**, **`version`**, and **`doctor`** — no auto-create). Invalid JSON fails with a clear path (**R6**). If **`config.json`** is missing and **`.easyspecs/cli.json`** exists, settings are imported once (**§6 M2**) into the new file.
|
|
126
|
-
|
|
127
|
-
Merge uses **this file + global CLI flags only** — no `EASYSPECS_*` / `VITE_*` product overrides on **`easyspecs-cli`** (**R34**).
|
|
128
|
-
|
|
129
|
-
| Path | Purpose |
|
|
130
|
-
|------|---------|
|
|
131
|
-
| `schemaVersion` | Integer (e.g. `1`) for future migrations. |
|
|
132
|
-
| `easyspecs.deploymentEnvironment` | `production` or `staging` (default `production`). Used with built-in System Manager URLs when `apiBaseUrl` is empty. |
|
|
133
|
-
| `easyspecs.apiBaseUrl` | Explicit System Manager origin; wins after `--api-base-url`. Generated defaults use **`https://api.easyspecs.ai`** (production). Use **`""`** only if you want the built-in URL from **`deploymentEnvironment`** / **`--environment`** instead. |
|
|
134
|
-
| `easyspecs.easyspecsProjectId` | Optional EasySpecs **project** id (Content application UUID). **Only** store for uploads / Sync — set via **`Send context`**, **`Changes → Sync`**, **`config set-project-id`**, or **`easyspecs-cli`**. **`upload`** / **`analysis --upload`** read **only** this field (merged **`easyspecs.applicationId`** legacy key maps here). |
|
|
135
|
-
| `easyspecs.defaultGitRemoteUrl` | Optional primary **`git remote`** URL (HTTPS or SSH) for documentation / tooling; analysis still uses the live repo. Related: **`index-application-context.json`** `repository`, **`.easyspecs/analysis-worktree.json`** `repositoryRoot`. |
|
|
136
|
-
| `easyspecs.cliSessionPath` | Repo-relative or absolute path to **`cli-session.json`** written by **`auth login`**. Empty **`""`** → **`~/.easyspecs/cli-session.json`**. Effective path: global **`--session-path`** (if passed) → **`cliSessionPath`** → default home path ([`cliSession.ts`](../../src/cli/cliSession.ts)). |
|
|
137
|
-
| `easyspecs.openCode` | `executable`, `skipCredentialsCheck` (legacy shortcut; see also `openCodeRuntime`). |
|
|
138
|
-
| `easyspecs.analysis.*` | Pipeline: argv template, timeouts, repair attempts, concurrency, `promoteContextToWorkspace`. |
|
|
139
|
-
| `easyspecs.orchestration.*` | Macro delays, outer iterations, ping-pong cap, etc. |
|
|
140
|
-
| `easyspecs.openCodeRuntime` | Annex-aligned block: `providers` (per-provider `apiKey`, `defaultModel`), `run`, `coordinationRepairs`, `pool`, `projectConfigOverlay` — see [`srs-43-opencode.schema.json`](../../.gluecharm/docs/srs/srs-43-opencode.schema.json). |
|
|
180
|
+
| `--api-base-url <url>` | System Manager API origin for this process (overrides `easyspecs.apiBaseUrl`). |
|
|
181
|
+
| `--environment production` \| `staging` | Alias **`--env`**. Overrides `easyspecs.deploymentEnvironment` for built-in URL selection when no explicit URL is set. |
|
|
182
|
+
| `--promote` | After **`run synthesis`**, copy generated **`.gluecharm/context`** from the analysis worktree into the workspace repo when applicable. |
|
|
183
|
+
| `--no-promote` | Disable that promotion for this run. |
|
|
184
|
+
| `--help`, `-h` | Built-in help. Does **not** create **`.easyspecs/config.json`**. |
|
|
185
|
+
| `--version`, `-V` | CLI package version. Does **not** create config. |
|
|
186
|
+
| `--config <path>` | Reserved / unused in current releases; read **`<repo>/.easyspecs/config.json`** instead. |
|
|
141
187
|
|
|
142
|
-
###
|
|
188
|
+
### Diagnose-only flags
|
|
143
189
|
|
|
144
|
-
|
|
190
|
+
Used after **`diagnose <subcommand>`**:
|
|
145
191
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
| Variable | Purpose |
|
|
151
|
-
|----------|---------|
|
|
152
|
-
| `EASYSPECS_EMAIL` / `EASYSPECS_PASSWORD` | Optional legacy **`auth login`** when **`--ci`** is set and **`--email` / `--password`** are omitted (**SRS-43 §5.3**). Prefer explicit **`--email`** / **`--password`** on the command line for scripts (credentials appear in process listings — avoid shared machines). |
|
|
153
|
-
| `EASYSPECS_EXTENSION_ROOT` | Extension/monorepo root for bundled resources. |
|
|
154
|
-
| `EASYSPECS_CLI_RESOURCES` | Override directory containing **`opencode-agents/`**. |
|
|
155
|
-
| `EASYSPECS_UPLOAD_CONTEXT_DIR` | Upload republish context dir bridging. |
|
|
156
|
-
| `EASYSPECS_CLI_MACRO_DEBUG` | Macro extra logging ([`macroHeadlessHost`](../../src/analysis/macroHeadlessHost.ts)). |
|
|
157
|
-
| OS-level (e.g. `PATH`) | Finding `node`, `opencode`, `git`. |
|
|
158
|
-
|
|
159
|
-
Provider API keys for OpenCode runs should live under **`easyspecs.openCodeRuntime.providers`** in **`config.json`**; they are injected into the **child** OpenCode process (**R13**) and redacted in **`doctor --inspect-config`** (**R17**).
|
|
192
|
+
| Flag | Values | Meaning |
|
|
193
|
+
| ---- | ------ | ------- |
|
|
194
|
+
| `--root` | `workspace` or `worktree` | Resolve paths against the workspace repo root or an analysis checkout. |
|
|
195
|
+
| `--worktree` | path | Analysis git checkout (use with **`--root worktree`** when needed). |
|
|
160
196
|
|
|
161
|
-
|
|
197
|
+
## Command reference
|
|
162
198
|
|
|
163
|
-
|
|
199
|
+
| Command | Tokens / notes | Behaviour summary |
|
|
200
|
+
| ------- | ---------------- | ------------------ |
|
|
201
|
+
| `help`, `--help` | — | Prints usage. |
|
|
202
|
+
| `version` | — | Prints the CLI package version string. |
|
|
203
|
+
| `doctor` | **`--readiness`**, **`--inspect-config`** | Does **not** create **`config.json`**. Default (no flags) behaves like **`--readiness`**. **`--inspect-config`** prints redacted merged settings and config. |
|
|
204
|
+
| `config init` | **`--overwrite`** optional | Writes full defaults; may import legacy **`.easyspecs/cli.json`** once if present. |
|
|
205
|
+
| `config set-project-id <id>` | — | Sets **`easyspecs.easyspecsProjectId`**. |
|
|
206
|
+
| `config set-git-remote <url>` | — | Sets **`easyspecs.defaultGitRemoteUrl`**. |
|
|
207
|
+
| `auth login` | **`--email`**, **`--password`**, optional tail **`--session-path`** | Login against the resolved API; writes session file. With **`--ci`**, credentials may come from **`easyspecs.auth.ciLogin`** in **`config.json`** if argv omits email/password. |
|
|
208
|
+
| `auth logout` | — | Clears the effective session file. |
|
|
209
|
+
| `auth status` | — | Shows whether a session file exists / looks populated. |
|
|
210
|
+
| `run synthesis` | — | Context artefact pipeline pass; **`requireOpenCode`** applies. |
|
|
211
|
+
| `run synthesis resume-missing`, `resume-synthesis` | **`--worktree`** | Resumes remediation / synthesis on a known checkout. |
|
|
212
|
+
| `analysis` | **`--synthesis-only`**, **`--upload`** | Full macro loop; **`--upload`** needs **`auth login`** and project id in config. |
|
|
213
|
+
| `diagnose reference-coverage` | **`--root`**, **`--worktree`** | Optional percent gate via **`easyspecs.diagnose.zeroReference.maxPercentNonReferenced`**. |
|
|
214
|
+
| `diagnose coordination-duplicates` | same | **`easyspecs.diagnose.coordinationDuplicates.strict`**. |
|
|
215
|
+
| `diagnose coverage-report` | same | Coverage report path on disk. |
|
|
216
|
+
| `diagnose missing-artefacts` | same | Lists missing artefacts from workspace state. |
|
|
217
|
+
| `diagnose zero-reference` | **`--worktree`** | Zero-reference remediation pool (**OpenCode**). |
|
|
218
|
+
| `upload context` | — | Requires auth session and **`easyspecs.easyspecsProjectId`**. |
|
|
219
|
+
| `upload republish` | — | Same auth rules; context dir from **`easyspecs.upload.contextDirectory`** or analysis snapshot. |
|
|
220
|
+
| `ace clear` | — | Deletes learnings under **`.gluecharm/context/learnings`**. |
|
|
221
|
+
| `ace learn`, `ace auto-learn` | **`--worktree`** | ACE offline learning pools (**OpenCode**). |
|
|
222
|
+
|
|
223
|
+
## Product information
|
|
224
|
+
|
|
225
|
+
**EasySpecs** is a product for agentic documentation and requirements: use the public marketing and app entry at **easyspecs.ai** (sign-in, projects, browser workspace). This npm package is the **headless CLI** only; it does not bundle the web app.
|
|
164
226
|
|
|
165
|
-
|
|
227
|
+
## License
|
|
166
228
|
|
|
167
|
-
|
|
168
|
-
|------|--------|---------|
|
|
169
|
-
| `--root` | `workspace` or `worktree` | Whether paths resolve against the workspace repo root or an analysis checkout ([`parseTailFlags`](../../src/cli/parseTailFlags.ts)). |
|
|
170
|
-
| `--worktree` | path | Analysis git checkout (required for `--root worktree` when no path embedded in `--root` flow; combined with explicit `--worktree` — see `main.ts`). |
|
|
229
|
+
Copyright © **Spaii Edutainment SL** (Barcelona, Spain).
|
|
171
230
|
|
|
172
|
-
|
|
231
|
+
This package is licensed under the **Elastic License 2.0** (**ELv2**, SPDX **`Elastic-2.0`**). The complete license text is included in the **`LICENSE`** file published inside **`@gluecharm-lab/easyspecs-cli`**. Other artifacts outside this tarball may use different licenses.
|
|
173
232
|
|
|
174
|
-
##
|
|
233
|
+
## Bundled documentation
|
|
175
234
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
| Command | Command-specific flags / tokens | Configuration & notes |
|
|
179
|
-
|---------|--------------------------------|----------------------|
|
|
180
|
-
| `help`, `--help` | — | Global options only; prints usage. |
|
|
181
|
-
| `version` | — | Prints [`PKG_VERSION`](../../src/cli/main.ts) from the bundle. |
|
|
182
|
-
| `doctor` | Optional **`--readiness`**, **`--inspect-config`** | **Does not** create `config.json`. Default (no flags) = **`--readiness`**: repo root, resolved API URL, OpenCode installed/credentials, agents dir. **`--inspect-config`** alone: redacted **`merged`** + **`easyspecsConfig`**. **`--readiness --inspect-config`**: both. Global flags apply (**`--cwd`**, **`--ci`**, **`--api-base-url`**, **`--session-path`**, **`--environment`**, **`--promote`** / **`--no-promote`**). |
|
|
183
|
-
| `config init` | Optional **`--overwrite`** | Creates **`<repo>/.easyspecs/config.json`** with full defaults if missing; imports legacy **`cli.json`** / **`settings.json`** (ACE) when present, same as first-time bootstrap. If the file already exists, does nothing unless **`--overwrite`** (replaces with that bootstrap content). Does not run other commands. |
|
|
184
|
-
| `config set-project-id <id>` | — | Writes **`easyspecs.easyspecsProjectId`** to **`config.json`**, replacing any previous value. Creates **`config.json`** (defaults + legacy import) if missing. |
|
|
185
|
-
| `config set-git-remote <url>` | — | Writes **`easyspecs.defaultGitRemoteUrl`** to **`config.json`**, replacing any previous value. Same bootstrap-if-missing behaviour as **`set-project-id`**. |
|
|
186
|
-
| `auth login` | **`--email <email> --password <password>`**, optional **`--session-path <path>`** (tail; updates **`config.json`**) | Calls **`POST /api/authentication/login`**. On success prints **`OK`** (stdout), exit **0**, and writes tokens + **`apiBaseUrl`** to the session file. Tail **`--session-path`** updates **`easyspecs.cliSessionPath`** in **`config.json`** (normalized repo-relative when under the repo) and writes the session there for this run; omit it to use the existing **`easyspecs.cliSessionPath`** / default **`~/.easyspecs/cli-session.json`**. Global **`--session-path`** (before the command) overrides the effective session file for any command without changing **`config.json`**. On failure prints **`KO: …`** (stderr), exit **`auth`**. Legacy: **`easyspecs-cli --ci auth login`** with **`EASYSPECS_*`** when CLI credentials omitted. **`--password`** on argv is visible to **`ps`**. |
|
|
187
|
-
| `auth logout` | — | Deletes the effective session file (same path rules as **`auth login`**). |
|
|
188
|
-
| `auth status` | — | Reads session file. |
|
|
189
|
-
| `run synthesis` | — | Single SRS-9 context pass (same as extension **Run Analysis**). **`requireOpenCode`** → executable + credentials unless skip flag. Uses **`merged.pipelineOpenCode`** from **`config.json`**. **`--promote` / `--no-promote`** controls promotion after success. |
|
|
190
|
-
| `run synthesis resume-missing`, `run synthesis resume-synthesis` | Optional **`--worktree <path>`** | Same implementation: resolves checkout via `--worktree` or stored snapshot ([`resolveAdHocCheckoutRoot`](../../src/cli/main.ts)). OpenCode + **`merged.pipelineOpenCode`**. |
|
|
191
|
-
| `analysis` | Optional tokens anywhere in argv: **`--synthesis-only`**, **`--upload`** | **SRS-32** full loop: synthesis convergence (until no missing artefacts), then coverage, zero-ref, report, index, optional backend sync. **`merged.macroOrchestration`** from config + **`--ci`** defaults. **`--upload`** requires prior **`auth login`** session. **`EASYSPECS_CLI_MACRO_DEBUG`**. OpenCode options from **`merged.pipelineOpenCode`**. |
|
|
192
|
-
| `diagnose reference-coverage` | **`--root workspace`** \| **`--root worktree`**, optional **`--worktree <path>`** | **`EASYSPECS_MAX_PERCENT_NON_REFERENCED`**: if set to a finite number, failure when metric exceeds it. |
|
|
193
|
-
| `diagnose coordination-duplicates` | Same **`--root`** / **`--worktree`** | **`EASYSPECS_DUPLICATES_STRICT`**: unless `0`, duplicate/orphan issues fail the exit code. |
|
|
194
|
-
| `diagnose coverage-report` | Same **`--root`** / **`--worktree`** | Uses repo/worktree paths only; no extra env in `main.ts`. |
|
|
195
|
-
| `diagnose missing-artefacts` | Same **`--root`** / **`--worktree`** | Reads artefact snapshot from workspace state; no OpenCode. |
|
|
196
|
-
| `diagnose zero-reference` | Optional **`--worktree <path>`** (no `--root` branch in this handler) | **`requireOpenCode`**; **`merged.pipelineOpenCode`** for pool concurrency/argv/timeout. Checkout from **`--worktree`** or snapshot ([`resolveAdHocCheckoutRoot`](../../src/cli/main.ts)). |
|
|
197
|
-
| `upload context` | — | Requires **`auth`** session. Context dir: **`<repoRoot>/.gluecharm/context`**. Project id: **`easyspecs.easyspecsProjectId`** in **`config.json`** only. |
|
|
198
|
-
| `upload republish` | — | Same auth + upload pipeline; context dir from **`EASYSPECS_UPLOAD_CONTEXT_DIR`** if set and valid, else analysis worktree **`…/.gluecharm/context`** from snapshot, else error. Same project id rule as **`upload context`**. |
|
|
199
|
-
| `ace clear` | — | Deletes **`<repoRoot>/.gluecharm/context/learnings`**. |
|
|
200
|
-
| `ace learn` | Optional **`--worktree <path>`** | **`requireOpenCode`**; worktree chosen if `--worktree` points at checkout with **`.opencode/schemas/ace`**, else **`repoRoot`** ([`main.ts`](../../src/cli/main.ts)). **`merged.pipelineOpenCode`** for spawn argv/timeout. |
|
|
201
|
-
| `ace auto-learn` | Optional **`--worktree <path>`** | **`requireOpenCode`**; checkout = `--worktree` if valid git dir, else **`repoRoot`**. **`merged.pipelineOpenCode.maxConcurrentOpenCodeAgents`** caps parallelism. |
|
|
235
|
+
This package also ships **`commands.md`** in the same directory as this **`README.md`**, with an extended command and configuration reference (same scope as this file, in alternate layout).
|
package/commands.md
CHANGED
|
@@ -40,7 +40,7 @@ Merge uses **this file + global CLI flags only** — no `EASYSPECS_*` / `VITE_*`
|
|
|
40
40
|
|
|
41
41
|
| Path | Purpose |
|
|
42
42
|
|------|---------|
|
|
43
|
-
| `schemaVersion` | Integer (e.g. `
|
|
43
|
+
| `schemaVersion` | Integer (e.g. `2`) for future migrations. |
|
|
44
44
|
| `easyspecs.deploymentEnvironment` | `production` or `staging` (default `production`). Used with built-in System Manager URLs when `apiBaseUrl` is empty. |
|
|
45
45
|
| `easyspecs.apiBaseUrl` | Explicit System Manager origin; wins after `--api-base-url`. Generated defaults use **`https://api.easyspecs.ai`** (production). Use **`""`** only if you want the built-in URL from **`deploymentEnvironment`** / **`--environment`** instead. |
|
|
46
46
|
| `easyspecs.easyspecsProjectId` | Optional EasySpecs **project** id (Content application UUID). **Only** store for uploads / Sync — set via **`Send context`**, **`Changes → Sync`**, **`config set-project-id`**, or **`easyspecs-cli`**. **`upload`** / **`analysis --upload`** read **only** this field (merged **`easyspecs.applicationId`** legacy key maps here). |
|
|
@@ -50,6 +50,12 @@ Merge uses **this file + global CLI flags only** — no `EASYSPECS_*` / `VITE_*`
|
|
|
50
50
|
| `easyspecs.analysis.*` | Pipeline: argv template, timeouts, repair attempts, concurrency, `promoteContextToWorkspace`. |
|
|
51
51
|
| `easyspecs.orchestration.*` | Macro delays, outer iterations, ping-pong cap, etc. |
|
|
52
52
|
| `easyspecs.openCodeRuntime` | Annex-aligned block: `providers` (per-provider `apiKey`, `defaultModel`), `run`, `coordinationRepairs`, `pool`, `projectConfigOverlay` — see [`srs-43-opencode.schema.json`](../../.gluecharm/docs/srs/srs-43-opencode.schema.json). |
|
|
53
|
+
| `easyspecs.diagnose.zeroReference.maxPercentNonReferenced` | `number` \| **`null`**. When **`null`**, `diagnose reference-coverage` does not fail on percent alone (**SRS-44**). |
|
|
54
|
+
| `easyspecs.diagnose.coordinationDuplicates.strict` | Boolean (default **`true`**). When **`true`**, duplicate/orphan rows fail `diagnose coordination-duplicates`. |
|
|
55
|
+
| `easyspecs.upload.contextDirectory` | Repo-relative or absolute override for **`upload republish`** context dir; empty **`""`** → automatic (analysis snapshot). |
|
|
56
|
+
| `easyspecs.macro.debug` | When **`true`**, macro phase transitions log to stderr ([`macroHeadlessHost`](../../src/analysis/macroHeadlessHost.ts)). |
|
|
57
|
+
| `easyspecs.cli.bundledResourcesRoot` | Optional path to bundled **`resources/`** (folder containing **`opencode-agents/`**). Empty → infer next to the CLI package. |
|
|
58
|
+
| `easyspecs.auth.ciLogin.email` / `password` | Used only with **`--ci`** when **`--email` / `--password`** are omitted (**SRS-44**). Prefer CI-generated **`config.json`**; do not commit secrets. |
|
|
53
59
|
|
|
54
60
|
### Resolved System Manager URL (`easyspecs-cli`)
|
|
55
61
|
|
|
@@ -57,16 +63,9 @@ Merge uses **this file + global CLI flags only** — no `EASYSPECS_*` / `VITE_*`
|
|
|
57
63
|
|
|
58
64
|
Built-in defaults ship in [`src/easyspecsBuiltInApiUrls.ts`](../../src/easyspecsBuiltInApiUrls.ts).
|
|
59
65
|
|
|
60
|
-
###
|
|
66
|
+
### No EasySpecs `EASYSPECS_*` configuration env (**SRS-44**)
|
|
61
67
|
|
|
62
|
-
|
|
63
|
-
|----------|---------|
|
|
64
|
-
| `EASYSPECS_EMAIL` / `EASYSPECS_PASSWORD` | Optional legacy **`auth login`** when **`--ci`** is set and **`--email` / `--password`** are omitted (**SRS-43 §5.3**). Prefer explicit **`--email`** / **`--password`** on the command line for scripts (credentials appear in process listings — avoid shared machines). |
|
|
65
|
-
| `EASYSPECS_EXTENSION_ROOT` | Extension/monorepo root for bundled resources. |
|
|
66
|
-
| `EASYSPECS_CLI_RESOURCES` | Override directory containing **`opencode-agents/`**. |
|
|
67
|
-
| `EASYSPECS_UPLOAD_CONTEXT_DIR` | Upload republish context dir bridging. |
|
|
68
|
-
| `EASYSPECS_CLI_MACRO_DEBUG` | Macro extra logging ([`macroHeadlessHost`](../../src/analysis/macroHeadlessHost.ts)). |
|
|
69
|
-
| OS-level (e.g. `PATH`) | Finding `node`, `opencode`, `git`. |
|
|
68
|
+
**`easyspecs-cli`** does **not** read **`EASYSPECS_*`**, **`VITE_*`**, or **`.env`** for product settings — use **`.easyspecs/config.json`** (+ global CLI flags) only. OS-level variables such as **`PATH`** still apply for finding **`node`**, **`opencode`**, **`git`**.
|
|
70
69
|
|
|
71
70
|
Provider API keys for OpenCode runs should live under **`easyspecs.openCodeRuntime.providers`** in **`config.json`**; they are injected into the **child** OpenCode process (**R13**) and redacted in **`doctor --inspect-config`** (**R17**).
|
|
72
71
|
|
|
@@ -95,19 +94,19 @@ Each row lists **command-specific CLI tokens**, then **what configuration applie
|
|
|
95
94
|
| `config init` | Optional **`--overwrite`** | Creates **`<repo>/.easyspecs/config.json`** with full defaults if missing; imports legacy **`cli.json`** / **`settings.json`** (ACE) when present, same as first-time bootstrap. If the file already exists, does nothing unless **`--overwrite`** (replaces with that bootstrap content). Does not run other commands. |
|
|
96
95
|
| `config set-project-id <id>` | — | Writes **`easyspecs.easyspecsProjectId`** to **`config.json`**, replacing any previous value. Creates **`config.json`** (defaults + legacy import) if missing. |
|
|
97
96
|
| `config set-git-remote <url>` | — | Writes **`easyspecs.defaultGitRemoteUrl`** to **`config.json`**, replacing any previous value. Same bootstrap-if-missing behaviour as **`set-project-id`**. |
|
|
98
|
-
| `auth login` | **`--email <email> --password <password>`**, optional **`--session-path <path>`** (tail; updates **`config.json`**) | Calls **`POST /api/authentication/login`**. On success prints **`OK`** (stdout), exit **0**, and writes tokens + **`apiBaseUrl`** to the session file. Tail **`--session-path`** updates **`easyspecs.cliSessionPath`** in **`config.json`** (normalized repo-relative when under the repo) and writes the session there for this run; omit it to use the existing **`easyspecs.cliSessionPath`** / default **`~/.easyspecs/cli-session.json`**. Global **`--session-path`** (before the command) overrides the effective session file for any command without changing **`config.json`**. On failure prints **`KO: …`** (stderr), exit **`auth`**.
|
|
97
|
+
| `auth login` | **`--email <email> --password <password>`**, optional **`--session-path <path>`** (tail; updates **`config.json`**) | Calls **`POST /api/authentication/login`**. On success prints **`OK`** (stdout), exit **0**, and writes tokens + **`apiBaseUrl`** to the session file. Tail **`--session-path`** updates **`easyspecs.cliSessionPath`** in **`config.json`** (normalized repo-relative when under the repo) and writes the session there for this run; omit it to use the existing **`easyspecs.cliSessionPath`** / default **`~/.easyspecs/cli-session.json`**. Global **`--session-path`** (before the command) overrides the effective session file for any command without changing **`config.json`**. On failure prints **`KO: …`** (stderr), exit **`auth`**. **`easyspecs-cli --ci auth login`** without argv credentials uses **`easyspecs.auth.ciLogin`** in **`config.json`**. **`--password`** on argv is visible to **`ps`**. |
|
|
99
98
|
| `auth logout` | — | Deletes the effective session file (same path rules as **`auth login`**). |
|
|
100
99
|
| `auth status` | — | Reads session file. |
|
|
101
100
|
| `run synthesis` | — | Single SRS-9 context pass (same as extension **Run Analysis**). **`requireOpenCode`** → executable + credentials unless skip flag. Uses **`merged.pipelineOpenCode`** from **`config.json`**. **`--promote` / `--no-promote`** controls promotion after success. |
|
|
102
101
|
| `run synthesis resume-missing`, `run synthesis resume-synthesis` | Optional **`--worktree <path>`** | Same implementation: resolves checkout via `--worktree` or stored snapshot ([`resolveAdHocCheckoutRoot`](../../src/cli/main.ts)). OpenCode + **`merged.pipelineOpenCode`**. |
|
|
103
|
-
| `analysis` | Optional tokens anywhere in argv: **`--synthesis-only`**, **`--upload`** | **SRS-32** full loop: synthesis convergence (until no missing artefacts), then coverage, zero-ref, report, index, optional backend sync. **`merged.macroOrchestration`** from config + **`--ci`** defaults. **`--upload`** requires prior **`auth login`** session. **`
|
|
104
|
-
| `diagnose reference-coverage` | **`--root workspace`** \| **`--root worktree`**, optional **`--worktree <path>`** |
|
|
105
|
-
| `diagnose coordination-duplicates` | Same **`--root`** / **`--worktree`** | **`
|
|
102
|
+
| `analysis` | Optional tokens anywhere in argv: **`--synthesis-only`**, **`--upload`** | **SRS-32** full loop: synthesis convergence (until no missing artefacts), then coverage, zero-ref, report, index, optional backend sync. **`merged.macroOrchestration`** from config + **`--ci`** defaults. **`--upload`** requires prior **`auth login`** session. Macro debug: **`easyspecs.macro.debug`**. OpenCode options from **`merged.pipelineOpenCode`**. |
|
|
103
|
+
| `diagnose reference-coverage` | **`--root workspace`** \| **`--root worktree`**, optional **`--worktree <path>`** | Gate when **`easyspecs.diagnose.zeroReference.maxPercentNonReferenced`** is a finite number (not **`null`**): failure when metric exceeds it. |
|
|
104
|
+
| `diagnose coordination-duplicates` | Same **`--root`** / **`--worktree`** | **`easyspecs.diagnose.coordinationDuplicates.strict`**: when **`true`** (default), duplicate/orphan issues fail the exit code. |
|
|
106
105
|
| `diagnose coverage-report` | Same **`--root`** / **`--worktree`** | Uses repo/worktree paths only; no extra env in `main.ts`. |
|
|
107
106
|
| `diagnose missing-artefacts` | Same **`--root`** / **`--worktree`** | Reads artefact snapshot from workspace state; no OpenCode. |
|
|
108
107
|
| `diagnose zero-reference` | Optional **`--worktree <path>`** (no `--root` branch in this handler) | **`requireOpenCode`**; **`merged.pipelineOpenCode`** for pool concurrency/argv/timeout. Checkout from **`--worktree`** or snapshot ([`resolveAdHocCheckoutRoot`](../../src/cli/main.ts)). |
|
|
109
108
|
| `upload context` | — | Requires **`auth`** session. Context dir: **`<repoRoot>/.gluecharm/context`**. Project id: **`easyspecs.easyspecsProjectId`** in **`config.json`** only. |
|
|
110
|
-
| `upload republish` | — | Same auth + upload pipeline; context dir from **`
|
|
109
|
+
| `upload republish` | — | Same auth + upload pipeline; context dir from **`easyspecs.upload.contextDirectory`** if non-empty and valid, else analysis worktree **`…/.gluecharm/context`** from snapshot, else error. Same project id rule as **`upload context`**. |
|
|
111
110
|
| `ace clear` | — | Deletes **`<repoRoot>/.gluecharm/context/learnings`**. |
|
|
112
111
|
| `ace learn` | Optional **`--worktree <path>`** | **`requireOpenCode`**; worktree chosen if `--worktree` points at checkout with **`.opencode/schemas/ace`**, else **`repoRoot`** ([`main.ts`](../../src/cli/main.ts)). **`merged.pipelineOpenCode`** for spawn argv/timeout. |
|
|
113
112
|
| `ace auto-learn` | Optional **`--worktree <path>`** | **`requireOpenCode`**; checkout = `--worktree` if valid git dir, else **`repoRoot`**. **`merged.pipelineOpenCode.maxConcurrentOpenCodeAgents`** caps parallelism. |
|
|
@@ -117,6 +116,6 @@ Each row lists **command-specific CLI tokens**, then **what configuration applie
|
|
|
117
116
|
## Notes
|
|
118
117
|
|
|
119
118
|
- Commands that **spawn OpenCode** call **`requireOpenCode`**: binary must respond (`easyspecs.openCode.executable` / `opencode` on **`PATH`**), and credentials must look ready unless **`easyspecs.openCode.skipCredentialsCheck`**, or provider keys exist in **`config.json`**, or the parent shell already has provider env (probe behaviour in [`opencodeCli`](../../src/opencodeCli.ts)).
|
|
120
|
-
- **`upload`** / **`analysis --upload`** require a prior **`auth login`** session (**`--email`** / **`--password`**, or
|
|
119
|
+
- **`upload`** / **`analysis --upload`** require a prior **`auth login`** session (**`--email`** / **`--password`**, or **`--ci`** with **`easyspecs.auth.ciLogin`** in **`config.json`**).
|
|
121
120
|
- Unknown commands print help and exit with a usage error.
|
|
122
121
|
- Git subprocesses may set **`GIT_TERMINAL_PROMPT=0`** on the child environment ([`coverageReferenceValidation`](../../src/analysis/coverageReferenceValidation.ts)).
|