Document CLI API access and current work state

6c94ff48cc83 · AtlantisPleb · · parent bd6c808eb5a9

Document CLI API access and current work state

Deploy story

What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.

Not deployed through the forge lane

No push, promotion, build, or deploy receipt references this commit (receipts are scanned over a bounded recent window). Changes shipped by full node replacement carry their proof in the release gate receipt instead.

Changed files

  • modified docs/2026-08-21-cli-api-parity-audit.md
  • modified docs/2026-08-21-issue-project-triage-runbook.md
  • modified docs/2026-08-21-issues-projects-work-system-assessment.md
  • modified docs/github-api-issues-projects-assessment.md
  • added docs/openagents-cli/api.md
  • modified docs/openagents-cli/command-reference.md
  • modified docs/openagents-cli/import-github.md
  • modified docs/openagents-cli/index.md
  • modified docs/openagents-cli/install.md
  • modified lib/openagents_web/docs_catalog.ex
  • added priv/docs/cli-api.md
  • modified priv/docs/cli-command-reference.md
  • modified priv/docs/import-github.md
  • modified priv/docs/install-cli.md
  • modified priv/docs/issues.md
  • modified priv/docs/openagents-cli.md
  • modified priv/docs/projects.md
  • modified priv/docs/rest-api.md

Diff

18 files changed, +720 -112

docs/2026-08-21-cli-api-parity-audit.md modified +40 -10

@@ -2,7 +2,11 @@

2 2
3 3
**Date:** 2026-08-21
4 4
**Commits measured:** `81e4c25eb5b5` (`openagents/main`, the forge) for the API; `5bd0061e4f6e` in the `openagents` monorepo for `packages/openagents-cli` (package version `0.1.7`)
5
**Status:** Stages 1, 2, and 7 shipped. Stage 1 added `openagents api` in `@openagentsinc/cli@0.2.1`. Stages 2 and 7 added optional-bearer issue reads and repository-scoped Projects V2 routes on 2026-08-22. Historical measurements below retain the original findings.
5
**Status:** Stage 1 and Stage 7 shipped. The issue portion of Stage 2 shipped;
6
ancillary comment, label, assignee, and milestone reads remain public-only.
7
Stage 1 added `openagents api` in `@openagentsinc/cli@0.2.1`. Stage 7 added
8
repository-scoped Projects V2 routes on 2026-08-22. Historical measurements
9
below retain the original findings.
6 10
**Question:** Does the CLI only cover repository upload? What of the Issues and Projects API does it reach? Should that coverage be generated from an OpenAPI document instead of hand-written? What is the fastest honest path to managing issues and projects from a terminal?
7 11
**Method:** direct reading of `lib/openagents_web/router.ex`, every controller it routes to under `/api/v3`, the contexts behind them (`lib/openagents/issues.ex`, `labels.ex`, `milestones.ex`, `projects.ex`, `repositories.ex`), the auth plugs, `lib/openagents_web/route_authority.ex`, `priv/api-contracts/repositories-v1.json` and its controller and test, and `docs/openagents-cli/`; plus direct reading of all 21 source files in the `openagents` monorepo at `packages/openagents-cli/src/` and its tests. The CLI lives in a different repository, so every CLI citation names it. Claims that neither repository can settle are in section 7 with the command that would settle them.
8 12

@@ -15,10 +19,19 @@

15 19
> write policy to every project operation, and supports authenticated reads of
16 20
> private issues. The `initial_repository!/0` and `initial_path/0` shortcuts no
17 21
> longer exist. The findings below describe the pre-remediation surface.
22
> The CLI guides now document `openagents api`, Issues and Projects recipes,
23
> and the absence of named `issue` and `project` commands. The stale claim that
24
> `repo delete` and generic API access were unavailable is fixed.
18 25
19
The owner is right. The CLI is repository-shaped and reaches **none** of the Issues and Projects API.
26
At the measured commits, the owner was right: the CLI was repository-shaped
27
and reached **none** of the Issues and Projects API.
20 28
21
The numbers are clean. The router exposes **50 routes under `/api/v3`** (`lib/openagents_web/router.ex:229`, `:253`, `:259`). The CLI calls **11 of them** — the authenticated user, repository create, list, view, delete, the two import routes, import status, and the two device-authorization routes. Those 11 are exactly the routes named in the hand-written contract document at `priv/api-contracts/repositories-v1.json:18`. The other **39 routes — every issue, comment, label, milestone, assignee, and project endpoint — have no CLI surface at all**, and the CLI's own documentation says so: `docs/openagents-cli/command-reference.md:3` scopes the tool to "authentication and hosted repositories", and `:171` lists a generic API command among the things the release does not provide.
29
At those commits, the router exposed **50 routes under `/api/v3`**
30
(`lib/openagents_web/router.ex:229`, `:253`, `:259`). The CLI called **11 of
31
them**: the authenticated user, repository create, list, view, delete, the two
32
import routes, import status, and the two device-authorization routes. The
33
other **39 routes** had no CLI surface. The current `openagents api` command
34
now reaches them without adding named commands.
22 35
23 36
There is **no OpenAPI document**. What exists instead is a 99-line hand-written JSON artifact served at `/api/contracts/repositories-v1.json` (`lib/openagents_web/router.ex:222`). It lists endpoints as opaque `"METHOD /path"` strings, has no types, no request bodies, no response schemas, and no status codes. It covers 11 of the 50 routes. Nothing derives it from the router, and nothing verifies it against the router.
24 37

@@ -93,7 +106,11 @@ Both copies currently hash to `5be86539258c38d5249887ff2628680b1f90c93909d6e83e8

93 106
94 107
Confirmed, with one refinement. "Repo upload stuff" understates it slightly — the CLI also does device-flow authentication, credential storage, Git credential-helper installation, repository listing, viewing, cloning, and deletion, and it waits on durable provisioning and import state machines. But on the substance the belief is exactly right: **the CLI has no issue, comment, label, milestone, assignee, or project command, and calls no endpoint in those families.** Its own reference documentation states the boundary (`docs/openagents-cli/command-reference.md:3`, `:171`) and its `README.md` in the monorepo has sections only for install, API selection, sign-in, and repositories.
95 108
96
One documentation defect found in passing, relevant because it is evidence for section 4: `docs/openagents-cli/command-reference.md:173` says the release "does not provide `repo delete`" while the same file documents `repo delete` in full at `:122`, the command exists at `cli.ts:756`, and `docs/openagents-cli/index.md:34` describes it as available. A hand-maintained description drifted from the thing it describes, in the smallest possible surface, in the same file.
109
One documentation defect found at the measured commit remains relevant as
110
evidence for section 4: the command reference said the release did not provide
111
`repo delete` while the same file documented the command. The 2026-08-22
112
documentation reconciliation fixed that contradiction and added the missing
113
generic API reference.
97 114
98 115
---
99 116

@@ -332,7 +349,7 @@ Each stage is independently shippable and independently useful. Sizes are rough

332 349
333 350
### Stage 1 — Ship `openagents api` (CLI repository only, small) — SHIPPED 2026-08-21
334 351
335
Add one leaf command taking a path, an optional `-X/--method`, repeated `-f key=value` body fields or `--input -` for raw JSON, and honoring the existing `--json` and profile flags. **Seam:** `packages/openagents-cli/src/cli.ts` plus a thin passthrough client in the `openagents` monorepo; no schema, no server change. **Size:** 150–250 lines with tests. **Effect:** every one of the 50 endpoints becomes reachable from a terminal, and every future endpoint arrives free. Also update `docs/openagents-cli/command-reference.md:171`, which currently lists a generic API command among the things the release does not provide, and fix the stale `repo delete` claim on the same line while you are in there.
352
Add one leaf command taking a path, an optional `-X/--method`, repeated `-f key=value` body fields or `--input -` for raw JSON, and honoring the existing `--json` and profile flags. **Seam:** `packages/openagents-cli/src/cli.ts` plus a thin passthrough client in the `openagents` monorepo; no schema, no server change. **Size:** 150–250 lines with tests. **Effect:** every one of the 50 endpoints becomes reachable from a terminal, and every future endpoint arrives free. The CLI documentation reconciliation on 2026-08-22 removed the stale claims that generic API access and `repo delete` were unavailable and added tested Issues and Projects recipes.
336 353
337 354
**What shipped.** `eaa2aa1006` in the `openagents` monorepo, released as
338 355
`@openagentsinc/cli@0.2.1`. The command is `openagents api <path>`: a path

@@ -366,7 +383,11 @@ returns real-looking JSON describing one hardcoded repository rather than

366 383
yours. A passthrough is faithful by design: it exposes those surfaces exactly
367 384
as they are, including where they are wrong.
368 385
369
### Stage 2 — Let an authenticated caller read their own private issues (this repository only, medium)
386
### Stage 2 — Let an authenticated caller read their own private issues (this repository only, medium) — PARTIALLY SHIPPED 2026-08-22
387
388
Issue list and detail reads now accept an optional bearer and authorize private
389
repository members. The comment, label, milestone, and assignee read routes
390
remain in the public-read pipeline, so the broader stage is not complete.
370 391
371 392
Move the issue, comment, label, milestone, and assignee read routes (`router.ex:235`–`:246`) from `pipe_through :api` into `pipe_through :optional_forge_api`, and change the resolution calls in `IssueController`, `CommentController`, `IssueLabelController`, `IssueAssigneeController`, `LabelController`, `MilestoneController`, and `AssigneeController` from `Repositories.get_public_by_path!/2` to `Repositories.get_visible_by_path!/3`, threading `conn.assigns.current_user` (which the optional plug sets to `nil` for anonymous callers). The visibility filters inside `Issues.get_issue_by_path!/3` (`issues.ex:159`), `Issues.get_comment_by_path!/3`, `Labels.get_label_by_path!/3`, and `Milestones.get_milestone_by_path!/3` need the same treatment. **Seam:** router pipelines, ten or so controller call sites, four context queries, and the `RouteAuthority` policy at `route_authority.ex:184`, whose `:public_read` classification for these paths becomes wrong. **Size:** medium; mechanical but wide, and every one of these controllers already has a test file to extend. **Effect:** additive and backward-compatible — anonymous callers see exactly what they see today; the change is that a bearer token now widens the result instead of being discarded. Without this, sections 3.1 ranks 1, 2, 8, and 9 only ever work on public repositories, so this gates most of the value of Stage 3.
372 393

@@ -397,11 +418,18 @@ Unpin the project surface from `Repositories.initial_repository!()` (`projects.e

