@allocator-one/harness-cli 1.0.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 allocator.one
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,108 @@
1
+ # @allocator-one/harness-cli
2
+
3
+ CLI and MCP server for [Harness](https://harness.infra.one), allocator.one's
4
+ issue tracker. A standalone Node client — no backend checkout, no Erlang
5
+ toolchain — that shares credentials with the Elixir escript (`bin/harness`
6
+ in the `allocator-one` repo).
7
+
8
+ ## Install
9
+
10
+ Zero-install, always current:
11
+
12
+ ```sh
13
+ npx -y @allocator-one/harness-cli list --team ALL
14
+ ```
15
+
16
+ Or globally:
17
+
18
+ ```sh
19
+ npm i -g @allocator-one/harness-cli
20
+ harness ready
21
+ ```
22
+
23
+ Requires Node >= 20.
24
+
25
+ ## Auth
26
+
27
+ No setup needed: commands target `https://harness.infra.one` and start the
28
+ browser login the first time. One login covers every shell, worktree, and
29
+ agent slot on a machine — credentials are stored at
30
+ `~/.config/harness/credentials.json` (0600), byte-compatible with the
31
+ escript's, so either client can log in or out without breaking the other.
32
+
33
+ - `harness login` — browser flow (PKCE loopback); `--no-browser` prints the
34
+ URL and prompts for a pasted token instead.
35
+ - `harness logout` — revokes the stored login server-side and deletes the file.
36
+ - `harness whoami` — shows the resolved host and credential source.
37
+
38
+ Headless contexts (agents, CI): mint an `aone_…` API token (admin → API
39
+ tokens) and set `HARNESS_API_TOKEN`. Do not set it in interactive sessions —
40
+ the browser login attributes writes to the real user.
41
+
42
+ ## Environment variables
43
+
44
+ | Variable | Effect |
45
+ | --- | --- |
46
+ | `HARNESS_API_URL` | Target host (default `https://harness.infra.one`). https only, plain http allowed against localhost. |
47
+ | `HARNESS_API_TOKEN` | Bearer token (`aone_…`); wins over the stored login. Never inherits the stored login's host. |
48
+ | `HARNESS_TEAM` | Default team key for commands that take `--team`. |
49
+ | `HARNESS_ACTOR` | Write attribution, sent only when explicitly set. |
50
+ | `HARNESS_CACHE_DIR` | Where `show` downloads attached images (default `$XDG_CACHE_HOME/harness/attachments` or `~/.cache/harness/attachments`). Absolute paths only. |
51
+
52
+ ## For agents
53
+
54
+ `harness mcp` runs a stdio MCP server exposing every operation as a typed
55
+ tool — issue_list, issue_show, issue_create, issue_update, issue_claim,
56
+ issue_close, issue_comment, relation_add/rm, link_list/add/rm,
57
+ project_list/show/create/update, milestone_list/create,
58
+ document_list/show/create/update, label_list/create, team_list,
59
+ workflow_states, user_list, stats, upload. Read-only tools carry
60
+ `readOnlyHint`. Results are compact JSON of the data envelope.
61
+
62
+ Register it with Claude Code:
63
+
64
+ ```sh
65
+ claude mcp add --scope user harness -- npx -y @allocator-one/harness-cli mcp
66
+ ```
67
+
68
+ Example tool call: `issue_list` with `{"ready": true, "team": "ALL"}`
69
+ returns the ready queue as JSON; `issue_claim` with `{"id": "IO-123"}`
70
+ claims atomically (a conflict means someone else holds it).
71
+
72
+ Auth resolution is identical to the CLI. Without a credential, tools return
73
+ an error telling the agent to run `harness login` in a terminal — the
74
+ server never opens a browser itself.
75
+
76
+ ## Development
77
+
78
+ ```sh
79
+ npm ci
80
+ npm run typecheck
81
+ npm test
82
+ npm run build # bundles to dist/cli.js (tsup)
83
+ node dist/cli.js version
84
+ ```
85
+
86
+ The OpenAPI spec is vendored at `spec/openapi.json` and TypeScript types are
87
+ generated into `src/generated/` (committed, so npx consumers never run
88
+ codegen):
89
+
90
+ ```sh
91
+ npm run spec:refresh # fetch the spec from a live host (uses your login)
92
+ npm run codegen # regenerate src/generated/api.ts from the vendored spec
93
+ ```
94
+
95
+ CI regenerates the types and fails on drift.
96
+
97
+ ## Release
98
+
99
+ Tag a version and push — the Release workflow builds and publishes to npm:
100
+
101
+ ```sh
102
+ git tag v1.0.0 && git push origin v1.0.0
103
+ ```
104
+
105
+ Publishing requires the `NPM_TOKEN` actions secret (an automation token for
106
+ the `allocator-one` npm org). Provenance attestation is disabled: npm only
107
+ accepts it from public source repositories, and this repo is private — turn
108
+ `--provenance` back on in `release.yml` if the repo ever goes public.