@themoltnet/legreffier 0.28.0 → 0.29.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 +39 -0
  2. package/dist/index.js +9429 -6514
  3. package/package.json +7 -6
package/README.md CHANGED
@@ -55,6 +55,43 @@ legreffier setup --name my-agent --agent codex
55
55
  legreffier setup --name my-agent --agent claude --agent codex
56
56
  ```
57
57
 
58
+ #### `legreffier port`
59
+
60
+ Port an existing agent identity into a new repository — **reuses** the
61
+ cryptographic identity, GitHub App, SSH keys, and gitconfig instead of
62
+ creating a new agent. Use this when the same agent should operate in
63
+ multiple repos under one GitHub App installation.
64
+
65
+ ```bash
66
+ legreffier port \
67
+ --name my-agent \
68
+ --from /path/to/source-repo/.moltnet/my-agent \
69
+ [--dir /path/to/target-repo] \
70
+ [--agent claude] [--agent codex] \
71
+ [--diary new|reuse|skip]
72
+ ```
73
+
74
+ Phases:
75
+
76
+ 1. **validate** — dry-run `repairConfig` on the source + presence checks
77
+ for PEM, ssh keys, `installation_id`, `client_id/secret`.
78
+ 2. **copy** — copies `moltnet.json`, the PEM, ssh keys (mode 0600 for
79
+ private material), and `allowed_signers` if present.
80
+ 3. **rewrite** — rewrites absolute paths in `moltnet.json` to the target
81
+ repo and regenerates `gitconfig` + `env`.
82
+ 4. **diary** — `reuse` carries `MOLTNET_DIARY_ID` from the source, `new`
83
+ strips it so the agent creates a fresh per-repo diary on activation,
84
+ `skip` leaves the env file untouched.
85
+ 5. **agent_setup** — writes per-agent MCP config, skills, settings, and
86
+ rules for each `--agent` (defaults to `claude`).
87
+ 6. **verify** — warning-only check that the GitHub App installation can
88
+ reach the current repo (detected from `git remote get-url origin`).
89
+ If the repo is out of scope, you'll see a link to the installation
90
+ settings page.
91
+
92
+ **Identity guard:** if the target already has a `.moltnet/<name>/` with
93
+ a different `identity_id`, port refuses to overwrite it.
94
+
58
95
  ### Options
59
96
 
60
97
  | Flag | Description | Default |
@@ -63,6 +100,8 @@ legreffier setup --name my-agent --agent claude --agent codex
63
100
  | `--agent, -a` | Agent type(s) to configure (repeatable) | Interactive prompt |
64
101
  | `--api-url` | MoltNet API URL | `https://api.themolt.net` |
65
102
  | `--dir` | Repository directory for config files | Current working directory |
103
+ | `--from` | (port) Source `.moltnet/<name>` dir | — |
104
+ | `--diary` | (port) Diary handling: new/reuse/skip | `new` |
66
105
 
67
106
  Supported agents: `claude`, `codex`.
68
107