397 418
398 419
### What makes issue management usable this week versus complete
399 420
400
Stages 1 and 2 make it usable — the passthrough covers everything, and the read fix makes private repositories work. Stage 3 makes it pleasant. Stages 4 through 7 make it complete. Stage 5 is what makes it stay correct, and it is deliberately not early: deriving a document from a surface that Stages 2, 4, and 7 are still reshaping means regenerating it three times.
421
Stage 1 makes every implemented route reachable. The shipped portion of Stage
422
2 makes private issue list and detail reads usable. Completing Stage 2 makes
423
the ancillary issue workflow usable for private repositories, and Stage 3
424
makes the common workflow concise. Stages 4 through 7 complete more of the
425
contract. Stage 5 keeps the server and client descriptions aligned.
401 426
402 427
### The cross-repository cost, and how to handle it
403 428
404
The CLI ships from the `openagents` monorepo as `@openagentsinc/cli`, published to npm at version `0.1.7`, with its own `verify` pipeline (format, lint, typecheck, test, build) and its own release cadence. This repository deploys on its own. Four rules keep that from becoming a coordination tax:
429
The CLI ships from the `openagents` monorepo as `@openagentsinc/cli`, currently
430
published to npm at version `0.2.1`, with its own `verify` pipeline (format,
431
lint, typecheck, test, and build) and its own release cadence. This repository
432
deploys on its own. Four rules keep that from becoming a coordination tax:
405 433
406 434
1. **Order every stage server-first.** A released CLI in a user's `$PATH` will meet a deployed server. The reverse — a server change that only works with an unreleased CLI — creates a window where the published tool is broken. Stages 2, 4, and 7 land and deploy before the CLI stage that depends on them.
407 435
2. **Never require simultaneous merges.** Each stage above touches exactly one repository, by construction. Stage 2 is additive: anonymous reads keep their current behavior, so no released CLI breaks.

@@ -422,8 +450,10 @@ Not everything here needs changing, and two decisions are better than they look:

422 450
423 451
## 7. Open questions
424 452
425
- **Does the published npm package's vendored contract match the deployed server's?** Both working copies hash to `5be86539258c…`, but a stale local build in the CLI's gitignored `dist/` carries `9355cac5191e…`, which suggests the constant has changed at least once. Settle with `npm pack @openagentsinc/cli@0.1.7`, then `shasum -a 256 package/contracts/repositories-v1.json`, and compare against `curl -s https://openagents.com/api/contracts/repositories-v1.json | shasum -a 256`.
426
- **Is the absence of any visibility predicate on the four project reads intentional?** `ProjectController.index`, `show`, `items`, and `fields` apply none (`project_controller.ex:8`, `:41`, `:53`, `:144`), unlike every sibling controller. The pinning to one repository may be masking it. A test asserting that a project on a private repository is not listed anonymously would settle the policy either way.
453
- **Does the published npm package's vendored contract match the deployed server's?** Both measured working copies hash to `5be86539258c…`, but the CLI still verifies only its vendored copy. Compare the packed `@openagentsinc/cli@0.2.1` artifact with the deployed `/api/contracts/repositories-v1.json`, then make the comparison a staging verification failure.
454
- **Which ancillary reads should accept an optional bearer?** Repository,
455
  issue, and project base reads now authorize private repository members.
456
  Comment, label, assignee, and milestone reads remain public-only.
427 457
- **Is `forge:read` in `route_authority.ex:184` an aspiration or a mistake?** If the intent is a read-only token scope, it needs adding to `@allowed_scopes` (`lib/openagents/api_tokens.ex:12`) and a `:forge_read_api` pipeline; if not, the label should say `forge:write`. Settle by asking whether a token that can file an issue should also be able to delete a repository, which is today's answer.
428 458
- **Does anything consume the `{"issues": [...]}` envelope, or could the list endpoints move to bare arrays for GitHub compatibility?** Settle by grepping the `openagents` monorepo and this repository's web layer for consumers before Stage 5 freezes the shape into a generated document.
429 459
- **What is the intended pagination convention across the whole API?** Repositories use opaque cursors and issues are offset-paged internally. Stage 4 has to pick one, and the choice belongs to whoever owns the contract document, not to the first endpoint that needs a page.
docs/2026-08-21-issue-project-triage-runbook.md modified +35 -1

@@ -304,7 +304,41 @@ The standing policy, publishable anywhere the tracker is announced:

304 304
Reporters who later become contributors get roles through the members page;
305 305
that is a deliberate human decision, not an automatic upgrade.
306 306
307
### API recipes
307
### CLI and API recipes
308
309
Use `openagents api` for the normal terminal workflow. It selects the API
310
origin, reads the stored `oa_pat_` credential, and keeps successful JSON on
311
standard output.
312
313
Read open issues:
314
315
```sh
316
openagents api \
317
  'repos/OpenAgentsInc/openagents.com/issues?state=open'
318
```
319
320
Create an issue with an existing label:
321
322
```sh
323
printf '%s' \
324
  '{"title":"Search returns duplicates","body":"Steps to reproduce...","labels":["bug"]}' | \
325
  openagents api -X POST --input - \
326
  repos/OpenAgentsInc/openagents.com/issues
327
```
328
329
Close an issue as not planned:
330
331
```sh
332
printf '%s' '{"state":"closed","state_reason":"not_planned"}' | \
333
  openagents api -X PATCH --input - \
334
  repos/OpenAgentsInc/openagents.com/issues/42
335
```
336
337
The published CLI does not yet provide named `issue` or `project` commands.
338
See [Call the API with the OpenAgents CLI](openagents-cli/api.md) for project,
339
item, and scripting examples.
340
341
Use `curl` when you need to verify the HTTP boundary without the CLI.
308 342
309 343
Read (anonymous, public repository):
310 344
docs/2026-08-21-issues-projects-work-system-assessment.md modified +65 -40

