Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 36 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
- **Your issues, offline.** Issues, comments, labels, milestones and READMEs are read from your computer, with no
request to GitHub and no cost to your rate limit.
- **Your repositories, your pick, and no code.** Sign in with a code on GitHub's page through WireCat App, installed
only on the repositories you pick. `gthb` never writes to GitHub and never copies your code or a diff.
only on the repositories you pick. `gthb` never copies your code or a diff, and writes to GitHub only what you
turned on, one kind of write at a time.

## What you get

Expand Down Expand Up @@ -107,8 +108,10 @@ gthb work mcp config # the entry for Claude Desktop,
gthb work config set permissions.api deny # keep the agent away from the live GitHub API
```

`gthb` only reads GitHub, so an agent over MCP can change nothing there. `--allow-writes` is there because the agent
can write to the copy on your computer, such as notes and tags.
Out of the box `gthb` only reads GitHub, so an agent over MCP can change nothing there. `--allow-writes` is there
because the agent can write to the copy on your computer, such as notes and tags. A write to GitHub that you turn on
([writing to GitHub](#writing-to-github)) at `ask` goes ahead over MCP without a question, so keep `deny` for what an
agent must not do.

More: [agents and MCP](https://github.com/WireCatLabs/github-cli/blob/main/docs/usage.md#agents)

Expand Down Expand Up @@ -198,8 +201,10 @@ More: [every command](https://github.com/WireCatLabs/github-cli/blob/main/docs/c
- **A local copy.** `sync` copies the chosen repositories into the WireCat local store, and later syncs read only what
changed. It sends at most 60 requests a minute, so your own tools keep a share of GitHub's limit;
`requests_per_minute` changes that ([usage](docs/usage.md)).
- **No writes.** No command writes to GitHub, and the `api` group offers read operations only, without those that
return code or secrets.
- **Writes only when you turn them on.** `issues create`, `issues update` (title, text, open or closed, labels,
assignee) and `issues comments create` are off until you allow each one ([writing to GitHub](#writing-to-github)).
No command merges or touches code, and the `api` group offers read operations only, without those that return code
or secrets.
- **Made for scripts.** `--json` prints one JSON value for every command, and an error comes as JSON with a code to
branch on.

Expand All @@ -214,9 +219,34 @@ gthb work config show # each setting and where it came

More: [settings](https://github.com/WireCatLabs/github-cli/blob/main/docs/configuration.md)

## Writing to GitHub

Every write is `deny` until you turn on its own key. A broader key such as `issues: allow` does not turn one on.

```sh
gthb work config set permissions.issues.comments.create ask # comment on an issue
gthb work config set permissions.issues.update ask # title, text, close and reopen, labels, assignee
gthb work config set permissions.issues.create ask # open a new issue
gthb work config set permissions.issues.assign-others ask # assign someone other than you
```

At `ask` a terminal asks before each write, and a run without a terminal needs `--yes`. Over MCP `ask` goes ahead, so
the agent app's own approval is the only question there. `--dry-run` shows what a write would change and sends nothing.

```sh
gthb work issues comments create octo-org/app#12 --text "Fixed in 1.4"
gthb work issues update octo-org/app#12 --status Closed # or "Closed as not planned", Open
gthb work issues update octo-org/app#12 --add-label bug --assignee octo-owner
gthb work issues create --team octo-org/app --title "Export fails for EUR" --label bug
```

The sign-in must be allowed to write issues: WireCat App asks for that, and a fine-grained token needs Issues:
Read and write. GitHub drops labels and assignees of a person without push or triage access; `gthb` then says what was
dropped. `--assignee` sets the one assignee and takes the others away.

## Security

The sign-in reaches only the repositories you pick, and `gthb` sends only read requests. `gthb` keeps it in the system
The sign-in reaches only the repositories you pick, and `gthb` sends only read requests unless you turn a write on. `gthb` keeps it in the system
keyring and never prints it. `session end` forgets it here; revoke the app at
[Authorized GitHub Apps](https://github.com/settings/apps/authorizations). Text from GitHub is marked as untrusted, so an agent reads an issue as data, not as an instruction. Commits in the
copy carry their authors' names and e-mail addresses, as GitHub shows them.
Expand Down
10 changes: 10 additions & 0 deletions changes/feat-issue-writes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Added

- **Writes to GitHub issues, off until you turn each one on.** `issues comments create`, `issues update` (title,
text, `--status Closed`, `"Closed as not planned"` or `Open`, `--add-label`, `--remove-label`, `--assignee`) and
`issues create` now reach GitHub. Each is `deny` until you set its own key, such as
`gthb work config set permissions.issues.comments.create ask`; a broader `issues: allow` does not turn one on. At
`ask` a terminal asks before each write and other runs need `--yes`; over MCP `ask` goes ahead, so keep `deny` for
what an agent must not do. `--dry-run` shows the change and sends nothing. GitHub's answer is stored at once, a label
or assignee GitHub drops for a sign-in without push access is reported, and a read-only token's 403 says it needs
Issues: Read and write. No merge and no code write.
40 changes: 40 additions & 0 deletions contracts/wirecat.json
Original file line number Diff line number Diff line change
Expand Up @@ -8593,6 +8593,46 @@
"permission": "issues.comments.list",
"entity": "tracker_comment"
},
{
"path": [
"issues",
"comments",
"create"
],
"summary": "add a comment to an issue in the tracker, then store it",
"effects": {
"remote": "write",
"local": "write"
},
"permission": "issues.comments.create",
"entity": "tracker_write"
},
{
"path": [
"issues",
"create"
],
"summary": "make an issue in the tracker, then store the tracker's copy of it",
"effects": {
"remote": "write",
"local": "write"
},
"permission": "issues.create",
"entity": "tracker_write"
},
{
"path": [
"issues",
"update"
],
"summary": "change an issue in the tracker; what is left out keeps its value; the…",
"effects": {
"remote": "write",
"local": "write"
},
"permission": "issues.update",
"entity": "tracker_write"
},
{
"path": [
"issues",
Expand Down
82 changes: 82 additions & 0 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -11334,6 +11334,88 @@ gthb issues comments list <issue> [query] [options]

**Example:** `gthb work issues comments list ENG-12`

#### `gthb issues comments create`

add a comment to an issue in the tracker, then store it

**Changes something in the service.**

```sh
gthb issues comments create <issue> [options]
```

| Argument | | What it is |
|---|---|---|
| `issue` | required | the issue's key (ENG-12), id or tracker: ref. |

| Option | What it does |
|---|---|
| `--text <text>` | the comment, as it is to read. |

**Returns:** tracker write — operation_id, untrusted, issue, comment, milestone; every field: gthb commands info issues comments create

**Example:** `gthb work issues comments create ENG-12 --text "Example: fixed in the next release"`

### `gthb issues create`

make an issue in the tracker, then store the tracker's copy of it

**Changes something in the service.**

```sh
gthb issues create [options]
```

| Option | What it does |
|---|---|
| `--title <title>` | the issue's title. |
| `--description <text>` | the issue's text; an empty value clears it. |
| `--team <team>` | the team, by its id, key or name; left out, the copy's only team. |
| `--assignee <user>` | the user, by id, name, handle or e-mail; empty for none; anyone but you checks issues.assign-others. |
| `--priority <n>` | critical or urgent (1), high (2), medium (3), low (4), none or empty (0), a 0.0–1.0 score or the old 0–4. |
| `--status <state>` | the workflow state, by its id or a name only one of the team's states has. |
| `--label <label>` | a label by its id or name; repeat it for each; replaces the issue's labels, and one empty value clears them. Default: ``. |
| `--project <project>` | the project, by its id, name or a part only it has; empty for none. |
| `--due <time>` | the day it is due: 2026-12-10, today or 3d from now; empty for none. |
| `--parent <id>` | the issue this one is part of, by its key or id; empty for none. |

**Returns:** tracker write — operation_id, untrusted, issue, comment, milestone; every field: gthb commands info issues create

**Example:** `gthb work issues create --title "Example: invoices fail for EUR" --team ENG --label Bug`, `gthb work issues create --title "Example: write the guide" --assignee ada@example.com --priority high --due 2026-12-10`

### `gthb issues update`

change an issue in the tracker; what is left out keeps its value; the tracker's copy is stored again

**Changes something in the service.**

```sh
gthb issues update <issue> [options]
```

| Argument | | What it is |
|---|---|---|
| `issue` | required | the issue's key (ENG-12), id or tracker: ref. |

| Option | What it does |
|---|---|
| `--title <title>` | the issue's title. |
| `--description <text>` | the issue's text; an empty value clears it. |
| `--team <team>` | the team, by its id, key or name; left out, the copy's only team. |
| `--assignee <user>` | the user, by id, name, handle or e-mail; empty for none; anyone but you checks issues.assign-others. |
| `--priority <n>` | critical or urgent (1), high (2), medium (3), low (4), none or empty (0), a 0.0–1.0 score or the old 0–4. |
| `--status <state>` | the workflow state, by its id or a name only one of the team's states has. |
| `--label <label>` | a label by its id or name; repeat it for each; replaces the issue's labels, and one empty value clears them. Default: ``. |
| `--project <project>` | the project, by its id, name or a part only it has; empty for none. |
| `--due <time>` | the day it is due: 2026-12-10, today or 3d from now; empty for none. |
| `--parent <id>` | the issue this one is part of, by its key or id; empty for none. |
| `--add-label <label>` | a label to add, keeping the others; repeat it for each. Default: ``. |
| `--remove-label <label>` | a label to take away; repeat it for each. Default: ``. |

**Returns:** tracker write — operation_id, untrusted, issue, comment, milestone; every field: gthb commands info issues update

**Example:** `gthb work issues update ENG-12 --status "In Progress"`, `gthb work issues update ENG-12 --add-label Bug --due 2026-12-10`

### `gthb issues context`

one issue with its newest comments, relations and what the copy lacks
Expand Down
8 changes: 5 additions & 3 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ gthb work config set permissions.api deny # no live GitHub API for
gthb work config set permissions.memories deny # no memories on the READMEs
```

