@mod-computer/cli 0.1.1 → 0.2.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/README.md +98 -76
- package/dist/cli.bundle.js +23750 -12931
- package/dist/cli.bundle.js.map +4 -4
- package/dist/cli.js +23 -12
- package/dist/commands/add.js +245 -0
- package/dist/commands/auth.js +129 -21
- package/dist/commands/comment.js +568 -0
- package/dist/commands/diff.js +182 -0
- package/dist/commands/index.js +33 -3
- package/dist/commands/init.js +475 -221
- package/dist/commands/ls.js +135 -0
- package/dist/commands/members.js +687 -0
- package/dist/commands/mv.js +282 -0
- package/dist/commands/rm.js +257 -0
- package/dist/commands/status.js +273 -306
- package/dist/commands/sync.js +99 -75
- package/dist/commands/trace.js +1752 -0
- package/dist/commands/workspace.js +354 -330
- package/dist/config/features.js +18 -7
- package/dist/config/release-profiles/development.json +4 -1
- package/dist/config/release-profiles/mvp.json +4 -2
- package/dist/daemon/conflict-resolution.js +172 -0
- package/dist/daemon/content-hash.js +31 -0
- package/dist/daemon/file-sync.js +985 -0
- package/dist/daemon/index.js +203 -0
- package/dist/daemon/mime-types.js +166 -0
- package/dist/daemon/offline-queue.js +211 -0
- package/dist/daemon/path-utils.js +64 -0
- package/dist/daemon/share-policy.js +83 -0
- package/dist/daemon/wasm-errors.js +189 -0
- package/dist/daemon/worker.js +557 -0
- package/dist/daemon-worker.js +3 -2
- package/dist/errors/workspace-errors.js +48 -0
- package/dist/lib/auth-server.js +89 -26
- package/dist/lib/browser.js +1 -1
- package/dist/lib/diff.js +284 -0
- package/dist/lib/formatters.js +204 -0
- package/dist/lib/git.js +137 -0
- package/dist/lib/local-fs.js +201 -0
- package/dist/lib/prompts.js +23 -83
- package/dist/lib/storage.js +11 -1
- package/dist/lib/trace-formatters.js +314 -0
- package/dist/services/add-service.js +554 -0
- package/dist/services/add-validation.js +124 -0
- package/dist/services/mod-config.js +8 -2
- package/dist/services/modignore-service.js +2 -0
- package/dist/stores/use-workspaces-store.js +36 -14
- package/dist/types/add-types.js +99 -0
- package/dist/types/config.js +1 -1
- package/dist/types/workspace-connection.js +53 -2
- package/package.json +7 -5
- package/commands/execute.md +0 -156
- package/commands/overview.md +0 -233
- package/commands/review.md +0 -151
- package/commands/spec.md +0 -169
package/README.md
CHANGED
|
@@ -1,106 +1,142 @@
|
|
|
1
1
|
# mod-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Spec-driven development with traceability. Connect your specs, code, and tests so reviews show the full picture.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Quick Start
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## Conceptual Overview
|
|
12
|
-
|
|
13
|
-
**Workspaces**: A workspace is a container for files, branches, and metadata. Create workspaces with `mod workspace create`, list them with `mod workspace list`, switch with `mod workspace switch`. Each workspace has its own history, collaborators, and sync state. A directory connects to one workspace at a time.
|
|
14
|
-
|
|
15
|
-
**Local-First Sync**: `mod sync start` launches a daemon that watches the local directory and syncs to the connected workspace. File edits, new files, deletions propagate automatically. Remote changes from collaborators sync back to local files. The daemon runs in the background; coding agents work locally as normal. Multiple collaborators can sync to the same workspace from different machines.
|
|
16
|
-
|
|
17
|
-
**Branching**: Mod branches are lightweight isolation scopes for work-in-progress. Unlike git branches, they don't require commits or staging. Create a branch, start working, and all changes are tracked automatically. When integrated with git, Mod branches map to git branches. Without git, Mod branches provide standalone isolation.
|
|
18
|
-
|
|
19
|
-
**Changelog**: Every file change on a branch is recorded automatically with timestamp, diff, and context. No manual commits required. The changelog captures what changed, when, and alongside what other activity (agent conversations, spec edits, collaborator comments). View at branch level or filter to a specific file.
|
|
20
|
-
|
|
21
|
-
**Reversion**: Restore to any point in the changelog. Revert an entire branch to a previous state, or revert a single file while keeping other files at their current state. Fine-grained reversion without needing explicit commits as restore points.
|
|
7
|
+
```bash
|
|
8
|
+
# Install
|
|
9
|
+
npm install -g @mod-computer/cli
|
|
22
10
|
|
|
23
|
-
|
|
11
|
+
# Initialize workspace (installs /mod skill for Claude Code)
|
|
12
|
+
mod init
|
|
13
|
+
mod auth login
|
|
24
14
|
|
|
25
|
-
|
|
15
|
+
# Start working
|
|
16
|
+
git checkout -b feat/user-auth
|
|
17
|
+
```
|
|
26
18
|
|
|
27
|
-
|
|
19
|
+
## The Idea
|
|
28
20
|
|
|
29
|
-
|
|
21
|
+
You write specs. Agents implement them. But at review time, how do you know what requirement each function addresses? What's tested? What changed but isn't connected to anything?
|
|
30
22
|
|
|
31
|
-
|
|
23
|
+
mod-cli builds a trace graph as you work:
|
|
32
24
|
|
|
33
|
-
|
|
25
|
+
```
|
|
26
|
+
Spec requirement → Implementation → Tests
|
|
27
|
+
```
|
|
34
28
|
|
|
35
|
-
|
|
29
|
+
At review, `mod trace report` shows what's connected. `mod trace diff` catches what isn't.
|
|
36
30
|
|
|
37
|
-
|
|
31
|
+
## Usage
|
|
38
32
|
|
|
39
|
-
|
|
33
|
+
### With Claude Code (Recommended)
|
|
40
34
|
|
|
41
|
-
|
|
35
|
+
`mod init` installs the `/mod` skill automatically. Use it to implement specs:
|
|
42
36
|
|
|
43
|
-
|
|
37
|
+
```bash
|
|
38
|
+
# Write a spec
|
|
39
|
+
claude "Write a spec for user authentication in specs/auth.md"
|
|
44
40
|
|
|
45
|
-
|
|
41
|
+
# Implement from spec - agent handles traces
|
|
42
|
+
claude "/mod implement specs/auth.md"
|
|
46
43
|
|
|
47
|
-
|
|
44
|
+
# Add tests - agent traces them to implementations
|
|
45
|
+
claude "/mod test specs/auth.md"
|
|
48
46
|
|
|
49
|
-
|
|
47
|
+
# Review coverage
|
|
48
|
+
mod trace report specs/auth.md
|
|
49
|
+
```
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
### Manual Workflow
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
```bash
|
|
54
|
+
# Add traces as you work
|
|
55
|
+
mod trace add specs/auth.md:15 --type=requirement
|
|
56
|
+
mod trace add src/auth/login.ts:42 --type=implementation --link=req-login--a1b2
|
|
54
57
|
|
|
55
|
-
|
|
58
|
+
# Link existing traces
|
|
59
|
+
mod trace link impl-login--a1b2 spec-login--c3d4
|
|
56
60
|
|
|
57
|
-
|
|
61
|
+
# View connections
|
|
62
|
+
mod trace report specs/auth.md
|
|
63
|
+
mod trace coverage
|
|
58
64
|
|
|
59
|
-
|
|
65
|
+
# Find gaps before merge
|
|
66
|
+
mod trace diff # Untraced files on branch
|
|
67
|
+
mod trace unmet # Requirements without implementations
|
|
68
|
+
```
|
|
60
69
|
|
|
61
|
-
## Commands
|
|
70
|
+
## Commands
|
|
62
71
|
|
|
63
|
-
###
|
|
72
|
+
### Setup
|
|
64
73
|
|
|
65
74
|
```bash
|
|
66
|
-
mod init
|
|
67
|
-
mod
|
|
68
|
-
mod
|
|
69
|
-
mod
|
|
70
|
-
mod sync import # Import existing files to workspace
|
|
75
|
+
mod init # Initialize workspace, install /mod skill
|
|
76
|
+
mod auth login # Authenticate
|
|
77
|
+
mod auth logout # Sign out
|
|
78
|
+
mod auth status # Show auth state
|
|
71
79
|
```
|
|
72
80
|
|
|
73
|
-
###
|
|
81
|
+
### Traces
|
|
74
82
|
|
|
75
83
|
```bash
|
|
76
|
-
|
|
77
|
-
mod
|
|
78
|
-
mod
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
mod
|
|
84
|
+
# Add traces
|
|
85
|
+
mod trace add <file>:<line> --type=<type> ["description"]
|
|
86
|
+
mod trace add <file>:<line> --type=<type> --link=<trace-id>
|
|
87
|
+
|
|
88
|
+
# Link traces
|
|
89
|
+
mod trace link <source-id> <target-id>
|
|
90
|
+
|
|
91
|
+
# View traces
|
|
92
|
+
mod trace list # All traces
|
|
93
|
+
mod trace list --type=requirement # Filter by type
|
|
94
|
+
mod trace list --file=<path> # Filter by file
|
|
95
|
+
mod trace get <trace-id> # Get trace details
|
|
96
|
+
|
|
97
|
+
# Reports
|
|
98
|
+
mod trace report <file> # Per-document coverage
|
|
99
|
+
mod trace coverage # Workspace-wide stats
|
|
100
|
+
|
|
101
|
+
# Find gaps
|
|
102
|
+
mod trace diff # Untraced files on branch
|
|
103
|
+
mod trace diff main..HEAD # Explicit git range
|
|
104
|
+
mod trace unmet # Requirements without implementations
|
|
82
105
|
```
|
|
83
106
|
|
|
84
|
-
###
|
|
107
|
+
### Comments
|
|
85
108
|
|
|
86
109
|
```bash
|
|
87
|
-
mod
|
|
88
|
-
mod
|
|
89
|
-
mod workspace switch <name> # Switch active workspace
|
|
90
|
-
mod workspace info # Show workspace details
|
|
110
|
+
mod comment add <file>:<line> "text"
|
|
111
|
+
mod comment list [file]
|
|
91
112
|
```
|
|
92
113
|
|
|
93
|
-
|
|
114
|
+
## Trace Types
|
|
115
|
+
|
|
116
|
+
| Type | Use For |
|
|
117
|
+
|------|---------|
|
|
118
|
+
| `requirement` | Specs, user stories, acceptance criteria |
|
|
119
|
+
| `specification` | Detailed technical specs |
|
|
120
|
+
| `implementation` | Code that builds something |
|
|
121
|
+
| `test` | Code that verifies something |
|
|
122
|
+
| `design` | Design docs, architecture notes |
|
|
123
|
+
| `decision` | ADRs, decision records |
|
|
124
|
+
| `utility` | Helpers that don't need tracing |
|
|
125
|
+
|
|
126
|
+
## CI Integration
|
|
127
|
+
|
|
128
|
+
Commands exit non-zero when issues exist:
|
|
94
129
|
|
|
95
130
|
```bash
|
|
96
|
-
|
|
97
|
-
mod
|
|
98
|
-
mod note set <file> <text> # Set note on file
|
|
99
|
-
mod note get <file> # Get note for file
|
|
100
|
-
mod trace add <file> <req-id> # Add trace linking file to requirement
|
|
101
|
-
mod trace list [file] # List traces (all or per file)
|
|
131
|
+
# Pre-merge validation
|
|
132
|
+
mod trace diff && mod trace unmet && git push
|
|
102
133
|
```
|
|
103
134
|
|
|
135
|
+
| Command | Exit 0 | Exit 1 |
|
|
136
|
+
|---------|--------|--------|
|
|
137
|
+
| `mod trace diff` | All changed files traced | Untraced files exist |
|
|
138
|
+
| `mod trace unmet` | All requirements implemented | Unmet requirements |
|
|
139
|
+
|
|
104
140
|
## Development
|
|
105
141
|
|
|
106
142
|
```bash
|
|
@@ -109,17 +145,3 @@ pnpm build # Build CLI
|
|
|
109
145
|
pnpm dev # Watch mode
|
|
110
146
|
pnpm test # Run tests
|
|
111
147
|
```
|
|
112
|
-
|
|
113
|
-
## Thoughts
|
|
114
|
-
|
|
115
|
-
**Daemon architecture**: The sync daemon runs as a background process rather than requiring an active terminal. This lets developers work normally while sync happens invisibly. The daemon writes logs to `~/.mod/logs/sync.log` for debugging.
|
|
116
|
-
|
|
117
|
-
**CRDT trade-offs**: Automerge handles conflicts automatically, but the resulting merges aren't always what users expect for text files. Currently optimizing for metadata sync; file content sync may need smarter merge strategies.
|
|
118
|
-
|
|
119
|
-
**Git integration**: In git repos, sync is branch-aware: git branch switches trigger Mod branch switches. Mod adds real-time collaboration and agent context on top of git. In non-git directories, Mod provides standalone change tracking and sync.
|
|
120
|
-
|
|
121
|
-
**Device-level storage**: All state lives in `~/.mod/` at the device root rather than per-repo. Sign in once, use across all repos. Single daemon can sync multiple connected directories. No per-repo config to gitignore.
|
|
122
|
-
|
|
123
|
-
**Metadata commands**: Specific commands for comments, notes, and traces rather than a generic `mod meta` interface. Agents benefit from semantic clarity. Each metadata type has different workflows: comments are threaded, notes are single per file, traces link to requirement IDs. Keeping them separate makes intent clear for both agents and humans.
|
|
124
|
-
|
|
125
|
-
**Offline handling**: The daemon queues changes when offline and syncs when reconnected. Local edits always work; sync catches up when possible. Conflict resolution happens through Automerge's CRDT properties.
|