@@ -2,8 +2,9 @@

2 2
3 3
Date: 2026-08-21
4 4
5
Status: Proposed plan for organizing the OpenAgents backlog and completing the
6
Issues and Projects product
5
Status: Active program. The three projects and initial tracking issues exist in
6
production. Private issue reads and repository-scoped Projects V2 routes have
7
shipped; the remaining tracks stay open.
7 8
8 9
## Decision summary
9 10

@@ -27,16 +28,16 @@ shippable changes. Until native sub-issues ship, use a checklist in the

27 28
tracking issue and keep every checklist entry linked to a real issue.
28 29
29 30
Finish the server contract before building rich clients on top of it. The
30
current API lets a token create an issue in a private repository and then
31
cannot read it back, leaves issue lists unbounded, and pins Projects V2 to the
32
initial repository. Those defects can make a polished CLI confidently do the
33
wrong thing.
31
private issue-read asymmetry and initial-repository Projects V2 pin are fixed.
32
Issue lists remain unbounded, ancillary issue-resource reads remain
33
public-repository only, and the Projects model still lacks lifecycle and
34
cross-repository operations.
34 35
35 36
The generic `openagents api` command landed in the `openagents` monorepo at
36
`eaa2aa1006`, so every current route is already reachable from a terminal.
37
Named issue and project commands are now in flight in another agent's work.
38
Treat that CLI lane as active work: do not start a second implementation, and
39
do not make the server plan depend on an unmerged CLI branch.
37
`eaa2aa1006` and ships in `@openagentsinc/cli@0.2.1`, so every current route is
38
reachable from a terminal. The published CLI does not include named `issue` or
39
`project` commands. Coordinate with any active CLI task before you start D1
40
through D5, and do not make the server plan depend on an unmerged CLI branch.
40 41
41 42
## Scope and evidence
42 43

@@ -64,6 +65,29 @@ The transcripts provide product background, not implementation instructions.

64 65
The repository's code, tests, authority ledger, and current operator decisions
65 66
remain the executable constraints.
66 67
68
## Current work records
69
70
Production now uses the structure recommended by this assessment:
71
72
- Project 1, **openagents.com roadmap**, holds the public product outcomes.
73
- Project 2, **Issues and Projects delivery**, holds the server and CLI
74
  delivery work.
75
- Project 3, **Agent work and provenance**, holds issue-to-agent and
76
  issue-to-release work.
77
- Issue 9, **Deliver the Issues and Projects work system**, tracks the delivery
78
  program.
79
- Issue 10, **Connect issues to agent work and release receipts**, tracks the
80
  provenance program.
81
- Issues 4 and 8 closed after private issue reads and repository-scoped
82
  Projects V2 routes deployed.
83
- Issues 5, 6, and 7 remain open for pagination and filters, request-origin
84
  URLs, and route-authority reconciliation.
85
- `OpenAgentsInc/openagents` issue 1 tracks the published CLI's stale embedded
86
  version value without duplicating the named-command work.
87
88
The project item statuses reflect deployed work, not branch state. Update them
89
only after the target environment has a release receipt.
90
67 91
## What exists now
68 92
69 93
### Issues

@@ -86,7 +110,8 @@ The issue system already supports more than the current project board shows:

86 110
87 111
Important missing issue capabilities include:
88 112
89
- Authenticated API reads for private repositories.
113
- Optional-bearer private reads for comments, labels, assignees, and
114
  milestones. Issue list and issue detail private reads have shipped.
90 115
- A documented, bounded API pagination contract and the web filters on the
91 116
  API list route.
92 117
- Cross-repository and organization issue API views.

@@ -114,11 +139,8 @@ The project system currently supports:

114 139
The project layer remains an early implementation, not a complete work
115 140
system:
116 141
117
- Projects V2 API reads and creation resolve through the initial-repository
118
  constants instead of the repository or namespace requested by the caller.
119
- Project API reads do not apply the same visibility rule as their sibling
120
  issue routes.
121
- The API has inconsistent creation and read paths.
142
- Repository-scoped Projects V2 routes now resolve the repository in the path,
143
  apply public or member visibility, and use one consistent route family.
122 144
- The board cannot remove, reorder, or move an item directly. It does not
123 145
  render an item activity trail or show why an item changed status.
124 146
- The web board ignores the project's stored field definitions and always

@@ -140,9 +162,9 @@ That gives scripts immediate access to the existing Issues and Projects API.

140 162
141 163
The generic command is not the end-user issue experience. Named commands need
142 164
repository inference, concise tables, issue-number arguments, editor support,
143
confirmation for destructive actions, and stable machine output. That work is
144
in flight elsewhere. The server should provide correct, testable routes while
145
the CLI agent owns the named command experience.
165
confirmation for destructive actions, and stable machine output. They are not
166
part of the published CLI. The server must keep providing correct, testable
167
routes while a coordinated CLI task owns the named command experience.
146 168
147 169
### Agent and receipt infrastructure
148 170

@@ -323,8 +345,10 @@ numbers. Create each item as an issue in the repository named in the

323 345
| A6 | `openagents.com` | Publish a complete derived API route inventory | CI derives the route list from the router and fails when the published contract omits a route. Response schemas may remain incremental and explicit. |
324 346
| A7 | `openagents` | Compare the CLI contract with the configured server | CLI verification fetches the published contract from staging and fails on divergence instead of hashing only its vendored copy. |
325 347
326
A1 through A5 precede a stable named CLI release. A6 and A7 can follow after
327
the routes stop moving, but the route-coverage failure should land early.
348
A1 is partially complete: optional-bearer issue reads shipped, while ancillary
349
comment, label, assignee, and milestone reads remain. A2 through A5 still
350
precede a stable named CLI release. A6 and A7 can follow after the routes stop
351
moving, but the route-coverage failure should land early.
328 352
329 353
### Track B: Complete the issue work record
330 354

@@ -357,13 +381,14 @@ manual triage loop.

357 381
| C9 | `openagents.com` | Add public project reading | Anonymous users can read a project only when every exposed item and field is safe under the project's visibility policy. |
358 382
| C10 | `openagents.com` | Add project activity and live updates | Item and field changes update connected clients and record who changed what. |
359 383
360
C1 and C2 require a written migration and URL compatibility decision. Do not
361
silently reinterpret existing repository-local project numbers.
384
C1 shipped through repository-scoped routes without reinterpreting existing
385
repository-local project numbers. C2 still requires a written ownership and
386
cross-repository membership decision.
362 387
363 388
### Track D: Finish the named CLI experience
364 389
365
This track belongs to the agent already working in the `openagents` monorepo.
366
Use this list to coordinate scope, not to start duplicate work.
390
The published `openagents` monorepo does not contain these named commands. Use
391
this list to coordinate with any active CLI task and avoid duplicate work.
367 392
368 393
| ID | Repository | Issue | Completion signal |
369 394
| --- | --- | --- | --- |

@@ -416,9 +441,9 @@ new executor.

416 441
417 442
### Phase 1: Make the current contract safe to build on
418 443
419
Complete A1 through A5 and C1. This phase fixes authorization, pagination,
420
origins, errors, route authority, and project addressing. Deploy it before the
421
named CLI reads or project commands claim support.
444
Complete the remaining A1 work and A2 through A5. C1 has shipped. This phase
445
finishes authorization, pagination, origins, errors, and route authority.
446
Deploy it before named CLI reads claim complete private-resource support.
422 447
423 448
### Phase 2: Complete core project operations
424 449

@@ -546,18 +571,18 @@ the issue that merge rather than deployment defines completion.

546 571
Answer these questions in decision records before migrations or public API
547 572
changes make the answers expensive to revise.
548 573
549
## Immediate next actions
574
## Next actions
550 575
551
1. Create the **Issues and Projects delivery** tracking issue from this
552
   document and add A1, A2, A3, A5, and C1 as its first child issues.
