feature: issue show/comment and machine-readable --json output #10

Closed
opened 2026-07-23 00:12:47 +00:00 by claude-lead-andresmgsl · 0 comments

Problem

The project goal (README) is that every real Forgejo operation becomes a CLI command. Gaps that hurt scripting and day-to-day use:

Missing issue commands

Available Missing
stoke issue list stoke issue show
stoke issue create stoke issue comment

PR side already has pr show / pr comment / pr review. Issues cannot be inspected or commented without falling back to curl/API.

No stable machine output

All commands print human-oriented text. Automation (watchers, CI, shell pipelines) must scrape strings. There is no global or per-command --json flag.

Proposed fix

  1. Add stoke issue show -o -r -nGET /repos/{o}/{r}/issues/{n}.
  2. Add stoke issue comment -o -r -n -b/--body-filePOST .../issues/{n}/comments (reuse body validation from pr comment).
  3. Add optional --json on read commands (issue list/show, pr list/show, repo list, auth status, …) that emits the raw API objects (or a small stable schema) on stdout.

Acceptance

  • Can show and comment on an issue without curl.
  • stoke pr show … --json (or equivalent) is parseable by jq.
  • Tests cover validation and endpoint wiring (same style as existing test/cli.test.js / test/api.test.js).

Audit note

Product gap from full audit of stoke @ 92a6741. Not a security blocker; high value for heavy-duty automation.

## Problem The project goal (README) is that every real Forgejo operation becomes a CLI command. Gaps that hurt scripting and day-to-day use: ### Missing issue commands | Available | Missing | |-----------|---------| | `stoke issue list` | `stoke issue show` | | `stoke issue create` | `stoke issue comment` | PR side already has `pr show` / `pr comment` / `pr review`. Issues cannot be inspected or commented without falling back to curl/API. ### No stable machine output All commands print human-oriented text. Automation (watchers, CI, shell pipelines) must scrape strings. There is no global or per-command `--json` flag. ## Proposed fix 1. Add `stoke issue show -o -r -n` → `GET /repos/{o}/{r}/issues/{n}`. 2. Add `stoke issue comment -o -r -n -b/--body-file` → `POST .../issues/{n}/comments` (reuse body validation from `pr comment`). 3. Add optional `--json` on read commands (`issue list/show`, `pr list/show`, `repo list`, `auth status`, …) that emits the raw API objects (or a small stable schema) on stdout. ## Acceptance - Can show and comment on an issue without curl. - `stoke pr show … --json` (or equivalent) is parseable by `jq`. - Tests cover validation and endpoint wiring (same style as existing `test/cli.test.js` / `test/api.test.js`). ## Audit note Product gap from full audit of stoke @ `92a6741`. Not a security blocker; high value for heavy-duty automation.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: heavy-duty/stoke#10
No description provided.