`gthb` never writes to GitHub, so permissions here decide which reads an agent may make and what it may write to the
copy on your computer, such as notes and tags. Over MCP there is no one to ask, so `ask` lets the command run.
`GTHB_READ_ONLY=1` refuses every write to the copy, whatever the permissions say. `mcp serve --permission
Permissions decide which reads an agent may make, what it may write to the copy on your computer, such as notes and
tags, and which writes to GitHub run. Each write to GitHub is `deny` until you set its own key: `issues.create`,
`issues.update`, `issues.comments.create`, and `issues.assign-others` to assign someone other than you. A broader key,
such as `issues: allow`, does not lift that `deny`. Over MCP there is no one to ask, so `ask` lets the command run.
`GTHB_READ_ONLY=1` refuses every write to the copy and to GitHub, whatever the permissions say. `mcp serve --permission
api.list=deny` makes one key stricter for that server only.

## Variables
Expand Down
7 changes: 5 additions & 2 deletions docs/dev/API_COVERAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Run: pnpm generate

# API coverage

667 operations from openapi 1.1.4.
670 operations from openapi 1.1.4.

| Operation | Call | Command | Effect | Request source | Status | Summary |
|---|---|---|---|---|---|---|
Expand Down Expand Up @@ -465,16 +465,19 @@ Run: pnpm generate
| `repos/list-invitations` | `GET /repos/{owner}/{repo}/invitations` | `gthb <profile> api repos list-invitations` | read | — | generated | List repository invitations |
| `repos/list-issue-types` | `GET /repos/{owner}/{repo}/issue-types` | `gthb <profile> api repos list-issue-types` | read | — | generated | List issue types for a repository |
| `issues/list-for-repo` | `GET /repos/{owner}/{repo}/issues` | `gthb <profile> api issues list-for-repo` | read | — | generated | List repository issues |
| `issues/create` | `POST /repos/{owner}/{repo}/issues` | `gthb <profile> api issues create` | write | contract | generated | Create an issue |
| `issues/list-comments-for-repo` | `GET /repos/{owner}/{repo}/issues/comments` | `gthb <profile> api issues list-comments-for-repo` | read | — | generated | List issue comments for a repository |
| `issues/get-comment` | `GET /repos/{owner}/{repo}/issues/comments/{comment_id}` | `gthb <profile> api issues get-comment` | read | — | generated | Get an issue comment |
| `reactions/list-for-issue-comment` | `GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions` | `gthb <profile> api reactions list-for-issue-comment` | read | — | generated | List reactions for an issue comment |
| `issues/list-events-for-repo` | `GET /repos/{owner}/{repo}/issues/events` | `gthb <profile> api issues list-events-for-repo` | read | — | generated | List issue events for a repository |
| `issues/get-event` | `GET /repos/{owner}/{repo}/issues/events/{event_id}` | `gthb <profile> api issues get-event` | read | — | generated | Get an issue event |
| `issues/get` | `GET /repos/{owner}/{repo}/issues/{issue_number}` | `gthb <profile> api issues get` | read | — | generated | Get an issue |
| `issues/update` | `PATCH /repos/{owner}/{repo}/issues/{issue_number}` | `gthb <profile> api issues update` | write | contract | generated | Update an issue |
| `issues/list-issue-artifacts` | `GET /repos/{owner}/{repo}/issues/{issue_number}/artifacts` | `gthb <profile> api issues list-issue-artifacts` | read | — | generated | List issue artifacts |
| `issues/get-issue-artifact` | `GET /repos/{owner}/{repo}/issues/{issue_number}/artifacts/{artifact_number}` | `gthb <profile> api issues get-issue-artifact` | read | — | generated | Get an issue artifact |
| `issues/check-user-can-be-assigned-to-issue` | `GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}` | `gthb <profile> api issues check-user-can-be-assigned-to-issue` | read | — | generated | Check if a user can be assigned to a issue |
| `issues/list-comments` | `GET /repos/{owner}/{repo}/issues/{issue_number}/comments` | `gthb <profile> api issues list-comments` | read | — | generated | List issue comments |
| `issues/create-comment` | `POST /repos/{owner}/{repo}/issues/{issue_number}/comments` | `gthb <profile> api issues create-comment` | write | contract | generated | Create an issue comment |
| `issues/list-dependencies-blocked-by` | `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by` | `gthb <profile> api issues list-dependencies-blocked-by` | read | — | generated | List dependencies an issue is blocked by |
| `issues/list-dependencies-blocking` | `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking` | `gthb <profile> api issues list-dependencies-blocking` | read | — | generated | List dependencies an issue is blocking |
| `issues/list-events` | `GET /repos/{owner}/{repo}/issues/{issue_number}/events` | `gthb <profile> api issues list-events` | read | — | generated | List issue events |
Expand Down Expand Up @@ -768,4 +771,4 @@ Not from the source: GitHub's description names no sign-in; every call sends the

## Spec corrections

- left out 614 operations that write: the CLI is read-only
- left out 611 operations that write: the CLI sends only the issue writes of src/github/writer.ts
Loading
Loading