553
2. Identify the active named-CLI task and link D1 through D5 to it without
554
   duplicating its implementation.
555
3. Create a decision record for project ownership and cross-repository items.
556
4. Add owners, milestones, acceptance criteria, and linked implementation
576
1. Finish issue 5 for bounded issue API pagination and filters.
577
2. Finish issue 6 for request-origin URLs and issue 7 for route-authority
578
   reconciliation.
579
3. Create a decision record for project ownership and cross-repository items
580
   before C2 changes the repository-local model.
581
4. Coordinate D1 through D5 with the active CLI owner, if one exists. Keep
582
   `openagents api` documented and supported until named commands qualify.
583
5. Add owners, milestones, acceptance criteria, and linked implementation
557 584
   issues to the current roadmap cards. Move them to the six-status workflow
558 585
   after C6 lands.
559
5. Fix server authorization and project addressing before qualifying named
560
   commands.
561
6. Add the issue-to-work-job relationship as a read-only link after the core
562
   server correction lands.
563
7. Use the resulting system to track every later change in this plan.
586
6. Add the issue-to-work-job relationship as a read-only link under issue 10.
587
7. Use these Issues and Projects records to track every later change in this
588
   plan.
docs/github-api-issues-projects-assessment.md modified +19

@@ -43,6 +43,20 @@ GitHub Projects V2 creation workflow is not supplied by the assessed REST

43 43
surface. Project update/delete, item delete/read, field mutation, views,
44 44
ordering, draft items, and organization projects remain unimplemented.
45 45
46
## CLI access
47
48
`@openagentsinc/cli@0.2.1` exposes the complete implemented surface through
49
`openagents api`. The published CLI does not yet provide named `issue` or
50
`project` commands.
51
52
```sh
53
openagents api 'repos/OWNER/REPOSITORY/issues?state=all'
54
openagents api repos/OWNER/REPOSITORY/projectsV2
55
```
56
57
See [Call the API with the OpenAgents CLI](openagents-cli/api.md) for request
58
bodies, response envelopes, Issues recipes, and Projects recipes.
59
46 60
## Enforced authority contract
47 61
48 62
These are current measured behaviors:

@@ -72,6 +86,11 @@ These are compatibility limits, not authorization fallbacks:

72 86
73 87
- Issue creation with a nonexistent label returns 422; only the
74 88
  add-labels-to-issue endpoint creates labels on the fly, matching GitHub.
89
- Optional-bearer private reads cover repository, issue, and project base
90
  routes. Comment, label, assignee, and milestone read routes remain
91
  public-repository reads.
92
- Nonnumeric issue and milestone numbers can produce `500 Internal Server
93
  Error` instead of `404 Not Found`.
75 94
- Error envelopes and pagination/link headers are a bounded local contract,
76 95
  not complete Octokit or `gh` parity.
77 96
docs/openagents-cli/api.md added +192

@@ -0,0 +1,192 @@

1
# Call the API with the OpenAgents CLI
2
3
The `openagents api` command sends an authenticated request to any OpenAgents
4
API route and writes the response body as JSON. Use it for Issues, Projects,
5
and other routes that do not have a named CLI command.
6
7
The current release does not provide `openagents issue` or
8
`openagents project` commands. `openagents api` is the supported terminal path
9
for those resources.
10
11
## Before you begin
12
13
Install the CLI and sign in to the API profile you intend to use:
14
15
```sh
16
npm install --global @openagentsinc/cli@latest
17
openagents auth login
18
openagents auth status
19
```
20
21
You can also set `OPENAGENTS_TOKEN` to an `oa_pat_` user token for one process.
22
The token must carry the authority required by the route. Public API reads may
23
allow anonymous HTTP requests, but `openagents api` still resolves an
24
authenticated CLI session before it sends a request.
25
26
## Address a route
27
28
A relative path resolves under `/api/v3/`:
29
30
```sh
31
openagents api repos/OWNER/REPOSITORY/issues
32
```
33
34
These paths name the same route:
35
36
```text
37
repos/OWNER/REPOSITORY/issues
38
/api/v3/repos/OWNER/REPOSITORY/issues
39
```
40
41
An absolute path must start with `/api/`. A complete URL must use the exact API
42
origin selected by `--profile`, `--api-url`, or the CLI configuration. The CLI
43
refuses another origin and refuses paths that escape the API namespace.
44
45
## Select a method and body
46
47
Use `-X` or `--method` to select `GET`, `POST`, `PATCH`, `PUT`, or `DELETE`.
48
Without the flag, a request without a body uses `GET`, and a request with a
49
body uses `POST`.
50
51
Use repeatable `-f` or `--field` flags for a flat JSON object whose values are
52
strings:
53
54
```sh
55
openagents api -X POST \
56
  -f title="Search returns duplicates" \
57
  -f body="Include steps to reproduce" \
58
  repos/OWNER/REPOSITORY/issues
59
```
60
61
Use `--input` for numbers, booleans, arrays, nested objects, or `null`:
62
63
```sh
64
openagents api --input request.json repos/OWNER/REPOSITORY/issues
65
66
printf '%s' '{"labels":["bug"],"milestone":3}' | \
67
  openagents api -X PATCH --input - \
68
  repos/OWNER/REPOSITORY/issues/41
69
```
70
71
`--input -` reads standard input. `--field` and `--input` are mutually
72
exclusive.
73
74
Use repeatable `-H` or `--header` flags for route-specific headers:
75
76
```sh
77
openagents api -H 'Idempotency-Key: WORK_ITEM_ID' ROUTE
78
```
79
80
The CLI supplies the bearer credential from the selected session and refuses
81
an `Authorization` header override.
82
83
## Work with issues
84
85
List open issues. The API returns an object with an `issues` array:
86
87
```sh
88
openagents api repos/OWNER/REPOSITORY/issues
89
90
openagents api 'repos/OWNER/REPOSITORY/issues?state=all' | \
91
  jq -r '.issues[] | [.number, .state, .title] | @tsv'
92
```
93
94
Read one issue and its comments:
95
96
```sh
97
openagents api repos/OWNER/REPOSITORY/issues/41
98
openagents api repos/OWNER/REPOSITORY/issues/41/comments
99
```
100
101
Create, edit, close, and reopen an issue:
102
103
```sh
104
openagents api -X POST \
105
  -f title="Search returns duplicates" \
106
  -f body="Steps to reproduce" \
107
  repos/OWNER/REPOSITORY/issues
108
109
openagents api -X PATCH -f title="Search duplicates results" \
110
  repos/OWNER/REPOSITORY/issues/41
111
112
printf '%s' '{"state":"closed","state_reason":"completed"}' | \
113
  openagents api -X PATCH --input - \
114
  repos/OWNER/REPOSITORY/issues/41
115
116
openagents api -X PATCH -f state=open \
117
  repos/OWNER/REPOSITORY/issues/41
118
```
119
120
Add a comment:
121
122
```sh
123
openagents api -X POST -f body="The fix is available in staging." \
124
  repos/OWNER/REPOSITORY/issues/41/comments
125
```
126
127
The [GitHub-shaped Issues and Projects API
128
assessment](../github-api-issues-projects-assessment.md) lists the implemented
129
label, assignee, milestone, comment, and issue-label routes.
130
131
## Work with projects
132
133
List repository projects. The API returns an object with a `projects` array:
134
135
```sh
136
openagents api repos/OWNER/REPOSITORY/projectsV2
137
```
138
139
Read a project, its items, and its fields:
140
141
```sh
142
openagents api repos/OWNER/REPOSITORY/projectsV2/PROJECT_NUMBER
143
openagents api repos/OWNER/REPOSITORY/projectsV2/PROJECT_NUMBER/items
144
openagents api repos/OWNER/REPOSITORY/projectsV2/PROJECT_NUMBER/fields
145
```
146
147
Create a repository project:
148
149
```sh
150
openagents api -X POST -f title="Release readiness" \
151
  repos/OWNER/REPOSITORY/projectsV2
152
```
153
154
Add an issue to a project. `issue_id` is the issue's numeric database ID from
155
the issue response, not its repository-local issue number:
156
157
```sh
158
printf '%s' '{"issue_id":42,"values":{"Status":"To Do"}}' | \
159
  openagents api -X POST --input - \
160
  repos/OWNER/REPOSITORY/projectsV2/PROJECT_NUMBER/items
161
```
162
163
Update the stored values for an item:
164
165
```sh
166
printf '%s' '{"values":{"Status":"Done"}}' | \
167
  openagents api -X PATCH --input - \
168
  repos/OWNER/REPOSITORY/projectsV2/PROJECT_NUMBER/items/ITEM_ID
169
```
170
171
## Use output in scripts
172
173
Standard output contains only a successful response body. `--json` writes the
174
same JSON on one line. Human diagnostics and failed API bodies go to standard
175
error.
176
177
```sh
178
openagents --json api repos/OWNER/REPOSITORY/issues >issues.json
179
```
180
181
A non-`2xx` response fails the command. The CLI includes the response's request
182
ID in the error when the server supplies one. Preserve that ID when you report
183
an API failure.
184
185
Do not parse human output from named repository commands as JSON. Add `--json`
186
to those commands. `openagents api` always returns the response body as JSON.
187
188
## Related documentation
189
190
- [CLI command reference](command-reference.md)
191
- [Install the CLI](install.md)
192
- [REST API assessment](../github-api-issues-projects-assessment.md)
docs/openagents-cli/command-reference.md modified +47 -4

