devworkspace 0.3.1 → 0.3.2
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/CHANGELOG.md +18 -1
- package/README.md +3 -1
- package/dist/cli/args.d.ts +42 -0
- package/dist/cli/args.js +12 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/help.js +52 -5
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/render.d.ts +10 -0
- package/dist/cli/render.js +167 -0
- package/dist/cli/render.js.map +1 -1
- package/dist/cli/run.js +84 -4
- package/dist/cli/run.js.map +1 -1
- package/dist/config/schemas.d.ts +6 -0
- package/dist/config/schemas.js +6 -0
- package/dist/config/schemas.js.map +1 -1
- package/dist/core/version.d.ts +7 -0
- package/dist/core/version.js +13 -0
- package/dist/core/version.js.map +1 -1
- package/dist/core/workspace.d.ts +1 -0
- package/dist/core/workspace.js +1 -0
- package/dist/core/workspace.js.map +1 -1
- package/dist/discovery/commands.d.ts +1 -0
- package/dist/discovery/commands.js +3 -1
- package/dist/discovery/commands.js.map +1 -1
- package/dist/features/schema.d.ts +3 -0
- package/dist/features/schema.js +79 -0
- package/dist/features/schema.js.map +1 -0
- package/dist/features/types.d.ts +77 -0
- package/dist/features/types.js +2 -0
- package/dist/features/types.js.map +1 -0
- package/dist/features/validate.d.ts +14 -0
- package/dist/features/validate.js +124 -0
- package/dist/features/validate.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/services/doctor.js +34 -0
- package/dist/services/doctor.js.map +1 -1
- package/dist/services/drift.d.ts +21 -0
- package/dist/services/drift.js +89 -0
- package/dist/services/drift.js.map +1 -0
- package/dist/services/features.d.ts +22 -0
- package/dist/services/features.js +105 -0
- package/dist/services/features.js.map +1 -0
- package/dist/services/graph.d.ts +97 -0
- package/dist/services/graph.js +342 -0
- package/dist/services/graph.js.map +1 -0
- package/dist/services/refresh.js +15 -0
- package/dist/services/refresh.js.map +1 -1
- package/dist/services/setup.d.ts +56 -0
- package/dist/services/setup.js +116 -0
- package/dist/services/setup.js.map +1 -0
- package/dist/services/status.d.ts +6 -0
- package/dist/services/status.js +16 -0
- package/dist/services/status.js.map +1 -1
- package/dist/services/verify.d.ts +11 -0
- package/dist/services/verify.js +64 -2
- package/dist/services/verify.js.map +1 -1
- package/docs/architecture-report/01-executive-summary.md +168 -0
- package/docs/architecture-report/02-system-architecture.md +356 -0
- package/docs/architecture-report/03-tools-and-technologies.md +112 -0
- package/docs/architecture-report/04-execution-flows.md +257 -0
- package/docs/architecture-report/05-codebase-map.md +150 -0
- package/docs/architecture-report/06-command-reference.md +446 -0
- package/docs/architecture-report/07-data-flow-and-integrations.md +268 -0
- package/docs/architecture-report/08-build-test-deployment.md +185 -0
- package/docs/architecture-report/09-security-and-reliability.md +165 -0
- package/docs/architecture-report/10-feature-status.md +110 -0
- package/docs/architecture-report/11-glossary.md +97 -0
- package/docs/architecture-report/README.md +103 -0
- package/docs/architecture-report/diagrams.md +446 -0
- package/docs/getting-started.md +38 -1
- package/package.json +1 -1
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
# Chapter 6: CLI Command Reference
|
|
2
|
+
|
|
3
|
+
> **Exhaustive reference for all DevWorkspace CLI commands: syntax, flags, execution mechanics, filesystem side effects, and read-only safety guarantees.**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Overview & Command Safety Taxonomy
|
|
8
|
+
|
|
9
|
+
The DevWorkspace CLI provides a suite of 18 commands designed for developers and autonomous AI coding agents (Claude Code, Cursor, Codex, Copilot, Antigravity).
|
|
10
|
+
|
|
11
|
+
Every command adheres to strict architectural standards:
|
|
12
|
+
1. **Zero Interactive Prompts**: DevWorkspace never hangs waiting for stdin (`readline`). Destructive or mutative operations require explicit command-line flags (e.g., `--yes`).
|
|
13
|
+
2. **Dual Output Modes**: Commands output colorized/ASCII human-readable text by default, or deterministic JSON via `--json`.
|
|
14
|
+
3. **Execution Safety Taxonomy**: Commands are strictly partitioned into **Read-Only / Safe**, **Managed Local Mutating**, and **Guarded Destructive** operations.
|
|
15
|
+
|
|
16
|
+
| Safety Category | Description | Commands |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| 🟢 **Read-Only / Safe** | Inspects filesystem and environment without altering any files or process state. Zero risk. | `status`, `doctor` (without `--fix`), `context`, `fact list`, `task list`, `task show`, `testenv list`, `decision list`, `decision show`, `session list`, `agent list`, `integrations status` |
|
|
19
|
+
| 🟡 **Managed Local Mutating** | Writes or updates structured records in `.devworkspace/` using atomic file operations. | `init`, `analyze`, `refresh`, `fact add`, `fact verify`, `fact remove`, `task new`, `task update`, `task verify`, `task tests`, `task attest`, `task status`, `testenv declare`, `testenv revoke`, `decision add`, `session save`, `agent install`, `export`, `import`, `doctor --fix`, `migrate` |
|
|
20
|
+
| 🔴 **Guarded Destructive / Hazardous** | Permanently deletes workspace state or executes shell checks. Strictly blocked without `--yes` or testenv declaration. | `reset` (requires `--yes`), `task run` (restricted to safe read-only contract checks unless testenv is declared) |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 2. Common Global Options
|
|
25
|
+
|
|
26
|
+
Every DevWorkspace command supports the following global options:
|
|
27
|
+
|
|
28
|
+
- `--json`: Formats stdout as machine-readable JSON for AI agents and scripts. All status and log messages route to stderr.
|
|
29
|
+
- `--cwd <dir>`: Sets the target directory as if the command were executed directly from `<dir>`.
|
|
30
|
+
- `--root <dir>`: Explicitly specifies the repository root (defaults to Git top-level or current working directory).
|
|
31
|
+
- `--debug`: Prints full stack traces and debug logging to stderr.
|
|
32
|
+
- `--no-color`: Disables ANSI color escapes (automatically detected if stdout is not a TTY or `NO_COLOR` is set).
|
|
33
|
+
- `--ascii`: Replaces Unicode symbols (`✓`, `✗`, `→`) with ASCII equivalents (`[OK]`, `[FAIL]`, `->`).
|
|
34
|
+
- `--dry-run`: Previews actions and changes without writing files or modifying state.
|
|
35
|
+
- `--help` / `-h`: Displays command-specific help and exits with status `0`.
|
|
36
|
+
- `--version` / `-v`: Displays package version (`0.3.1`) and exits with status `0`.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 3. Comprehensive Command Catalog
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
### 3.1. `devworkspace init`
|
|
45
|
+
**Summary**: Initializes `.devworkspace/` inside the current repository.
|
|
46
|
+
**Safety**: 🟡 Managed Local Mutating (Safe to re-run; idempotent).
|
|
47
|
+
**Source Handler**: [`src/cli/run.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/cli/run.ts) calls `initWorkspace()` in [`src/services/init.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/init.ts).
|
|
48
|
+
|
|
49
|
+
#### Syntax
|
|
50
|
+
```bash
|
|
51
|
+
devworkspace init [--root <dir>] [--dry-run] [--with-integrations [--yes] [--scope project|user]]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
#### Options
|
|
55
|
+
- `--root <dir>`: Sets custom project root.
|
|
56
|
+
- `--dry-run`: Shows directories and files that would be created without touching disk.
|
|
57
|
+
- `--with-integrations`: Immediately chains into integration setup (`setup --integrations`).
|
|
58
|
+
- `--yes`: Approves user-level integration installations.
|
|
59
|
+
- `--scope project|user`: Target scope for integrations (default: `project`).
|
|
60
|
+
|
|
61
|
+
#### Execution Mechanics & Side Effects
|
|
62
|
+
1. Creates directory hierarchy: `.devworkspace/`, `context/`, `tasks/active/`, `tasks/completed/`, `decisions/`, `sessions/`, `analysis/`, and `local/`.
|
|
63
|
+
2. Creates `.devworkspace/project.json` containing repository UUID, project name, root path, and schema version.
|
|
64
|
+
3. Automatically adds `.devworkspace/local/` and migration backups to `.devworkspace/.gitignore`.
|
|
65
|
+
4. Initializes starter `context/facts.json`, `context/testing-contract.json`, and `context/commands.json`.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### 3.2. `devworkspace analyze`
|
|
70
|
+
**Summary**: Performs deterministic repository discovery and generates AI onboarding prompt.
|
|
71
|
+
**Safety**: 🟡 Managed Local Mutating (Pure Read-Only with `--dry-run`).
|
|
72
|
+
**Source Handler**: [`src/cli/run.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/cli/run.ts) calls `analyzeWorkspace()` in [`src/services/analysis.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/analysis.ts).
|
|
73
|
+
|
|
74
|
+
#### Syntax
|
|
75
|
+
```bash
|
|
76
|
+
devworkspace analyze [--dry-run] [--json]
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### Execution Mechanics & Side Effects
|
|
80
|
+
1. Walks the repository using bounded traversal (`src/discovery/scan.ts`), pruning ignored folders (`node_modules`, `.git`, `dist`, `target`).
|
|
81
|
+
2. Detects languages, package managers, frameworks, test runners, databases, and monorepo workspaces (`src/discovery/detect.ts`).
|
|
82
|
+
3. Discovers scripts from package manifests and maps them to standard testing contracts (typecheck, lint, unit, integration, e2e, security, build).
|
|
83
|
+
4. Discovers documentation files (`README.md`, `CONTRIBUTING.md`, `docs/`) and entrypoints (`main.ts`, `index.js`, `app.py`).
|
|
84
|
+
5. Atomically writes `.devworkspace/analysis/discovery.json` and `.devworkspace/analysis/onboarding-prompt.md`.
|
|
85
|
+
6. Generates or updates `.devworkspace/context/facts.json` with high-confidence detected facts.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### 3.3. `devworkspace status`
|
|
90
|
+
**Summary**: Provides a high-level operational overview of repository and workspace health.
|
|
91
|
+
**Safety**: 🟢 Read-Only / Safe.
|
|
92
|
+
**Source Handler**: [`src/cli/run.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/cli/run.ts) calls `getStatus()` in [`src/services/status.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/status.ts).
|
|
93
|
+
|
|
94
|
+
#### Syntax
|
|
95
|
+
```bash
|
|
96
|
+
devworkspace status [--strict] [--deep] [--json]
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### Options
|
|
100
|
+
- `--strict`: Returns exit code `3` if any warnings, stale knowledge, or missing onboarding files exist.
|
|
101
|
+
- `--deep`: Runs deep integration connectivity checks (identical to `doctor`).
|
|
102
|
+
|
|
103
|
+
#### Execution Mechanics & Side Effects
|
|
104
|
+
- Reads `project.json`, Git status (`HEAD`, branch, clean/dirty), task count by status, active decisions, stale facts, and integration state.
|
|
105
|
+
- Does not modify any files. Returns exit code `0` (healthy), `1` (unreadable or not initialized), or `3` (strict warnings).
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
### 3.4. `devworkspace doctor`
|
|
110
|
+
**Summary**: Diagnoses workspace consistency, security integrity, and integration health.
|
|
111
|
+
**Safety**: 🟢 Read-Only / Safe (🟡 Managed Local Mutating when run with `--fix`).
|
|
112
|
+
**Source Handler**: [`src/cli/run.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/cli/run.ts) calls `runDoctor()` in [`src/services/doctor.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/doctor.ts).
|
|
113
|
+
|
|
114
|
+
#### Syntax
|
|
115
|
+
```bash
|
|
116
|
+
devworkspace doctor [--fix] [--strict] [--json]
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
#### Options
|
|
120
|
+
- `--fix`: Safely repairs missing directories, restores corrupt schema templates, and re-adds missing `.gitignore` rules (never deletes user data).
|
|
121
|
+
- `--strict`: Exits with code `3` if any warnings are detected.
|
|
122
|
+
|
|
123
|
+
#### Diagnostic Checks Performed
|
|
124
|
+
- **Workspace**: Verifies `.devworkspace/project.json`, directory structure, schema migrations, and write permissions.
|
|
125
|
+
- **Git**: Confirms Git repository presence, verifies `.gitignore` ignores `local/` and temporary files.
|
|
126
|
+
- **Security**: Verifies absence of tracked secret files (`.env`, private keys) and checks for symlink escape risks.
|
|
127
|
+
- **Integrations**: Checks PATH presence and tool versions for Graphify, Agent Skills, and Ponytail.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
### 3.5. `devworkspace refresh`
|
|
132
|
+
**Summary**: Re-evaluates repository state, updates discovery, and flags stale facts.
|
|
133
|
+
**Safety**: 🟡 Managed Local Mutating (Pure Read-Only with `--dry-run`).
|
|
134
|
+
**Source Handler**: [`src/cli/run.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/cli/run.ts) calls `refreshWorkspace()` in [`src/services/refresh.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/refresh.ts).
|
|
135
|
+
|
|
136
|
+
#### Syntax
|
|
137
|
+
```bash
|
|
138
|
+
devworkspace refresh [--dry-run] [--json]
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
#### Execution Mechanics & Side Effects
|
|
142
|
+
1. Re-runs detection engine across package manifests and codebase structure.
|
|
143
|
+
2. Compares modification timestamps and content hashes of files evidencing existing facts.
|
|
144
|
+
3. Automatically marks facts `STALE` if their source files have changed or been removed.
|
|
145
|
+
4. Updates `.devworkspace/analysis/discovery.json` and refreshes `.devworkspace/context/facts.json`.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
### 3.6. `devworkspace context`
|
|
150
|
+
**Summary**: Displays project context, testing contracts, and architecture facts.
|
|
151
|
+
**Safety**: 🟢 Read-Only / Safe.
|
|
152
|
+
**Source Handler**: [`src/cli/run.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/cli/run.ts) calls `getContext()` in [`src/services/knowledge.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/knowledge.ts) or `getTaskContext()` in [`src/services/taskContext.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/taskContext.ts).
|
|
153
|
+
|
|
154
|
+
#### Syntax
|
|
155
|
+
```bash
|
|
156
|
+
devworkspace context [--for <request>] [--topic <prefix>] [--full] [--json]
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
#### Options
|
|
160
|
+
- `--for <request>`: **Progressive Context Mode**. Dynamically classifies `<request>`, retrieving only the relevant package facts, commands, and active task info while suppressing irrelevant noise.
|
|
161
|
+
- `--topic <prefix>`: Filters facts by namespace prefix (e.g., `auth`, `db`, `deploy`).
|
|
162
|
+
- `--full`: Includes full text of all markdown files in `.devworkspace/context/`.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
### 3.7. `devworkspace fact`
|
|
167
|
+
**Summary**: Manages durable project knowledge facts with evidence tracking.
|
|
168
|
+
**Safety**: 🟢 Safe for `list`; 🟡 Managed Local Mutating for `add`, `verify`, `remove`.
|
|
169
|
+
**Source Handler**: [`src/cli/run.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/cli/run.ts) calls `addFact()`, `verifyFactByKey()`, `removeFactByKey()` in [`src/services/knowledge.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/knowledge.ts).
|
|
170
|
+
|
|
171
|
+
#### Subcommands & Syntax
|
|
172
|
+
```bash
|
|
173
|
+
# Add or update a fact
|
|
174
|
+
devworkspace fact add --key <key> --value <text> --source <desc> [--file <rel-path>...] [--source-type ai|user|file|git] [--confidence HIGH|MEDIUM|LOW] [--status VERIFIED|INFERRED|UNKNOWN]
|
|
175
|
+
|
|
176
|
+
# Mark a fact VERIFIED
|
|
177
|
+
devworkspace fact verify <key>
|
|
178
|
+
|
|
179
|
+
# Delete a fact
|
|
180
|
+
devworkspace fact remove <key>
|
|
181
|
+
|
|
182
|
+
# List all facts
|
|
183
|
+
devworkspace fact list [--json]
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
#### Authority Ranking Rules
|
|
187
|
+
When an update is submitted, DevWorkspace enforces authority ranking:
|
|
188
|
+
- `user` (Rank 4) can overwrite any fact.
|
|
189
|
+
- `file` / `git` (Rank 3) can overwrite `ai` facts.
|
|
190
|
+
- `ai` (Rank 2) **cannot** overwrite a `user` or `file`-derived fact.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
### 3.8. `devworkspace task`
|
|
195
|
+
**Summary**: Core engineering workflow engine tracking task lifecycles and enforcing completion gates.
|
|
196
|
+
**Safety**: 🟢 Safe for `list`, `show`; 🟡 Mutating for `new`, `update`, `status`, `verify`, `tests`, `attest`; 🔴 Guarded Execution for `run`.
|
|
197
|
+
**Source Handler**: [`src/cli/run.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/cli/run.ts) calls handlers in [`src/services/tasks.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/tasks.ts) and [`src/services/verify.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/verify.ts).
|
|
198
|
+
|
|
199
|
+
#### Subcommands & Syntax
|
|
200
|
+
```bash
|
|
201
|
+
# 1. Create a new task (auto-classified)
|
|
202
|
+
devworkspace task new "<request>" [--type BUG|FEATURE|REFACTOR|DOCS|INVESTIGATION] [--title <text>]
|
|
203
|
+
|
|
204
|
+
# 2. List tasks
|
|
205
|
+
devworkspace task list [--all] [--json]
|
|
206
|
+
|
|
207
|
+
# 3. Inspect task details & completion gate status
|
|
208
|
+
devworkspace task show <id> [--json]
|
|
209
|
+
|
|
210
|
+
# 4. Update task metadata, plan, or criteria
|
|
211
|
+
devworkspace task update <id> [--title <t>] [--summary <s>] [--criteria <c>...] [--plan <p>...] [--area <a>...] [--blocker <b>...] [--clear-blockers] [--require <check>...]
|
|
212
|
+
|
|
213
|
+
# 5. Execute a verification check from the testing contract
|
|
214
|
+
devworkspace task run <id> <check> [--package <dir>] [--timeout <seconds>]
|
|
215
|
+
|
|
216
|
+
# 6. Record external verification outcome
|
|
217
|
+
devworkspace task verify <id> <check> pass|fail|skip|pending [--package <dir>] [--reason user-override] [--detail <text>]
|
|
218
|
+
|
|
219
|
+
# 7. Record test suite execution counts
|
|
220
|
+
devworkspace task tests <id> --phase baseline|after --passed <n> --failed <n>
|
|
221
|
+
|
|
222
|
+
# 8. Submit mandatory completion attestations
|
|
223
|
+
devworkspace task attest <id> [--user-work-intact] [--knowledge-reviewed] [--final-state-inspected]
|
|
224
|
+
|
|
225
|
+
# 9. Update task status (enforces completion gate if target is COMPLETED)
|
|
226
|
+
devworkspace task status <id> <TODO|IN_PROGRESS|BLOCKED|COMPLETED|CANCELLED> [--note <text>]
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
#### Completion Gate Requirements
|
|
230
|
+
To transition a task to `COMPLETED`, `evaluateGate()` validates:
|
|
231
|
+
1. All required testing contract checks have passed (executed or claimed with user override).
|
|
232
|
+
2. Regression check passes: `after.failed <= baseline.failed`.
|
|
233
|
+
3. Completion summary is populated (`devworkspace task update <id> --summary "..."`).
|
|
234
|
+
4. Read-only requests made zero file mutations.
|
|
235
|
+
5. All 3 human attestations are verified: `--user-work-intact`, `--knowledge-reviewed`, `--final-state-inspected`.
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
### 3.9. `devworkspace testenv`
|
|
240
|
+
**Summary**: Declares local test environments so database-touching checks can execute safely.
|
|
241
|
+
**Safety**: 🟡 Managed Local Mutating (writes to git-ignored `.devworkspace/local/testenv.json`).
|
|
242
|
+
**Source Handler**: [`src/cli/run.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/cli/run.ts) calls `declareTestEnv()`, `listTestEnv()`, `revokeTestEnv()` in [`src/services/verify.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/verify.ts).
|
|
243
|
+
|
|
244
|
+
#### Subcommands & Syntax
|
|
245
|
+
```bash
|
|
246
|
+
# Declare an isolated test environment
|
|
247
|
+
devworkspace testenv declare --package <dir> --check <unit|integration|e2e|security> [--check ...] --target "<text>" --yes
|
|
248
|
+
|
|
249
|
+
# List active declarations
|
|
250
|
+
devworkspace testenv list [--json]
|
|
251
|
+
|
|
252
|
+
# Revoke a declaration
|
|
253
|
+
devworkspace testenv revoke --package <dir>
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
#### Security Guard
|
|
257
|
+
- DevWorkspace blocks execution of checks requiring external services (PostgreSQL, Redis, MySQL, MongoDB) unless explicitly declared here.
|
|
258
|
+
- The `--target` must describe the environment (e.g. `"disposable docker-compose container"`). Storing connection strings or credentials is strictly prohibited and rejected.
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
### 3.10. `devworkspace decision`
|
|
263
|
+
**Summary**: Manages Architecture Decision Records (ADRs) as durable markdown documents.
|
|
264
|
+
**Safety**: 🟢 Safe for `list`, `show`; 🟡 Mutating for `add`.
|
|
265
|
+
**Source Handler**: [`src/cli/run.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/cli/run.ts) calls `recordDecision()`, `getDecisions()`, `getDecision()` in [`src/services/records.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/records.ts).
|
|
266
|
+
|
|
267
|
+
#### Subcommands & Syntax
|
|
268
|
+
```bash
|
|
269
|
+
# Add a new ADR
|
|
270
|
+
devworkspace decision add --title <text> --context <text> --decision <text> --consequences <text> [--supersedes <number>]
|
|
271
|
+
|
|
272
|
+
# List all ADRs
|
|
273
|
+
devworkspace decision list [--json]
|
|
274
|
+
|
|
275
|
+
# Show specific ADR
|
|
276
|
+
devworkspace decision show <number>
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
#### Filesystem Storage
|
|
280
|
+
- Stored as sequential Markdown files: `.devworkspace/decisions/0001-use-postgresql.md`.
|
|
281
|
+
- Implements standard ADR structure: Number, Title, Status (Proposed/Accepted/Superseded), Date, Context, Decision, Consequences.
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
### 3.11. `devworkspace session`
|
|
286
|
+
**Summary**: Records concise engineering session handoffs and resumption points.
|
|
287
|
+
**Safety**: 🟢 Safe for `list`; 🟡 Mutating for `save`.
|
|
288
|
+
**Source Handler**: [`src/cli/run.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/cli/run.ts) calls `recordSession()`, `getSessions()` in [`src/services/records.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/records.ts).
|
|
289
|
+
|
|
290
|
+
#### Subcommands & Syntax
|
|
291
|
+
```bash
|
|
292
|
+
# Save a session handoff
|
|
293
|
+
devworkspace session save --goal <goal> [--done <item>...] [--area <path>...] [--tests-run <desc>...] [--decision-note <note>...] [--remaining <item>...] [--next <action>] [--task <id>]
|
|
294
|
+
|
|
295
|
+
# List recent sessions
|
|
296
|
+
devworkspace session list [--limit <n>] [--json]
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
#### Privacy & Token Economy
|
|
300
|
+
DevWorkspace stores **summarized milestones and handoffs only**. It strictly rejects full conversation transcripts, preserving AI context windows and preventing sensitive conversational leaks.
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
### 3.12. `devworkspace agent`
|
|
305
|
+
**Summary**: Manages multi-agent instruction files and rule synchronizations.
|
|
306
|
+
**Safety**: 🟢 Safe for `list`; 🟡 Mutating for `install`.
|
|
307
|
+
**Source Handler**: [`src/cli/run.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/cli/run.ts) calls `installAgent()`, `listAgents()` in [`src/services/agent.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/agent.ts).
|
|
308
|
+
|
|
309
|
+
#### Subcommands & Syntax
|
|
310
|
+
```bash
|
|
311
|
+
# Install instructions for coding agents
|
|
312
|
+
devworkspace agent install [--agent claude|codex|cursor|copilot|all] [--dry-run]
|
|
313
|
+
|
|
314
|
+
# List supported and detected agent configurations
|
|
315
|
+
devworkspace agent list [--json]
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
#### Supported Agents & Targets
|
|
319
|
+
- `claude`: Injects managed block into `CLAUDE.md`.
|
|
320
|
+
- `codex`: Injects managed block into `AGENTS.md`.
|
|
321
|
+
- `cursor`: Writes `.cursor/rules/devworkspace.mdc` or merges into `.cursorrules`.
|
|
322
|
+
- `copilot`: Injects into `.github/copilot-instructions.md`.
|
|
323
|
+
- `all`: Installs/updates rules for all 4 agents simultaneously.
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
### 3.13. `devworkspace setup`
|
|
328
|
+
**Summary**: Installs and verifies external developer tools (Graphify, Agent Skills, Ponytail).
|
|
329
|
+
**Safety**: 🟡 Managed Local Mutating (requires `--yes` for machine/user scope).
|
|
330
|
+
**Source Handler**: [`src/cli/run.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/cli/run.ts) calls `setupIntegrations()` in [`src/services/integrations.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/integrations.ts).
|
|
331
|
+
|
|
332
|
+
#### Syntax
|
|
333
|
+
```bash
|
|
334
|
+
devworkspace setup --integrations [--yes] [--dry-run] [--scope project|user] [--only graphify,agent-skills,ponytail] [--json]
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
#### Options
|
|
338
|
+
- `--integrations`: Explicitly designates integrations setup.
|
|
339
|
+
- `--yes`: Approves operations that modify user global settings or invoke package managers.
|
|
340
|
+
- `--scope project|user`: Target scope (default: `project`).
|
|
341
|
+
- `--only <ids>`: Restricts setup to comma-separated integration IDs.
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
### 3.14. `devworkspace integrations`
|
|
346
|
+
**Summary**: Inspects observed installation health or repairs integrations.
|
|
347
|
+
**Safety**: 🟢 Safe for `status`; 🟡 Mutating for `repair`.
|
|
348
|
+
**Source Handler**: [`src/cli/run.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/cli/run.ts) calls `integrationsStatus()` in [`src/services/integrations.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/integrations.ts).
|
|
349
|
+
|
|
350
|
+
#### Subcommands & Syntax
|
|
351
|
+
```bash
|
|
352
|
+
# Check integration health
|
|
353
|
+
devworkspace integrations status [--quick] [--restarted] [--strict] [--json]
|
|
354
|
+
|
|
355
|
+
# Repair missing or corrupt integrations
|
|
356
|
+
devworkspace integrations repair [--yes] [--dry-run] [--only <ids>] [--scope project|user]
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
#### Verification Lifecycle Statuses
|
|
360
|
+
- `VERIFIED`: Tool is present on PATH, version meets requirements, and executable responds.
|
|
361
|
+
- `OBSERVED`: Binary detected, but deep invocation was bypassed (`--quick`).
|
|
362
|
+
- `RESTART_REQUIRED`: Installed successfully; waiting for Claude Code restart.
|
|
363
|
+
- `PREREQUISITES_MISSING`: Host lacks Python, Git, or Node.js.
|
|
364
|
+
- `FAILED`: Installation or verification exited with non-zero code.
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
### 3.15. `devworkspace export`
|
|
369
|
+
**Summary**: Bundles all workspace knowledge, decisions, sessions, and tasks into a portable JSON package.
|
|
370
|
+
**Safety**: 🟡 Managed Local Mutating (Pure Read-Only with `--dry-run`).
|
|
371
|
+
**Source Handler**: [`src/cli/run.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/cli/run.ts) calls `exportWorkspace()` in [`src/services/portability.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/portability.ts).
|
|
372
|
+
|
|
373
|
+
#### Syntax
|
|
374
|
+
```bash
|
|
375
|
+
devworkspace export [--out <file>] [--dry-run] [--json]
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
#### Portability Protections
|
|
379
|
+
- Generates a standalone JSON payload with SHA-256 integrity checksums.
|
|
380
|
+
- Automatically excludes machine-local state (`.devworkspace/local/`).
|
|
381
|
+
- Validates that no absolute filesystem paths or secret patterns leak into the bundle.
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
### 3.16. `devworkspace import`
|
|
386
|
+
**Summary**: Restores a portable knowledge bundle into `.devworkspace/`.
|
|
387
|
+
**Safety**: 🟡 Managed Local Mutating.
|
|
388
|
+
**Source Handler**: [`src/cli/run.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/cli/run.ts) calls `importWorkspace()` in [`src/services/portability.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/portability.ts).
|
|
389
|
+
|
|
390
|
+
#### Syntax
|
|
391
|
+
```bash
|
|
392
|
+
devworkspace import <file> [--dry-run] [--overwrite] [--allow-different-project] [--json]
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
#### Safeguards
|
|
396
|
+
- Verifies SHA-256 payload checksum before parsing.
|
|
397
|
+
- Verifies that `project.id` matches the current workspace (unless bypassed with `--allow-different-project`).
|
|
398
|
+
- Keeps timestamped backups (`.devworkspace/.backup-<date>/`) of all replaced files if `--overwrite` is specified.
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
402
|
+
### 3.17. `devworkspace reset`
|
|
403
|
+
**Summary**: Completely resets `.devworkspace/` to a clean slate.
|
|
404
|
+
**Safety**: 🔴 Guarded Destructive (Requires `--yes`).
|
|
405
|
+
**Source Handler**: [`src/cli/run.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/cli/run.ts) calls `resetWorkspace()` in [`src/services/reset.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/reset.ts).
|
|
406
|
+
|
|
407
|
+
#### Syntax
|
|
408
|
+
```bash
|
|
409
|
+
devworkspace reset [--include-agent-files] [--yes] [--dry-run] [--json]
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
#### Safeguards & Behavior
|
|
413
|
+
- If invoked without `--yes`, prints a dry-run plan of all directories scheduled for deletion and exits with code `2`.
|
|
414
|
+
- When `--include-agent-files` is provided, safely extracts and strips managed DevWorkspace blocks from `CLAUDE.md`, `AGENTS.md`, and `.cursorrules` without altering surrounding user text.
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
### 3.18. `devworkspace migrate`
|
|
419
|
+
**Summary**: Upgrades `.devworkspace/` schema files to the latest version.
|
|
420
|
+
**Safety**: 🟡 Managed Local Mutating.
|
|
421
|
+
**Source Handler**: [`src/cli/run.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/cli/run.ts) calls `migrateWorkspace()` in [`src/services/migrate.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/services/migrate.ts).
|
|
422
|
+
|
|
423
|
+
#### Syntax
|
|
424
|
+
```bash
|
|
425
|
+
devworkspace migrate [--dry-run] [--json]
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
#### Migration Mechanics
|
|
429
|
+
- Checks `schemaVersion` in `project.json` against current package version (`0.3.1`).
|
|
430
|
+
- Sequentially applies forward migrations ([`src/core/migrations.ts`](file:///d:/projects/codeing_stuff/devworkspace/src/core/migrations.ts)).
|
|
431
|
+
- Retains automatic rollbacks and snapshots before mutating schema structures.
|
|
432
|
+
|
|
433
|
+
---
|
|
434
|
+
|
|
435
|
+
## 4. Exit Code Contract
|
|
436
|
+
|
|
437
|
+
DevWorkspace adheres to POSIX exit code conventions to provide predictable integration with CI/CD runners and AI agents:
|
|
438
|
+
|
|
439
|
+
| Exit Code | Meaning | Examples |
|
|
440
|
+
|:---:|---|---|
|
|
441
|
+
| `0` | **Success / OK** | Command completed normally; check passed; gate evaluated cleanly. |
|
|
442
|
+
| `1` | **Execution Failure** | Workspace corrupt/unreadable; test verification failed; doctor health check failed. |
|
|
443
|
+
| `2` | **Usage Error / Approval Required** | Missing required flags (e.g. `--yes` on `reset`); invalid subcommand; schema validation error. |
|
|
444
|
+
| `3` | **Strict Warnings** | In `--strict` mode: doctor warnings detected; stale knowledge found; integrations incomplete. |
|
|
445
|
+
| `130` | **Interrupted** | Process interrupted by `SIGINT` (Ctrl+C) or `SIGTERM`. Cleanups executed; locks released. |
|
|
446
|
+
|