Skip to content

Commit 1edef0c

Browse files
committed
docs: make npm setup the primary install path
1 parent bd96abd commit 1edef0c

2 files changed

Lines changed: 111 additions & 9 deletions

File tree

README.md

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,37 @@ persistence invariants, and side-effect rules. See
1414

1515
## Install
1616

17-
GitContribute requires Go 1.26 or newer. A C toolchain is not required because
18-
the SQLite driver is pure Go.
17+
The recommended installation and onboarding command requires Node.js 18 or
18+
newer. It runs the native GitContribute binary bundled in the npm package; Go
19+
and a C toolchain are not required.
1920

2021
```sh
21-
go install github.com/morluto/gitcontribute/cmd/gitcontribute@latest
22+
npx gitcontribute@latest setup
23+
```
24+
25+
Install a persistent shell command instead:
26+
27+
```sh
28+
npm install --global gitcontribute@latest
29+
gitcontribute setup
2230
```
2331

24-
Or build a checkout:
32+
Projects that want to pin the CLI version can install it as a development
33+
dependency and invoke it through `npx` or package scripts:
2534

2635
```sh
36+
npm install --save-dev gitcontribute
37+
npx gitcontribute setup --codex --yes
38+
```
39+
40+
The npm package has no install lifecycle and does not download an executable at
41+
install time. It contains native binaries for macOS ARM64/x64, Linux
42+
ARM64/x64, and Windows x64.
43+
44+
Developers with Go 1.26 or newer can install from source or build a checkout:
45+
46+
```sh
47+
go install github.com/morluto/gitcontribute/cmd/gitcontribute@latest
2748
go build -o gitcontribute ./cmd/gitcontribute
2849
```
2950

@@ -35,18 +56,40 @@ You also need a `git` executable. Optional helpers that the CLI can use:
3556
## Quick start
3657

3758
```sh
38-
gitcontribute init
39-
gitcontribute configure --token-source=env --token-source-key=GITHUB_TOKEN
40-
gitcontribute sync owner/repo
41-
gitcontribute search threads "connection timeout" --repo owner/repo --json
42-
gitcontribute dossier build owner/repo --json
59+
npx gitcontribute@latest setup
60+
npx gitcontribute@latest sync owner/repo
61+
npx gitcontribute@latest search threads "connection timeout" --repo owner/repo --json
62+
npx gitcontribute@latest dossier build owner/repo --json
4363
```
4464

4565
Run `gitcontribute --help` and `gitcontribute <command> --help` for full flag
4666
reference.
4767

4868
## Initialization, configuration, and authentication
4969

70+
`gitcontribute setup` is the normal entry point. It initializes the local
71+
corpus, selects a GitHub authentication source, and registers the MCP server
72+
with Codex and/or Claude Code. It remains local-only: adding `--repo owner/repo`
73+
creates a discovery source but does not contact GitHub or start a sync.
74+
75+
```sh
76+
gitcontribute setup # interactive
77+
gitcontribute setup --codex --yes # configure Codex
78+
gitcontribute setup --all-clients --yes # configure every supported client
79+
gitcontribute setup --codex --mcp-version latest --yes
80+
gitcontribute setup --token-source env \
81+
--token-source-key GITHUB_TOKEN --yes
82+
gitcontribute setup --codex --dry-run --json # inspect without writing
83+
gitcontribute remove --all-clients --yes # remove only MCP registrations
84+
gitcontribute upgrade --check # compare with the latest npm release
85+
gitcontribute upgrade --yes # update a global npm installation
86+
```
87+
88+
When setup runs through `npx`, client configuration launches a released npm
89+
version rather than recording an ephemeral npm-cache path. `remove` never
90+
deletes the corpus or GitContribute application configuration. See
91+
[the onboarding design](docs/onboarding.md) for the complete contract.
92+
5093
`gitcontribute init` creates the default corpus database and directories if they
5194
do not exist. It does not fetch anything from GitHub.
5295

docs/onboarding.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Onboarding and npm distribution
2+
3+
The primary installation and onboarding entry point is:
4+
5+
```sh
6+
npx gitcontribute@latest setup
7+
```
8+
9+
GitContribute remains a native Go application. The `gitcontribute` npm package
10+
contains a small Node.js launcher and precompiled binaries for macOS ARM64/x64,
11+
Linux ARM64/x64, and Windows x64. Installation has no lifecycle script
12+
and performs no binary download. The launcher chooses the host binary at run
13+
time and forwards standard streams, arguments, signals, and its exit status.
14+
15+
## Setup contract
16+
17+
Setup is a local capability. It may create the GitContribute configuration and
18+
corpus, register the MCP server with selected coding clients, and add an
19+
explicit repository source. It does not synchronize a repository, access
20+
GitHub, execute repository-controlled code, or mutate GitHub.
21+
22+
The setup engine plans and applies only GitContribute-owned entries:
23+
24+
- `[mcp_servers.gitcontribute]` in Codex TOML configuration;
25+
- `mcpServers.gitcontribute` in Claude JSON configuration.
26+
27+
Unrelated configuration is preserved. Repeated setup is idempotent. `remove`
28+
deletes only those entries; it never removes the GitContribute corpus or its
29+
application configuration. `--dry-run` performs validation without writes,
30+
and `--json` exposes per-step results for automation.
31+
32+
When invoked through npm, setup records an npm launcher such as:
33+
34+
```text
35+
npx --yes --package=gitcontribute@0.1.0 -- gitcontribute mcp
36+
```
37+
38+
It never records a temporary executable from the npm cache. Development builds
39+
use `gitcontribute@latest`; released builds use their exact version so a client
40+
configuration is reproducible. Re-running setup with a newer release updates
41+
the registration. `--mcp-version latest` opts into following the latest npm
42+
release instead.
43+
44+
## Release contract
45+
46+
One tag version controls the Go binaries and npm package. Release automation:
47+
48+
1. cross-compiles all supported native binaries with `CGO_ENABLED=0`;
49+
2. injects the tag version into the Go executable;
50+
3. assembles one npm package containing every binary;
51+
4. verifies the package has no install lifecycle;
52+
5. installs the tarball with `--ignore-scripts` and runs a smoke test;
53+
6. enforces a 100 MB compressed-package ceiling;
54+
7. publishes the npm package with provenance;
55+
8. creates a matching GitHub release.
56+
57+
The npm environment must be configured for trusted publishing before the first
58+
release. Package publication is an external mutation and is performed only by
59+
the tag-triggered release workflow.

0 commit comments

Comments
 (0)