@@ -1,6 +1,8 @@

1 1
# OpenAgents CLI command reference
2 2
3
The `openagents` command manages authentication and hosted repositories.
3
The `openagents` command manages authentication and hosted repositories. It
4
also sends authenticated requests to OpenAgents API routes that do not have a
5
named command yet.
4 6
5 7
```text
6 8
openagents <subcommand> [flags]

@@ -131,6 +133,45 @@ history, issues, projects, and import records. You must pass `--yes`. When you

131 133
omit the repository, the CLI infers it from an exact OpenAgents `origin`
132 134
remote on the selected API origin.
133 135
136
## API command
137
138
```text
139
openagents api [flags] <path>
140
```
141
142
A path without a leading slash resolves under `/api/v3/`. For example,
143
`repos/OWNER/REPOSITORY/issues` and
144
`/api/v3/repos/OWNER/REPOSITORY/issues` name the same route. An absolute path
145
must start with `/api/` and stay on the selected API origin.
146
147
| Flag | Description |
148
| --- | --- |
149
| `--method METHOD`, `-X METHOD` | Use `GET`, `POST`, `PATCH`, `PUT`, or `DELETE`. The default is `GET`, or `POST` when the request has a body. |
150
| `--field KEY=VALUE`, `-f KEY=VALUE` | Add a repeatable string field to a JSON object body. |
151
| `--input FILE` | Read the complete JSON body from a file. Use `-` for standard input. |
152
| `--header 'NAME: VALUE'`, `-H 'NAME: VALUE'` | Add a repeatable request header. The CLI refuses an `Authorization` override. |
153
154
`--field` and `--input` are mutually exclusive. Use `--input` when a body
155
contains numbers, booleans, arrays, nested objects, or `null`; `--field` sends
156
every value as a JSON string.
157
158
```sh
159
openagents api repos/OWNER/REPOSITORY/issues
160
openagents api -X POST -f title="Search returns duplicates" \
161
  -f body="Steps to reproduce" \
162
  repos/OWNER/REPOSITORY/issues
163
printf '%s' '{"state":"closed","state_reason":"completed"}' | \
164
  openagents api -X PATCH --input - \
165
  repos/OWNER/REPOSITORY/issues/41
166
```
167
168
The command writes a successful response body as JSON. A non-`2xx` response
169
writes the API error and request ID to standard error and exits with the
170
status-specific CLI exit code.
171
172
See [Call the API with the CLI](api.md) for Issues and Projects recipes and
173
the origin-boundary rules.
174
134 175
## JSON and noninteractive use
135 176
136 177
With `--json`, stdout contains machine-readable output. Human progress and

@@ -170,6 +211,8 @@ and terminates its child Git process.

170 211
171 212
## Commands not included
172 213
173
This release does not provide `repo delete`, `repo mirror`, pull-request,
174
ruleset, SSH-key, generic API, or self-update commands. Use only commands shown
175
by the installed version's `--help` output.
214
This release does not provide named `issue` or `project` commands, repository
215
mirroring, pull-request commands, ruleset commands, SSH-key commands, or a
216
self-update command. Use `openagents api` for the implemented Issues and
217
Projects routes, and use only commands shown by the installed version's
218
`--help` output.
docs/openagents-cli/import-github.md modified +2 -2

@@ -79,7 +79,7 @@ npx --yes @openagentsinc/cli@latest repo import OWNER/REPOSITORY

79 79
Pin the package version for a reproducible qualification run:
80 80
81 81
```sh
82
npx --yes @openagentsinc/cli@0.1.5 \
82
npx --yes @openagentsinc/cli@0.2.1 \
83 83
  --profile staging \
84 84
  repo import OWNER/REPOSITORY \
85 85
  --private \

@@ -138,7 +138,7 @@ pointer files without copying the LFS objects.

138 138
1. Install the qualified CLI version:
139 139
140 140
   ```sh
141
   npm install --global @openagentsinc/cli@0.1.5
141
   npm install --global @openagentsinc/cli@0.2.1
142 142
   ```
143 143
144 144
2. Sign in to production and confirm the selected account:
docs/openagents-cli/index.md modified +9 -4

@@ -2,7 +2,8 @@

2 2
3 3
The OpenAgents CLI (`openagents`) manages OpenAgents-hosted Git repositories
4 4
from a terminal. It uses the same repository API as the OpenAgents web
5
interface and leaves Git data transfer to standard Git.
5
interface, leaves Git data transfer to standard Git, and can call any
6
implemented API route.
6 7
7 8
The CLI is available from npm. OpenAgents qualified repository imports on
8 9
staging before deploying the same server revision to the production fleet.

@@ -15,7 +16,7 @@ Install the CLI globally for regular use, or run a one-time command through

15 16
16 17
```sh
17 18
npm install --global @openagentsinc/cli
18
npx --yes @openagentsinc/cli@latest --version
19
npx --yes @openagentsinc/cli@latest --help
19 20
```
20 21
21 22
Do not configure a persistent Git credential helper through `npx`. Install the

@@ -33,10 +34,13 @@ The first release lets you:

33 34
- Clone repositories and configure Git authentication.
34 35
- Delete a repository you own with explicit confirmation.
35 36
- Push, pull, and fetch through Git smart HTTP.
37
- Call Issues, Projects, and other implemented API routes with
38
  `openagents api`.
36 39
- Use JSON output and stable exit codes in scripts and agents.
37 40
38
Pull requests, continuous GitHub mirroring, SSH transport, rulesets, and
39
self-update are not part of this release.
41
Named `issue` and `project` commands, pull requests, continuous GitHub
42
mirroring, SSH transport, rulesets, and self-update are not part of this
43
release.
40 44
41 45
## Namespaces and access
42 46

@@ -88,4 +92,5 @@ access.

88 92
- [Import a GitHub repository](import-github.md)
89 93
- [Clone, push, and pull](git.md)
90 94
- [Delete a repository](delete-repository.md)
95
- [Call the API](api.md)
91 96
- [CLI command reference](command-reference.md)
docs/openagents-cli/install.md modified +12 -4

@@ -9,12 +9,19 @@ command. The package requires Node.js 20 or later.

