@difflab/difflab-cli 0.2.0 → 0.3.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 (3) hide show
  1. package/README.md +25 -0
  2. package/dist/index.js +30345 -9833
  3. package/package.json +5 -1
package/README.md CHANGED
@@ -8,6 +8,31 @@ A Bun command-line application with a local Difflab MCP server.
8
8
  bunx @difflab/difflab-cli
9
9
  ```
10
10
 
11
+ ## Local Projects
12
+
13
+ A Project can contain multiple GitHub repositories. Its key is the sole project identifier and directory name; there is no separate slug or UUID. All Projects and repositories share one user-wide SQLite database at `~/.difflab/difflab.sqlite`. The CLI keeps repository artifacts separately under `~/.difflab/projects/<PROJECT_KEY>/<github-owner>--<github-repo>/`. The database migrations run locally on write operations.
14
+
15
+ Create a Project, repeating `--repo` for each repository:
16
+
17
+ ```bash
18
+ difflab project add <PROJECT_KEY> --name 'My Project' --repo https://github.com/org/repo
19
+ ```
20
+
21
+ Then link a repository to the existing Project:
22
+
23
+ ```bash
24
+ cd /path/to/existing/github-repository
25
+ difflab init <PROJECT_KEY>
26
+ ```
27
+
28
+ The `project add` command requires a project key, name, and at least one repository. If any value is missing, it returns command guidance instead of prompting. `difflab init <PROJECT_KEY>` only links the current repository to an existing Project; it never creates one. The existing `difflab-cli` command is an alias for `difflab`.
29
+
30
+ Initialization requires a GitHub HTTPS or SSH origin and never creates a Git repository. It writes a tracked `difflab.yaml` containing only the Project key without staging it. The repo-root `.difflab` symlink points at the Project's per-repository artifact directory. Existing conflicting paths are never overwritten. Do not commit the symlink or SQLite files. A repository config copied to another machine needs explicit local setup; the read-only MCP tool will not import or repair it.
31
+
32
+ If initialization is interrupted, retry `difflab init <PROJECT_KEY>`; matching partial links and database rows can be reused, but conflicting paths require manual inspection. Do not delete the shared database to repair a repository link.
33
+
34
+ The `project_context({ cwd })` MCP tool inspects initialized repositories without creating files or applying migrations. If it reports missing or inconsistent setup, load the portable `skills/difflab-init/SKILL.md` in your client's Agent Skills directory and follow its CLI steps. Existing `todo_*` MCP tools remain available.
35
+
11
36
  ## MCP setup
12
37
 
13
38
  After installing the CLI so `difflab-cli` is on your PATH, register it with the MCP clients you use: