git-a2a 1.0.1 → 1.1.0-rc.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/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "git-a2a",
3
- "version": "1.0.1",
3
+ "version": "1.1.0-rc.2",
4
4
  "description": "Import git modules together with their owning agents",
5
+ "mcpName": "io.github.neprel/git-a2a",
5
6
  "license": "MIT",
6
7
  "repository": {
7
8
  "type": "git",
@@ -13,12 +14,16 @@
13
14
  "engines": {
14
15
  "node": ">=18"
15
16
  },
17
+ "files": [
18
+ "bin/",
19
+ "skills/"
20
+ ],
16
21
  "optionalDependencies": {
17
- "@git-a2a/darwin-amd64": "1.0.1",
18
- "@git-a2a/darwin-arm64": "1.0.1",
19
- "@git-a2a/linux-amd64": "1.0.1",
20
- "@git-a2a/linux-arm64": "1.0.1",
21
- "@git-a2a/windows-amd64": "1.0.1",
22
- "@git-a2a/windows-arm64": "1.0.1"
22
+ "@git-a2a/darwin-amd64": "1.1.0-rc.2",
23
+ "@git-a2a/darwin-arm64": "1.1.0-rc.2",
24
+ "@git-a2a/linux-amd64": "1.1.0-rc.2",
25
+ "@git-a2a/linux-arm64": "1.1.0-rc.2",
26
+ "@git-a2a/windows-amd64": "1.1.0-rc.2",
27
+ "@git-a2a/windows-arm64": "1.1.0-rc.2"
23
28
  }
24
29
  }
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: git-a2a
3
+ description: Use git-a2a to consume or author a dependency on a Git repository together with its owner, resolve who owns a dependency, inspect or repair an AGENTS.md module roster, or edit and validate a2amodule.yml manifest.
4
+ compatibility: requires git ≥ 2.25 and the git-a2a CLI
5
+ metadata:
6
+ version: "1.1.0"
7
+ ---
8
+
9
+ # git-a2a
10
+
11
+ Use the repository's `a2amodule.yml` and `a2amodule.lock` as durable truth. Treat
12
+ `.git-a2a/cache` as disposable. Never read dependency internals: read its published surface and
13
+ contact its declared owner for anything else.
14
+
15
+ Start with `git-a2a usage`. Use `--json` on read commands when structured output is useful.
16
+
17
+ ## Consume a module
18
+
19
+ 1. Run `git-a2a doctor` and inspect the current `git-a2a status -v`.
20
+ 2. Add the owner's Git URL with `git-a2a add URL`; one resolved commit must drive every ecosystem.
21
+ 3. Run `git-a2a sync` to opt into the managed AGENTS.md roster.
22
+ 4. Inspect public knowledge with `git-a2a show ID --surface`.
23
+ 5. Before committing, run `git-a2a status`, the repository tests, and review the manifest, lock,
24
+ package-manager files, and AGENTS.md together.
25
+
26
+ After a fresh clone, run `git-a2a fetch` to reconstruct cache from the lock. Do not use `update`
27
+ just to prime cache, and never commit `.git-a2a/`.
28
+
29
+ Read [the CLI reference](references/cli.md) when choosing flags for add, set, pin, unpin, wire,
30
+ update, remove, fetch, show, or sync.
31
+
32
+ ## Author a module
33
+
34
+ 1. Run `git-a2a init --id ID --yes`.
35
+ 2. Describe module identity, native exports, the deliberately public surface, agents, contacts,
36
+ routing policy, consumer boundary, and release channel.
37
+ 3. Validate with `git-a2a validate` and canonicalize with `git-a2a fmt --check`.
38
+ 4. Export cards with `git-a2a card export AGENT` and the catalog with
39
+ `git-a2a catalog export` when publishing discovery metadata.
40
+
41
+ Read [the authoring guide](references/authoring.md) for the workflow and
42
+ [the manifest field reference](references/manifest-reference.md) for exact values and
43
+ consequences. Do not guess an open-vocabulary token's behavior.
44
+
45
+ ## Check health or change a dependency
46
+
47
+ - `git-a2a fetch`: restore cache at locked commits without changing durable state.
48
+ - `git-a2a status --offline`: verify cache, wiring, cards/trust, and roster without network.
49
+ - `git-a2a update --check`: report upstream movement; exit 1 means an update exists.
50
+ - `git-a2a update`: move the lock and every supported ecosystem together.
51
+ - `git-a2a set ID --ref REF`: deliberately change source/ref policy.
52
+ - `git-a2a pin ID` / `git-a2a unpin ID --ref REF`: freeze or resume tracking.
53
+ - `git-a2a wire ID`: repair native dependency entries from manifest and lock.
54
+
55
+ Do not hand-edit a managed AGENTS.md block. Run `git-a2a sync`, or let a successful dependency
56
+ mutation refresh an existing block.
57
+
58
+ ## Contact an owner
59
+
60
+ 1. Resolve the declared route with `git-a2a who ID --intent INTENT [--path FILE]`.
61
+ 2. Read the owner's contact note and consumer policy.
62
+ 3. With authorization for the external side effect, put a concise request in a file and run
63
+ `git-a2a contact ID --intent INTENT --message FILE`.
64
+
65
+ `contact` may create an A2A task or GitHub Issue. URL, email, and chat kinds print instructions;
66
+ do not invent delivery or store conversation state.
67
+
68
+ ## Outcomes
69
+
70
+ - Exit 0: action completed or check is clean.
71
+ - Exit 1: drift/failure was found or an operational action failed.
72
+ - Exit 2: invalid input, absent subject, unknown identity, or nothing resolved.
73
+
74
+ If a command fails, preserve the user's files and report its decisive stderr line. Mutating
75
+ commands are transactional; do not manually complete a partial-looking operation without first
76
+ checking `git diff`, `git-a2a validate`, and `git-a2a status -v`.
@@ -0,0 +1,154 @@
1
+ # Authoring an a2amodule
2
+
3
+ This guide is for the owner of a repository that other agents or projects should consume. The
4
+ [field reference](manifest-reference.md) is the exact lookup for types and defaults; this page is
5
+ the sequence for making a useful contract. The public
6
+ [`acme-lib-utils`](https://github.com/neprel/git-a2a-demo-acme-lib) repository is the worked
7
+ example throughout.
8
+
9
+ ## 1. Start at the repository boundary
10
+
11
+ Run `init` in the repository root, or in the module directory inside a monorepo:
12
+
13
+ ```sh
14
+ git-a2a init --id acme-lib-utils \
15
+ --description "Shared formatting utilities. Ask about the cross-language contract." \
16
+ --surface surface/
17
+ ```
18
+
19
+ `module.id` is the stable consumer identity and lock key. Keep it short, lowercase, and stable;
20
+ renaming it breaks references. Add `module.repository` as the owner-declared canonical Git URL.
21
+ It is provenance, not an implicit fetch redirect. If the module later moves, leave
22
+ `module.moved-to` at the old source so `update` can report the destination without silently
23
+ following it.
24
+
25
+ Declare `module.release.channel` when consumers should follow a branch such as `main`; otherwise
26
+ an add with no ref follows the remote default branch. Set `release.tags: true` only when the
27
+ repository really publishes semantic-version tags. The declaration does not create releases.
28
+
29
+ ## 2. Declare every importable export
30
+
31
+ An export says how the same Git revision appears to a native ecosystem. Its `name` is the value
32
+ that ecosystem imports, not necessarily the repository or module id.
33
+
34
+ | Ecosystem | `name` means | Typical native file |
35
+ | --- | --- | --- |
36
+ | `npm` | package name, including scope | `package.json` |
37
+ | `pypi` | PEP 503 distribution name | `pyproject.toml` |
38
+ | `golang` | Go module import path | `go.mod` |
39
+ | `cargo` | crate name | `Cargo.toml` |
40
+ | `swift` | SwiftPM package identity | `Package.swift` |
41
+ | `pub` | Dart package name | `pubspec.yaml` |
42
+ | `gem` | gem name | `Gemfile` |
43
+ | `composer` | Composer `vendor/package` | `composer.json` |
44
+ | `hex` | Hex package name | `mix.exs` |
45
+ | `hackage` | Cabal package name | `*.cabal` or `stack.yaml` |
46
+ | `zig` | dependency name | `build.zig.zon` |
47
+ | `clojure` | deps.edn symbol | `deps.edn` |
48
+ | `nix` | flake input name | `flake.nix` |
49
+
50
+ Use `path` when that package lives below the module directory. An ecosystem that cannot express
51
+ the Git URL, ref mode, or subdirectory is reported as `not wired`; never claim an import that the
52
+ native tool cannot reproduce. The demo library declares npm, PyPI, and Go exports for one API:
53
+
54
+ ```yaml
55
+ exports:
56
+ - { ecosystem: npm, name: "@acme/lib-utils" }
57
+ - { ecosystem: pypi, name: acme-lib-utils }
58
+ - { ecosystem: golang, name: github.com/neprel/git-a2a-demo-acme-lib }
59
+ ```
60
+
61
+ ## 3. Publish a surface, not the implementation
62
+
63
+ `module.surface` is the directory consumers may read in addition to the manifest. Put stable API
64
+ signatures, behavior, limits, compatibility notes, and small usage examples there. Do not publish
65
+ internal plans, private prompts, credentials, memories, or implementation instructions.
66
+
67
+ The boundary is ask-not-read: if an answer is not in the surface, the consumer contacts an owner.
68
+ The demo's `surface/API.md` states the shared function contract and `surface/NOTES.md` states
69
+ cross-language facts. `git-a2a show acme-lib-utils --surface` materializes that declared content
70
+ without granting access to the rest of the dependency repository.
71
+
72
+ ## 4. Bind agents and cards
73
+
74
+ Each agent binding needs a stable `name` and a `role`; `scope` defaults to `**`. A more specific
75
+ matching scope wins before manifest order. Core roles are `owner`, `maintainer`, `spec`,
76
+ `reviewer`, and `support`, but roles remain an open vocabulary.
77
+
78
+ `card` may be a live A2A v1.0 URL or a repository-relative static JSON file. The card is the
79
+ agent's self-description; do not copy its skills, interfaces, or security into the manifest.
80
+ Use binding `description` only for repository-specific context or when no card exists. A static
81
+ card may demonstrate discovery without running an agent service, but its description must say so.
82
+
83
+ With `trust.signatures: true`, the card must carry a valid detached JWS over its RFC 8785
84
+ canonical form. `status` fails for unsigned or invalid cards; `update` retains code changes and
85
+ prints a trust warning. Use `git-a2a card verify FILE_OR_URL` before enabling the requirement.
86
+
87
+ ## 5. Add contacts by intent
88
+
89
+ Contacts are ordered. Every contact declares one or more request `intents` and a `kind`. Core
90
+ intents are `question`, `change`, `bug`, `review`, and `incident`; both intents and kinds remain
91
+ open vocabularies. `"*"` is the fallback for an otherwise unmatched intent.
92
+
93
+ ```yaml
94
+ agents:
95
+ - name: acme-pm
96
+ role: spec
97
+ scope: [surface/**, a2amodule.yml]
98
+ card: https://git-a2a.com/demo/agents/acme-pm/.well-known/agent-card.json
99
+ contacts:
100
+ - intents: [change]
101
+ kind: github-issue
102
+ repo: neprel/git-a2a-demo-acme-lib
103
+ labels: [change-request, from-agent]
104
+ note: Describe the consumer, the need, and the affected languages.
105
+ ```
106
+
107
+ `a2a` and `github-issue` have delivery drivers. `url`, `email`, and chat kinds print an exact
108
+ instruction; they do not pretend delivery occurred. The kind-specific keys and delivery behavior
109
+ are listed in the [field reference](manifest-reference.md).
110
+
111
+ ## 6. State routing and the consumer boundary
112
+
113
+ `policy.intents` maps an intent to a role. Unlisted intents route to `owner`. In the demo,
114
+ `change: spec` sends contract requests to `acme-pm`, while bugs stay with the owner.
115
+
116
+ `policy.consumers.may` and `may-not` are open-vocabulary declarations rendered into the managed
117
+ AGENTS.md roster. They tell an agent what the owner permits; git-a2a is not an authorization
118
+ service. A useful library boundary is:
119
+
120
+ ```yaml
121
+ policy:
122
+ intents: { change: spec }
123
+ consumers:
124
+ may: [read-surface, ask, open-issue, propose-change]
125
+ may-not: [commit, edit-spec, release]
126
+ ```
127
+
128
+ ## 7. Validate and publish projections
129
+
130
+ Before committing, run:
131
+
132
+ ```sh
133
+ git-a2a fmt a2amodule.yml
134
+ git-a2a validate a2amodule.yml
135
+ git-a2a card export acme-lib-utils --out acme-lib-utils.agent-card.json
136
+ git-a2a card validate acme-lib-utils.agent-card.json
137
+ git-a2a catalog export --out ai-catalog.json
138
+ git-a2a status -v
139
+ ```
140
+
141
+ Review the formatted manifest and generated projections, then commit the manifest, surface, and
142
+ any intentionally static cards/catalog. Do not commit `.git-a2a/`; it is disposable local cache.
143
+ The owner publishes the Git ref and any card URLs through its normal release and hosting process.
144
+
145
+ ## 8. What the consumer receives
146
+
147
+ A consumer runs `git-a2a add URL` and gets one resolved commit in `a2amodule.lock`, native package
148
+ entries for every applicable export, card snapshots in ignored local state, and the published
149
+ surface on demand. `git-a2a sync` writes a bounded roster into AGENTS.md containing the module
150
+ description, consumer policy, routed owners, and declared contacts. It never imports dependency
151
+ instructions or code.
152
+
153
+ Clone the [public consumer](https://github.com/neprel/git-a2a-demo-acme-app), then run `status`,
154
+ `who`, `show --surface`, and `update --check` to see the authored contract from the other side.
@@ -0,0 +1,403 @@
1
+ # git-a2a command reference
2
+
3
+ Every command accepts the global `--timeout DURATION` option (default `120s`) and `--yes` as a
4
+ non-interactive no-op for automation. No command prompts for input. Requested data is written to
5
+ stdout; verdicts and advisories go to stderr. Exit `0` means success, `1` means a
6
+ completed check found drift/failure, and `2` means invalid input or nothing resolved.
7
+ The repository's `.hint` sources and the commands used to read them are explained in
8
+ [Specification as source (HINT)](../README.md#specification-as-source-hint).
9
+
10
+ ## init
11
+
12
+ `git-a2a init [--id ID] [--description TEXT] [--surface DIR] [--export ECOSYSTEM=NAME]
13
+ [--example lib|app] [--yes]`
14
+ creates `a2amodule.yml` and adds `.git-a2a/` to `.gitignore`. Repeat `--export`; `--yes` is an
15
+ accepted no-op for automation. `--example lib|app` writes a complete, commented owner or
16
+ consumer manifest; it may be combined with `--id`, but not the other content flags. Exit `1` if
17
+ a manifest already exists; invalid combinations exit `2`.
18
+
19
+ ```text
20
+ $ git-a2a init --id acme-app --yes
21
+ initialized module acme-app
22
+ ```
23
+
24
+ ```text
25
+ $ git-a2a init --example lib --id acme-lib
26
+ initialized lib example module acme-lib
27
+ ```
28
+
29
+ ## validate
30
+
31
+ `git-a2a validate [FILE ...] [--json]` validates manifests and locks; without paths it checks the
32
+ files in the current module. `--json` emits one structured result per requested file, including
33
+ validation errors. Invalid files exit `1`; an empty subject set exits `2`.
34
+
35
+ ```text
36
+ $ git-a2a validate
37
+ a2amodule.yml: valid
38
+ 1 file(s): valid
39
+ ```
40
+
41
+ ## add
42
+
43
+ `git-a2a add URL [--id ID] [--path DIR] [--track locked|floating] [--wire LIST|--no-wire]
44
+ [--no-refresh]`
45
+ fetches the remote manifest, resolves one commit, wires detected ecosystems, writes the lock,
46
+ and snapshots cards. `--no-refresh` edits project manifests but skips package-manager Refresh.
47
+ Missing optional toolchains warn but do not prevent the manifest edit.
48
+ Exit `1` covers fetch/wiring failure and `2` invalid arguments.
49
+
50
+ ```text
51
+ $ git-a2a add https://github.com/acme/lib.git --wire npm,golang
52
+ added acme-lib at ea1e8656ad1e6eaeef81759c10969e64defdd9ce
53
+ ```
54
+
55
+ ## set
56
+
57
+ `git-a2a set ID [--git URL] [--ref REF] [--path DIR] [--track locked|floating] [--id NEW-ID]
58
+ [--dry-run] [--no-refresh]` transactionally changes a dependency source or identity and rewires
59
+ it. `--no-refresh` skips package-manager Refresh. Exit `1`
60
+ means the transaction failed and rolled back; exit `2` means the ID/options did not resolve.
61
+
62
+ ```text
63
+ $ git-a2a set acme-lib --ref release/1.x --dry-run
64
+ would set acme-lib to ref release/1.x
65
+ ```
66
+
67
+ ## pin
68
+
69
+ `git-a2a pin ID [COMMIT] [--no-refresh]` changes the dependency ref to a full 40-character
70
+ commit. Without `COMMIT`, the currently locked commit is used. `--no-refresh` skips
71
+ package-manager Refresh. Exit `1` means lock/rewiring failure; exit `2`
72
+ means an unknown ID or invalid SHA.
73
+
74
+ ```text
75
+ $ git-a2a pin acme-lib
76
+ set acme-lib to https://github.com/acme/lib.git at ea1e8656ad1e6eaeef81759c10969e64defdd9ce
77
+ ```
78
+
79
+ ## unpin
80
+
81
+ `git-a2a unpin ID --ref REF [--track locked|floating] [--no-refresh]` returns a pinned dependency
82
+ to a branch or tag and resolves it immediately. `--no-refresh` skips package-manager Refresh.
83
+ Exit `1` means the transaction failed; exit `2` means the arguments or dependency were invalid.
84
+
85
+ ```text
86
+ $ git-a2a unpin acme-lib --ref main
87
+ set acme-lib to https://github.com/acme/lib.git at ea1e8656ad1e6eaeef81759c10969e64defdd9ce
88
+ ```
89
+
90
+ ## wire
91
+
92
+ `git-a2a wire [ID] [--ecosystem NAME] [--no-refresh]` reapplies declared exports to detected
93
+ project files. With `--ecosystem`, that adapter is mandatory; `--no-refresh` skips its
94
+ package-manager Refresh. Invalid/missing subjects exit `2`; a required adapter failure exits `1`.
95
+
96
+ ```text
97
+ $ git-a2a wire acme-lib --ecosystem npm
98
+ npm: wired acme-lib
99
+ ```
100
+
101
+ ## update
102
+
103
+ `git-a2a update [ID ...] [--check] [--review|--no-review] [--follow-moves] [--no-refresh]`
104
+ resolves upstream refs and transactionally updates changed dependencies. `--check` only reports
105
+ availability; `--review` prints manifest/surface diffs; `--no-refresh` skips package-manager
106
+ Refresh; moves require explicit `--follow-moves`. Exit `1`
107
+ means updates exist in check mode or an update failed; exit `2` means no dependency resolved.
108
+
109
+ ```text
110
+ $ git-a2a update --check
111
+ acme-lib: ea1e8656ad1e -> 3ad806dc575c
112
+ 1 dependency update(s) available
113
+ ```
114
+
115
+ ## remove
116
+
117
+ `git-a2a remove ID [--keep-wiring]` removes the manifest/lock/cache entry and normally unwires
118
+ all owned package-manager entries. Exit `1` means removal failed; exit `2` means the ID/options
119
+ did not resolve.
120
+
121
+ After any successful `add`, `update`, `set`, `pin`, `unpin`, `wire`, or `remove`, an existing
122
+ `AGENTS.md` managed block is rendered again as the final mutation. These commands never create a
123
+ new block; use `sync` once to opt in.
124
+
125
+ ```text
126
+ $ git-a2a remove acme-lib
127
+ removed acme-lib (cache deleted; it can be recreated by add)
128
+ ```
129
+
130
+ ## fetch
131
+
132
+ `git-a2a fetch [ID ...] [--surface] [--json]` restores disposable
133
+ `.git-a2a/cache` content from the exact commits and hashes in `a2amodule.lock`. Without IDs it
134
+ fetches every dependency; `--surface` also restores a declared surface whose tree hash is already
135
+ recorded in the lock. It never resolves a moving ref and never changes the manifest, lock, or
136
+ package-manager files. Missing/incomplete lock entries and hash mismatches exit `1`; invalid
137
+ options or an empty dependency set exit `2`.
138
+
139
+ ```text
140
+ $ git-a2a fetch --json
141
+ [{"id":"acme-lib","commit":"ea1e8656ad1e6eaeef81759c10969e64defdd9ce","manifest":"sha256:…","method":"sparse"}]
142
+ ```
143
+
144
+ ## show
145
+
146
+ `git-a2a show [ID] [--json] [--surface]` prints the own or cached dependency manifest. With
147
+ `--surface`, it materialises and lists the published surface before showing it. Exit `2` means
148
+ the module or surface was not resolvable.
149
+
150
+ ```text
151
+ $ git-a2a show acme-lib --surface
152
+ surface/API.md
153
+ schema: 1
154
+ ```
155
+
156
+ ## sync
157
+
158
+ `git-a2a sync [--check] [--brief] [--target FILE]` renders the dependency/owner roster into
159
+ `AGENTS.md` and repeated targets. `--check` exits `1` without writing when blocks are stale.
160
+
161
+ ```text
162
+ $ git-a2a sync
163
+ AGENTS.md
164
+ updated 1 managed block(s)
165
+ ```
166
+
167
+ ## who
168
+
169
+ `git-a2a who [ID] [--intent INTENT] [--path FILE] [--json]` applies intent → role → scoped
170
+ agent → contact routing. No match exits `2`.
171
+
172
+ ```text
173
+ $ git-a2a who acme-lib --intent change
174
+ acme-lib change → owner → library-owner
175
+ ```
176
+
177
+ ## contact
178
+
179
+ `git-a2a contact ID --intent INTENT --message FILE|- [--wait]` uses the first supported routed
180
+ contact. A2A sends `SendMessage`; GitHub Issue uses `gh` then REST; URL/email/chat contacts print
181
+ instructions. Each delivery writes one record and stores no conversation state. `ask` is an
182
+ alias. Exit `1` means delivery failed; exit `2` means routing/input resolved nothing.
183
+
184
+ ```text
185
+ $ printf 'Please review the API.' | git-a2a contact acme-lib --intent review --message -
186
+ acme-lib owner github-issue issue=https://github.com/acme/lib/issues/42
187
+ ```
188
+
189
+ ## status
190
+
191
+ `git-a2a status [ID ...] [--offline] [--json] [-v]` checks upstream, manifest/cache hashes,
192
+ wiring, cards/trust, and rendered blocks. The table contains dependencies only; the consuming
193
+ module is summarized below it. A repository that has not run `sync` has roster/SYNC `none`, which
194
+ is healthy; `stale` means an existing managed block differs. `-v` adds own-module findings,
195
+ prerequisite state, and adapter verification labels. Any unhealthy dependency or own-module
196
+ check exits `1`; no match exits `2`.
197
+
198
+ ```text
199
+ $ git-a2a status --offline
200
+ acme-lib canonical branch main unknown clean npm clean unknown none
201
+ consumer-app: manifest valid · agents none · roster none
202
+ 1 dependency: clean
203
+ ```
204
+
205
+ ## card
206
+
207
+ `git-a2a card <export|validate|verify|show> [options]` manages native A2A cards:
208
+ `card export AGENT [--out FILE]`, `card validate FILE|URL`, `card verify FILE|URL`, and
209
+ `card show [ID] [AGENT] [--json]`. Unresolvable input exits `2`; invalid content/signature exits
210
+ `1`.
211
+
212
+ ```text
213
+ $ git-a2a card verify ./owner-card.json
214
+ ./owner-card.json: verified EdDSA signature with key production
215
+ card signature verified
216
+ ```
217
+
218
+ ## catalog
219
+
220
+ `git-a2a catalog export [--out FILE]` emits an ARD 1.0 `ai-catalog.json` whose entries reference
221
+ or embed the module's A2A cards. Exit `1` means encoding/writing failed; exit `2` means no valid
222
+ module or agents resolved.
223
+
224
+ ```text
225
+ $ git-a2a catalog export --out ai-catalog.json
226
+ exported 2 A2A catalog entrie(s)
227
+ ```
228
+
229
+ ## agent
230
+
231
+ `git-a2a agent add NAME --role ROLE [--scope GLOB]... [--card URL] [--contact FIELDS]...
232
+ [--yes]` adds an agent binding. Each contact is comma-separated `key=value`; list values such as
233
+ `intents` and `labels` use `|`, for example
234
+ `intents=question|change,kind=github-issue,repo=acme/lib,labels=from-agent|change-request`.
235
+ `git-a2a agent remove NAME [--yes]` removes it. `git-a2a agent list [--json] [--yes]` returns
236
+ agents in stable name order. Mutations preserve comments, key order, extension keys, and
237
+ flow/block style of untouched YAML nodes, validate, write atomically, then update an existing
238
+ AGENTS.md managed block. Invalid fields exit `2`; validation/write failures and
239
+ duplicates exit `1`; an unknown removal or empty list exits `2`.
240
+
241
+ ```text
242
+ $ git-a2a agent add acme-lib-owner --role owner --scope '**' --contact 'intents=question|change,kind=github-issue,repo=acme/lib'
243
+ added agent acme-lib-owner
244
+ $ git-a2a agent list
245
+ acme-lib-owner owner ** 1 contact(s)
246
+ 1 agent(s)
247
+ ```
248
+
249
+ ## export
250
+
251
+ `git-a2a export add ECOSYSTEM NAME [--path PATH] [--yes]` adds a native export to the current
252
+ module. The result is validated and written atomically; relative path and duplicate violations
253
+ exit `1`, while invalid arguments exit `2`.
254
+
255
+ ```text
256
+ $ git-a2a export add npm @acme/lib --path packages/js
257
+ added npm export @acme/lib
258
+ ```
259
+
260
+ ## policy
261
+
262
+ `git-a2a policy set [INTENT=ROLE ...] [--may LIST] [--may-not LIST] [--notes TEXT] [--yes]`
263
+ creates or updates intent routing and, when supplied, replaces the comma-separated consumer
264
+ permission lists or policy notes. Omitted fields and every unrelated YAML node remain untouched.
265
+ Invalid mappings exit `2`; validation/write failures exit `1`.
266
+
267
+ ```text
268
+ $ git-a2a policy set question=owner change=spec --may read-surface,ask --may-not commit
269
+ updated policy (2 intent mapping(s))
270
+ ```
271
+
272
+ ## explain
273
+
274
+ `git-a2a explain PATH [--json] [--yes]` prints the generated reference entry embedded in this
275
+ binary. Array markers may be omitted, so `agents.contacts.kind` resolves to
276
+ `agents[].contacts[].kind`. It performs no repository or network access. Unknown paths and
277
+ invalid arguments exit `2`.
278
+
279
+ ```text
280
+ $ git-a2a explain module.id
281
+ ```
282
+
283
+ ```markdown
284
+ ## `module.id`
285
+ - Type: string; required.
286
+
287
+ ```
288
+
289
+ ## fmt
290
+
291
+ `git-a2a fmt [--check] [PATH...]` canonicalises manifest/lock files or every matching file under
292
+ a supplied directory. `--check` exits `1` without writing when formatting differs.
293
+
294
+ ```text
295
+ $ git-a2a fmt spec/examples
296
+ formatted 3 file(s)
297
+ ```
298
+
299
+ ## doctor
300
+
301
+ `git-a2a doctor [--json]` reports Git and every toolchain required by detected ecosystems and
302
+ wired dependencies, including version, PATH status, and platform installation hints. It never
303
+ installs anything. Missing required Refresh tools exit `1`.
304
+
305
+ ```text
306
+ $ git-a2a doctor
307
+ git 2.51.0 found
308
+ npm 11.5.2 found
309
+ 2 prerequisite(s): ready
310
+ ```
311
+
312
+ ## usage
313
+
314
+ `git-a2a usage [--prompt] [--json]` prints a deterministic briefing for coding agents. The
315
+ default is at most 60 lines and contains eight task commands with examples, exit-code meanings,
316
+ structured-output guidance, and the manifest-reference location. `--prompt` adds the full
317
+ fresh-agent workflow; `--json` emits the selected briefing as an ordered line array. Invalid
318
+ options exit `2`.
319
+
320
+ ```text
321
+ $ git-a2a usage
322
+ git-a2a imports Git modules together with the agents that own them.
323
+ Read a2amodule.yml for the module contract and a2amodule.lock for exact resolved commits.
324
+
325
+ Exit 0: request completed or check clean.
326
+ ```
327
+
328
+ ## setup
329
+
330
+ `git-a2a setup [--check|--dry-run] [--harness LIST|--all]` detects Claude Code, Codex, Cursor,
331
+ GitHub Copilot, Gemini CLI, OpenCode, Hermes Agent, and OpenClaw from repository markers. It
332
+ always installs a thin skill (`SKILL.md` plus `references/README.md`) under
333
+ `.agents/skills/git-a2a/`, also installs that thin copy under `.claude/skills/git-a2a/` when
334
+ Claude Code is selected, and adds a bounded pointer block to `AGENTS.md`. For selected harnesses it writes only
335
+ the project-scoped `git-a2a` MCP entry in `.mcp.json`, `.codex/config.toml`,
336
+ `.cursor/mcp.json`, `.vscode/mcp.json`, `.gemini/settings.json`, or `opencode.json`, preserving
337
+ unrelated configuration. It never installs or upgrades the `git-a2a` executable.
338
+ Hermes Agent and OpenClaw only expose user-scoped MCP registries, so setup does not edit their
339
+ home-directory files; it prints the exact `hermes mcp add` or `openclaw mcp set` command for the
340
+ operator to run explicitly.
341
+
342
+ A harness found only under the user's home directory is reported but not configured. Use
343
+ `--harness codex,cursor` to select named harnesses even without repository markers, or `--all`
344
+ to configure every supported repository integration. The full skill remains in the source/npm/site
345
+ distribution; installed pointers use `git-a2a explain`, `git-a2a usage --prompt`, and the public URL.
346
+
347
+ `--dry-run` prints the files that would change and exits `0`; `--check` writes nothing and exits
348
+ `1` if any installed file or entry is missing/stale. An invalid existing config exits `1`; bad
349
+ options exit `2`.
350
+
351
+ ```text
352
+ $ git-a2a setup --dry-run
353
+ would write .agents/skills/git-a2a/SKILL.md (cross-agent skill)
354
+ would write AGENTS.md (skill pointer)
355
+ setup: dry run; 5 file(s) would change
356
+ ```
357
+
358
+ ## mcp
359
+
360
+ `git-a2a mcp [--allow-write]` runs a stateless MCP server over stdio. By default it exposes
361
+ seven read-only tools (`who`, `show`, `status`, `validate`, `doctor`, `explain`, `usage`) plus
362
+ the cache-restoring `fetch` tool, and
363
+ four repository resources (`a2amodule://manifest`, `a2amodule://lock`,
364
+ `a2amodule://roster`, `a2amodule://reference`). `--allow-write` additionally exposes `add`,
365
+ `update`, `set`, `wire`, `sync`, and `contact`; `remove` remains CLI-only. The process opens no
366
+ network listener and stores no server state. Protocol or command failures exit `1`; invalid
367
+ options exit `2`.
368
+
369
+ Repository-dependent tools accept an optional `root` path, defaulting to the server startup
370
+ directory. One MCP client can use that field to work across repositories, or launch one stdio
371
+ server per repository; instances have no listener or shared mutable server state. Fixed resources
372
+ refer to the startup repository. `root` may name any path reachable by the process. With
373
+ `--allow-write`, that grants mutation at any such path: the harness/host is the trust boundary.
374
+ A future `--roots` allow-list is deliberately deferred.
375
+
376
+ Run `git-a2a setup` to write project-scoped configuration for detected harnesses, including
377
+ Claude Code's `.mcp.json`, or copy an exact configuration from the [MCP guide](mcp.md).
378
+
379
+ ```text
380
+ $ git-a2a mcp
381
+ ```
382
+
383
+ ## version
384
+
385
+ `git-a2a version [--check]` prints version, commit, target, and install channel. `--check` alone
386
+ uses the network and exits `1` when an update is available. If only prereleases exist, it reports
387
+ that no stable release is published and exits `0`; prereleases never become `latest`.
388
+
389
+ ```text
390
+ $ git-a2a version
391
+ git-a2a 1.0.0 (2a46f1368876, darwin/arm64, channel=binary)
392
+ ```
393
+
394
+ ## upgrade
395
+
396
+ `git-a2a upgrade [--to VERSION]` downloads, checksum-verifies, and atomically replaces only a
397
+ standalone binary-channel installation. Managed channels exit `1` with their native update
398
+ command.
399
+
400
+ ```text
401
+ $ git-a2a upgrade --to 1.0.1
402
+ upgraded git-a2a 1.0.0 -> 1.0.1
403
+ ```