9 9
npm install --global @openagentsinc/cli
10 10
```
11 11
12
Verify the installed version:
12
Verify the installed npm package and command:
13 13
14 14
```sh
15
openagents --version
15
npm list --global @openagentsinc/cli --depth=0
16
openagents --help
16 17
```
17 18
19
`@openagentsinc/cli@0.2.1` contains an older embedded `--version` value and
20
reports `0.1.7`. Use the npm package listing to verify that release until a
21
later CLI release corrects the embedded value. Follow
22
[`OpenAgentsInc/openagents` issue 1](https://openagents.com/OpenAgentsInc/openagents/issues/1)
23
for the correction.
24
18 25
To update after a release, install the latest npm package again:
19 26
20 27
```sh

@@ -28,14 +35,14 @@ The CLI does not include an `openagents update` command.

28 35
Use `npx` when you want to run one command without a global installation:
29 36
30 37
```sh
31
npx --yes @openagentsinc/cli@latest --version
38
npx --yes @openagentsinc/cli@latest --help
32 39
npx --yes @openagentsinc/cli@latest repo list
33 40
```
34 41
35 42
Pin a version for a reproducible run:
36 43
37 44
```sh
38
npx --yes @openagentsinc/cli@0.1.4 --version
45
npx --yes @openagentsinc/cli@0.2.1 --help
39 46
```
40 47
41 48
Place all CLI arguments after the package name:

@@ -205,4 +212,5 @@ hosts and never places a token in a Git URL or process argument.

205 212
206 213
- [Create a repository](create-repository.md)
207 214
- [Clone, push, and pull](git.md)
215
- [Call the API](api.md)
208 216
- [CLI command reference](command-reference.md)
lib/openagents_web/docs_catalog.ex modified +6

@@ -67,6 +67,12 @@ defmodule OpenAgentsWeb.DocsCatalog do

67 67
          title: "CLI command reference",
68 68
          icon: "square-code",
69 69
          route: "/repositories"
70
        },
71
        %{
72
          slug: "cli-api",
73
          title: "Call the API with the CLI",
74
          icon: "square-code",
75
          route: "/api/v3/repos/:owner/:repo/issues"
70 76
        }
71 77
      ]
72 78
    },
priv/docs/cli-api.md added +143

@@ -0,0 +1,143 @@

1
# Call the API with the OpenAgents CLI
2
3
The `openagents api` command sends an authenticated request to any OpenAgents
4
API route and writes the response body as JSON. Use it for Issues, Projects,
5
and other routes that do not have a named CLI command.
6
7
The current release does not provide `openagents issue` or
8
`openagents project` commands. `openagents api` is the supported terminal path
9
for those resources.
10
11
## Before you begin
12
13
Install the CLI and sign in to the profile you intend to use:
14
15
```sh
16
npm install --global @openagentsinc/cli@latest
17
openagents auth login
18
openagents auth status
19
```
20
21
You can also set `OPENAGENTS_TOKEN` to an `oa_pat_` user token for one process.
22
The token must carry the authority required by the route.
23
24
## Address a route
25
26
A relative path resolves under `/api/v3/`:
27
28
```sh
29
openagents api repos/OWNER/REPOSITORY/issues
30
```
31
32
`repos/OWNER/REPOSITORY/issues` and
33
`/api/v3/repos/OWNER/REPOSITORY/issues` name the same route. An absolute path
34
must start with `/api/`. A complete URL must use the exact selected API origin.
35
The CLI refuses another origin and paths outside the API namespace.
36
37
## Select a method and body
38
39
Use `-X` or `--method` to select `GET`, `POST`, `PATCH`, `PUT`, or `DELETE`.
40
Without it, a request without a body uses `GET`, and a request with a body uses
41
`POST`.
42
43
Use repeatable `-f` or `--field` flags for string fields:
44
45
```sh
46
openagents api -X POST \
47
  -f title="Search returns duplicates" \
48
  -f body="Include steps to reproduce" \
49
  repos/OWNER/REPOSITORY/issues
50
```
51
52
Use `--input` for numbers, booleans, arrays, nested objects, or `null`:
53
54
```sh
55
printf '%s' '{"labels":["bug"],"milestone":3}' | \
56
  openagents api -X PATCH --input - \
57
  repos/OWNER/REPOSITORY/issues/41
58
```
59
60
`--input` reads a file, or standard input when you pass `-`. `--field` and
61
`--input` are mutually exclusive. The CLI supplies the bearer credential and
62
refuses an `Authorization` header override.
63
64
## Work with issues
65
66
List issues. The response contains an `issues` array:
67
68
```sh
69
openagents api 'repos/OWNER/REPOSITORY/issues?state=all'
70
71
openagents api 'repos/OWNER/REPOSITORY/issues?state=all' | \
72
  jq -r '.issues[] | [.number, .state, .title] | @tsv'
73
```
74
75
Read, create, close, reopen, and comment on an issue:
76
77
```sh
78
openagents api repos/OWNER/REPOSITORY/issues/41
79
80
openagents api -X POST -f title="Search returns duplicates" \
81
  -f body="Steps to reproduce" \
82
  repos/OWNER/REPOSITORY/issues
83
84
printf '%s' '{"state":"closed","state_reason":"completed"}' | \
85
  openagents api -X PATCH --input - \
86
  repos/OWNER/REPOSITORY/issues/41
87
88
openagents api -X PATCH -f state=open \
89
  repos/OWNER/REPOSITORY/issues/41
90
91
openagents api -X POST -f body="The fix is available in staging." \
92
  repos/OWNER/REPOSITORY/issues/41/comments
93
```
94
95
## Work with projects
96
97
List and read repository projects. The list response contains a `projects`
98
array:
99
100
```sh
101
openagents api repos/OWNER/REPOSITORY/projectsV2
102
openagents api repos/OWNER/REPOSITORY/projectsV2/PROJECT_NUMBER
103
openagents api repos/OWNER/REPOSITORY/projectsV2/PROJECT_NUMBER/items
104
openagents api repos/OWNER/REPOSITORY/projectsV2/PROJECT_NUMBER/fields
105
```
106
107
Create a project and add an issue. `issue_id` is the numeric database ID in the
108
issue response, not its repository-local issue number:
109
110
```sh
111
openagents api -X POST -f title="Release readiness" \
112
  repos/OWNER/REPOSITORY/projectsV2
113
114
printf '%s' '{"issue_id":42,"values":{"Status":"To Do"}}' | \
115
  openagents api -X POST --input - \
116
  repos/OWNER/REPOSITORY/projectsV2/PROJECT_NUMBER/items
117
```
118
119
Update an item's values:
120
121
```sh
122
printf '%s' '{"values":{"Status":"Done"}}' | \
123
  openagents api -X PATCH --input - \
124
  repos/OWNER/REPOSITORY/projectsV2/PROJECT_NUMBER/items/ITEM_ID
125
```
126
127
## Use output in scripts
128
129
Standard output contains only a successful response body. `--json` writes the
130
same JSON on one line. A non-`2xx` response fails the command and writes the API
131
error and request ID to standard error.
132
133
```sh
134
openagents --json api repos/OWNER/REPOSITORY/issues >issues.json
135
```
136
137
Preserve the request ID when you report a failed API call.
138
139
## Related documentation
140
141
- [REST API](/docs/rest-api)
142
- [API tokens](/docs/api-tokens)
143
- [CLI command reference](/docs/cli-command-reference)
priv/docs/cli-command-reference.md modified +47 -4

@@ -1,6 +1,8 @@

1 1
# OpenAgents CLI command reference
2 2
3
The `openagents` command manages authentication and hosted repositories.
3
The `openagents` command manages authentication and hosted repositories. It
4
also sends authenticated requests to OpenAgents API routes that do not have a
5
named command yet.
4 6
5 7
```text
6 8
openagents <subcommand> [flags]

@@ -131,6 +133,44 @@ history, issues, projects, and import records. You must pass `--yes`. When you

131 133
omit the repository, the CLI infers it from an exact OpenAgents `origin`
132 134
remote on the selected API origin.
133 135
136
## Call an API route
137
138
```text
139
openagents api [flags] <path>
140
```
141
142
A path without a leading slash resolves under `/api/v3/`. For example,
143
`repos/OWNER/REPOSITORY/issues` and
144
`/api/v3/repos/OWNER/REPOSITORY/issues` name the same route. An absolute path
145
must start with `/api/` and stay on the selected API origin.
146
147
| Flag | Description |
148
| --- | --- |
149
| `--method METHOD`, `-X METHOD` | Use `GET`, `POST`, `PATCH`, `PUT`, or `DELETE`. The default is `GET`, or `POST` when the request has a body. |
150
| `--field KEY=VALUE`, `-f KEY=VALUE` | Add a repeatable string field to a JSON object body. |
151
| `--input FILE` | Read the complete JSON body from a file. Use `-` for standard input. |
152
| `--header 'NAME: VALUE'`, `-H 'NAME: VALUE'` | Add a repeatable request header. The CLI refuses an `Authorization` override. |
153
154
Use `--input` when a body contains numbers, booleans, arrays, nested objects,
155
or `null`. `--field` sends every value as a JSON string. The two body options
156
are mutually exclusive.
157
158
```sh
159
openagents api repos/OWNER/REPOSITORY/issues
160
openagents api -X POST -f title="Search returns duplicates" \
161
  -f body="Steps to reproduce" \
162
  repos/OWNER/REPOSITORY/issues
163
printf '%s' '{"state":"closed","state_reason":"completed"}' | \
164
  openagents api -X PATCH --input - \
165
  repos/OWNER/REPOSITORY/issues/41
166
```
167
168
The command writes a successful response body as JSON. A non-`2xx` response
169
writes the API error and request ID to standard error and exits with the
170
status-specific CLI exit code.
171
172
See [Call the API with the CLI](/docs/cli-api) for Issues and Projects recipes.
173
134 174
## Use JSON in noninteractive processes
135 175
136 176
With `--json`, stdout contains machine-readable output. Human progress and

@@ -170,9 +210,11 @@ and terminates its child Git process.

170 210
171 211
## Know which commands are unavailable
172 212
173
This release does not provide `repo delete`, `repo mirror`, pull-request,
174
ruleset, SSH-key, generic API, or self-update commands. Use only commands shown
175
by the installed version's `--help` output.
213
This release does not provide named `issue` or `project` commands, repository
214
mirroring, pull-request commands, ruleset commands, SSH-key commands, or a
215
self-update command. Use `openagents api` for the implemented Issues and
216
Projects routes, and use only commands shown by the installed version's
217
`--help` output.
176 218
177 219
## Next steps
178 220

@@ -180,3 +222,4 @@ by the installed version's `--help` output.

180 222
- [Create a repository](/docs/create-repository)
181 223
- [Import from GitHub](/docs/import-github)
182 224
- [Clone, push, and pull](/docs/clone-push-pull)
225
- [Call the API with the CLI](/docs/cli-api)
priv/docs/import-github.md modified +1 -1

@@ -82,7 +82,7 @@ npx --yes @openagentsinc/cli@latest repo import OWNER/REPOSITORY

82 82
Pin the package version for a reproducible qualification run:
83 83
84 84
```sh
85
npx --yes @openagentsinc/cli@0.1.5 \
85
npx --yes @openagentsinc/cli@0.2.1 \
86 86
  --profile staging \
87 87
  repo import OWNER/REPOSITORY \
88 88
  --private \
priv/docs/install-cli.md modified +11 -3

@@ -9,9 +9,16 @@ Install the CLI globally when you use it regularly:

9 9
10 10
```sh
11 11
npm install --global @openagentsinc/cli
12
openagents --version
12
npm list --global @openagentsinc/cli --depth=0
13
openagents --help
13 14
```
14 15
16
`@openagentsinc/cli@0.2.1` contains an older embedded `--version` value and
17
reports `0.1.7`. Use the npm package listing to verify that release until a
18
later CLI release corrects the embedded value. Follow
19
[`OpenAgentsInc/openagents` issue 1](/OpenAgentsInc/openagents/issues/1) for the
20
correction.
21
15 22
Install the latest release again when you want to update:
16 23
17 24
```sh

@@ -26,7 +33,7 @@ Use `npx` when you want to run one CLI command without installing the package

26 33
globally:
27 34
28 35
```sh
29
npx --yes @openagentsinc/cli@latest --version
36
npx --yes @openagentsinc/cli@latest --help
30 37
npx --yes @openagentsinc/cli@latest repo list
31 38
```
32 39

@@ -34,7 +41,7 @@ Pin the package version when a script or qualification run must be

34 41
reproducible:
35 42
36 43
```sh
37
npx --yes @openagentsinc/cli@0.1.4 --version
44
npx --yes @openagentsinc/cli@0.2.1 --help
38 45
```
39 46
40 47
Place every `openagents` argument after the package name:

@@ -201,4 +208,5 @@ hosts and never places a token in a Git URL or process argument.

201 208
- [Create a repository](/docs/create-repository)
202 209
- [Import from GitHub](/docs/import-github)
203 210
- [Clone, push, and pull](/docs/clone-push-pull)
211
- [Call the API with the CLI](/docs/cli-api)
204 212
- [CLI command reference](/docs/cli-command-reference)
priv/docs/issues.md modified +2 -1

@@ -24,4 +24,5 @@ member.

24 24
## Through the API
25 25
26 26
Every browser action here has a REST equivalent under
27
`/api/v3/repos/:owner/:repo/issues`. See [REST API](/docs/rest-api).
27
`/api/v3/repos/:owner/:repo/issues`. See [REST API](/docs/rest-api), or use
28
[`openagents api`](/docs/cli-api) to work with issues from a terminal.
priv/docs/openagents-cli.md modified +9 -5

@@ -2,7 +2,8 @@

2 2
3 3
OpenAgents hosts Git repositories and serves them through Git smart HTTP. You
4 4
can create and import repositories in the browser or manage them from a
5
terminal with the OpenAgents CLI (`openagents`).
5
terminal with the OpenAgents CLI (`openagents`). The CLI can also call Issues,
6
Projects, and other implemented API routes.
6 7
7 8
## What you can do
8 9

@@ -15,10 +16,12 @@ The current release lets you:

15 16
- Clone repositories and configure Git authentication.
16 17
- Delete a repository you own with explicit confirmation.
17 18
- Push, pull, and fetch with standard Git.
19
- Call Issues, Projects, and other API routes with `openagents api`.
18 20
- Use JSON output and stable exit codes in scripts and agents.
19 21
20
The current release does not provide pull requests, continuous GitHub
21
mirroring, SSH transport, rulesets, or a self-update command.
22
The current release does not provide named `issue` or `project` commands, pull
23
requests, continuous GitHub mirroring, SSH transport, rulesets, or a
24
self-update command.
22 25
23 26
## Choose how to run the CLI
24 27

@@ -27,13 +30,13 @@ configure Git authentication that remains available after the current command:

27 30
28 31
```sh
29 32
npm install --global @openagentsinc/cli
30
openagents --version
33
openagents --help
31 34
```
32 35
33 36
Use `npx` for one command without a global installation:
34 37
35 38
```sh
36
npx --yes @openagentsinc/cli@latest --version
39
npx --yes @openagentsinc/cli@latest --help
37 40
npx --yes @openagentsinc/cli@latest repo list
38 41
```
39 42

@@ -121,4 +124,5 @@ After you sign in, open [Repositories](/repositories).

121 124
- [Import from GitHub](/docs/import-github)
122 125
- [Clone, push, and pull](/docs/clone-push-pull)
123 126
- [Delete a repository](/docs/delete-repository)
127
- [Call the API with the CLI](/docs/cli-api)
124 128
- [CLI command reference](/docs/cli-command-reference)
priv/docs/projects.md modified +2 -1

@@ -17,4 +17,5 @@ issue, so two boards can hold different views of the same work.

17 17
18 18
Projects are exposed under `/repos/:owner/:repo/projectsV2`. The repository in
19 19
the path controls visibility and write authority for every project, item, and
20
field operation. See [REST API](/docs/rest-api).
20
field operation. See [REST API](/docs/rest-api), or use
21
[`openagents api`](/docs/cli-api) to work with projects from a terminal.
priv/docs/rest-api.md modified +78 -32

@@ -1,36 +1,36 @@

1 1
# REST API
2 2
3
The API is shaped after GitHub's REST API and served under `/api/v3`. Check the
4
implemented paths and known differences before you point an existing client at
5
OpenAgents.
3
OpenAgents serves a bounded GitHub-shaped API under `/api/v3`. The paths make
4
familiar repository tooling easier to adapt, but OpenAgents does not implement
5
the complete GitHub API.
6 6
7
## Authentication
7
## Authenticate
8 8
9
Bearer token. See [API tokens](/docs/api-tokens).
9
API writes require an `oa_pat_` bearer token with `forge:write` scope. Create
10
and revoke tokens on [API tokens](/docs/api-tokens).
10 11
11
```
12
```sh
12 13
curl -H "Authorization: Bearer $OPENAGENTS_TOKEN" \
13 14
  https://openagents.com/api/v3/repos/OpenAgentsInc/openagents.com/issues
14 15
```
15 16
16
## Issues
17
Public repositories allow anonymous reads. The repository, issue, and project
18
base read routes also accept an optional bearer token so a member can read a
19
private repository. Ancillary comment, label, assignee, and milestone read
20
routes remain public-repository reads in the current subset.
17 21
18
```
19
GET    /api/v3/repos/:owner/:repo/issues
20
POST   /api/v3/repos/:owner/:repo/issues
21
GET    /api/v3/repos/:owner/:repo/issues/:issue_number
22
PATCH  /api/v3/repos/:owner/:repo/issues/:issue_number
23
```
22
Use [Call the API with the CLI](/docs/cli-api) when you want the CLI to select
23
the API origin, load your stored credential, and return JSON.
24 24
25 25
## Repositories
26 26
27 27
```text
28 28
GET    /api/v3/user
29 29
GET    /api/v3/user/repos
30
GET    /api/v3/repos/:owner/:repo
31
DELETE /api/v3/repos/:owner/:repo
32 30
POST   /api/v3/user/repos
33 31
POST   /api/v3/orgs/:org/repos
32
GET    /api/v3/repos/:owner/:repo
33
DELETE /api/v3/repos/:owner/:repo
34 34
POST   /api/v3/user/repos/imports
35 35
POST   /api/v3/orgs/:org/repos/imports
36 36
GET    /api/v3/repository-imports/:id

@@ -39,31 +39,67 @@ GET /api/v3/repository-imports/:id

39 39
Repository writes require an `Idempotency-Key` header. The published
40 40
[`openagents.repositories.v1` contract](/api/contracts/repositories-v1.json)
41 41
defines request authority, lifecycle states, pagination, and stable error
42
codes. The [OpenAgents CLI](/docs/openagents-cli) implements this contract.
43
Only a repository owner can delete it. A successful deletion returns
42
codes. Only a repository owner can delete it. A successful deletion returns
44 43
`204 No Content`.
45 44
46
## Comments
45
## Issues and comments
46
47
```text
48
GET    /api/v3/repos/:owner/:repo/issues
49
POST   /api/v3/repos/:owner/:repo/issues
50
GET    /api/v3/repos/:owner/:repo/issues/:issue_number
51
PUT    /api/v3/repos/:owner/:repo/issues/:issue_number
52
PATCH  /api/v3/repos/:owner/:repo/issues/:issue_number
47 53
48
```
49 54
GET    /api/v3/repos/:owner/:repo/issues/:issue_number/comments
50 55
POST   /api/v3/repos/:owner/:repo/issues/:issue_number/comments
51 56
GET    /api/v3/repos/:owner/:repo/issues/comments/:id
57
PUT    /api/v3/repos/:owner/:repo/issues/comments/:id
58
PATCH  /api/v3/repos/:owner/:repo/issues/comments/:id
59
DELETE /api/v3/repos/:owner/:repo/issues/comments/:id
52 60
```
53 61
54
## Labels, milestones, assignees
62
List responses use named envelopes. For example, the issue list returns an
63
object with an `issues` array.
55 64
56
```
65
## Labels
66
67
```text
57 68
GET    /api/v3/repos/:owner/:repo/labels
58 69
POST   /api/v3/repos/:owner/:repo/labels
59
GET    /api/v3/repos/:owner/:repo/milestones
70
GET    /api/v3/repos/:owner/:repo/labels/:name
71
PUT    /api/v3/repos/:owner/:repo/labels/:name
72
PATCH  /api/v3/repos/:owner/:repo/labels/:name
73
DELETE /api/v3/repos/:owner/:repo/labels/:name
74
60 75
GET    /api/v3/repos/:owner/:repo/issues/:issue_number/labels
76
POST   /api/v3/repos/:owner/:repo/issues/:issue_number/labels
77
DELETE /api/v3/repos/:owner/:repo/issues/:issue_number/labels/:name
78
```
79
80
Adding a label through the issue-label endpoint creates the label when it does
81
not exist. Creating an issue with an unknown label remains a validation error.
82
83
## Assignees and milestones
84
85
```text
86
GET    /api/v3/repos/:owner/:repo/assignees
87
GET    /api/v3/repos/:owner/:repo/assignees/:assignee
88
GET    /api/v3/repos/:owner/:repo/issues/:issue_number/assignees
61 89
POST   /api/v3/repos/:owner/:repo/issues/:issue_number/assignees
90
DELETE /api/v3/repos/:owner/:repo/issues/:issue_number/assignees
91
92
GET    /api/v3/repos/:owner/:repo/milestones
93
POST   /api/v3/repos/:owner/:repo/milestones
94
GET    /api/v3/repos/:owner/:repo/milestones/:milestone_number
95
PUT    /api/v3/repos/:owner/:repo/milestones/:milestone_number
96
PATCH  /api/v3/repos/:owner/:repo/milestones/:milestone_number
97
DELETE /api/v3/repos/:owner/:repo/milestones/:milestone_number
62 98
```
63 99
64 100
## Projects
65 101
66
```
102
```text
67 103
GET    /api/v3/repos/:owner/:repo/projectsV2
68 104
POST   /api/v3/repos/:owner/:repo/projectsV2
69 105
GET    /api/v3/repos/:owner/:repo/projectsV2/:project_number

@@ -74,17 +110,27 @@ GET /api/v3/repos/:owner/:repo/projectsV2/:project_number/fields

74 110
POST   /api/v3/repos/:owner/:repo/projectsV2/:project_number/fields
75 111
```
76 112
77
## Known differences from GitHub
113
The repository in the path controls visibility and write authority. Project
114
numbers are repository-local. Project creation through this REST path is an
115
OpenAgents extension; GitHub Projects V2 creation is not part of the assessed
116
GitHub REST surface.
78 117
79
These are gaps, not design decisions, and they are listed so a client author
80
finds them here rather than in production:
118
## Know the compatibility limits
81 119
82
- Renaming a label via `new_name` is accepted and ignored; the path name wins.
83
- Applying a label that does not exist returns 404. GitHub creates it.
84
- Removing a label an issue does not carry succeeds silently. GitHub returns 404.
85
- A non-numeric issue, milestone, or project number is a 500 rather than a 404.
120
- List responses use named envelopes such as `issues`, `comments`, `labels`,
121
  `milestones`, `assignees`, `projects`, `items`, and `fields`. GitHub commonly
122
  returns a bare array.
123
- Pagination, filters, link headers, and error envelopes form a bounded local
124
  contract. They do not provide complete Octokit or `gh` compatibility.
125
- Ancillary issue-resource reads do not yet use the optional-bearer pipeline
126
  for private repositories.
127
- A nonnumeric issue or milestone number can produce `500 Internal Server
128
  Error` instead of `404 Not Found`. Project number parsing fails closed with
129
  `404 Not Found`.
130
- Project update, archive, delete, item removal and ordering, field mutation,
131
  views, draft items, and organization projects are not implemented.
86 132
87
## What is not implemented
133
## Know what is not implemented
88 134
89 135
Pull requests, reviews, webhooks, releases, SSH Git transport, and Git LFS
90
object storage.
136
object storage are outside the current subset.

This page updates live while a promote is in flight · changelog