docs(#2671): trim hive-forge top-level + global-option help

Drop implementation mechanics from the `--help` surface, keep only
what a user needs to run the command:

- global `-r`/`-f`/`--json`: remove token-file paths, the bash-helper
  history, and the "already-JSON verbs ignore --json" aside.
- verb `about` strings (repo-create/repo-labels/repo-search/artifact-get/
  ci-log/ci-rerun/pr-commits): drop which-API / "no REST endpoint" /
  web-route / workflow-dispatch internals and cross-refs.

Per-verb arg help (verbs/*.rs) trimmed in follow-up commits.
This commit is contained in:
atlas 2026-07-23 21:52:33 +02:00
commit c64136d094

View file

@ -36,24 +36,17 @@ use clap::{Parser, Subcommand};
disable_help_subcommand = true disable_help_subcommand = true
)] )]
struct Cli { struct Cli {
/// Repo override (default from `HIVE_FORGE_REPO`). /// Repo to act on, as `owner/name` (default: `HIVE_FORGE_REPO`).
/// Applies to any verb; replaces the per-verb `[repo]` trailing /// Works with any verb.
/// positional the bash helper used.
#[arg(short = 'r', long, global = true)] #[arg(short = 'r', long, global = true)]
repo: Option<String>, repo: Option<String>,
/// Target an external forge account provisioned via the dashboard's /// Act as a dashboard-provisioned external forge account (by its
/// FORGES tab, by label, instead of the internal forge. Reads /// FORGES-tab label) instead of the internal forge. Independent of
/// `${HYPERHIVE_STATE_DIR}/forge-<label>-token` for the token and /// `-r/--repo`.
/// `forge-<label>.json` for the base URL (the same two files the
/// dashboard writes) instead of `HIVE_FORGE_URL`/`forge-token`.
/// Orthogonal to `-r/--repo`, which still just picks which repo on
/// whichever forge is selected.
#[arg(short = 'f', long, global = true)] #[arg(short = 'f', long, global = true)]
forge: Option<String>, forge: Option<String>,
/// Emit JSON output instead of the verb's default human-readable /// Emit JSON instead of the default human-readable output (for verbs
/// shape, for verbs that support both. Verbs whose /// that support both).
/// only output is already JSON (`issue`, `pr`, etc.) ignore this
/// flag — they always print JSON regardless.
#[arg(long, global = true)] #[arg(long, global = true)]
json: bool, json: bool,
#[command(subcommand)] #[command(subcommand)]
@ -80,8 +73,6 @@ enum Verb {
/// PR-scoped commands: `pr <show|status|create|merge|reviews|assign-reviewer|commits|diff|view|comment|comments|close|reopen|labels|assign-committer|timeline> …`. /// PR-scoped commands: `pr <show|status|create|merge|reviews|assign-reviewer|commits|diff|view|comment|comments|close|reopen|labels|assign-committer|timeline> …`.
Pr(verbs::pr_cmd::Args), Pr(verbs::pr_cmd::Args),
/// List a PR's commits as JSON (sha, message, author date, author). /// List a PR's commits as JSON (sha, message, author date, author).
/// Survives rebase-rewritten shas — message + author date let a
/// caller match the rows against linear `main` history.
#[command(hide = true)] #[command(hide = true)]
PrCommits(verbs::pr_commits::Args), PrCommits(verbs::pr_commits::Args),
/// Create a pull request. Prints the PR URL on success. /// Create a pull request. Prints the PR URL on success.
@ -115,21 +106,15 @@ enum Verb {
/// credentials auto-injected. Pairs with `pr-create --agit`. /// credentials auto-injected. Pairs with `pr-create --agit`.
Clone(verbs::clone::Args), Clone(verbs::clone::Args),
/// Create a forge repo under the current user (or `--org`). Prints /// Create a forge repo under the current user (or `--org`). Prints
/// the repo URL. The instance disables push-to-create, so this is /// the repo URL.
/// the supported path to a new repo. Pairs with `repo-add-collaborator`.
RepoCreate(verbs::repo_create::Args), RepoCreate(verbs::repo_create::Args),
/// Add a collaborator to the active repo (`-r`/`HIVE_FORGE_REPO`) /// Add a collaborator to the active repo (`-r`/`HIVE_FORGE_REPO`)
/// with a permission level. Companion to `repo-create`. /// with a permission level. Companion to `repo-create`.
RepoAddCollaborator(verbs::repo_add_collaborator::Args), RepoAddCollaborator(verbs::repo_add_collaborator::Args),
/// List the active repo's full label set (project-wide), optionally /// List every label defined on the repo (name + description),
/// filtered by a name substring. Unlike `labels <number>` (which lists /// optionally filtered by a name substring.
/// an issue/PR's labels), this shows every label defined on the repo —
/// the valid names + descriptions for triage / labelling. `--json`
/// emits the full label objects (id, name, color, description).
RepoLabels(verbs::repo_labels::Args), RepoLabels(verbs::repo_labels::Args),
/// Search for repositories on the forge instance by keyword, topic, or /// Search the forge for repositories by keyword, topic, or description.
/// description. Not repo-scoped — queries the instance-wide explore
/// endpoint. `--json` emits the full repository objects.
RepoSearch(verbs::repo_search::Args), RepoSearch(verbs::repo_search::Args),
/// Triage lint queries (unassigned / no-reviewer / stale-branches / assignments). /// Triage lint queries (unassigned / no-reviewer / stale-branches / assignments).
Lint(verbs::lint::Args), Lint(verbs::lint::Args),
@ -178,18 +163,13 @@ enum Verb {
/// prints the path (pass `-o -` to stream raw bytes to stdout). /// prints the path (pass `-o -` to stream raw bytes to stdout).
AttachmentGet(verbs::attachment_get::Args), AttachmentGet(verbs::attachment_get::Args),
/// Download a CI Actions artifact from a run (`<name> --run <n>`). /// Download a CI Actions artifact from a run (`<name> --run <n>`).
/// Forgejo serves artifacts only via the web route, not REST; the /// Saves a zip, or pass `-o -` to stream to stdout.
/// caller supplies the run number + artifact name. Saves a zip
/// (or `-o -` to stream).
ArtifactGet(verbs::artifact_get::Args), ArtifactGet(verbs::artifact_get::Args),
/// Print a CI Actions run's job step logs (`--run <n> [--job i] /// Print a CI Actions run's job step logs
/// [--step i]`). Uses Forgejo's web run-view streamer (no REST /// (`--run <n> [--job i] [--step i]`).
/// endpoint exists); reliable for live + recently-finished runs.
CiLog(verbs::ci_log::Args), CiLog(verbs::ci_log::Args),
/// Re-run CI without an empty commit: dispatches a fresh run via the /// Re-run CI without an empty commit. Pass one of `--pr <n>`,
/// workflow-dispatch API. Pass one of `--pr <n>` (the PR head branch), /// `--run <n>`, or `--branch <name>`; `--workflow` defaults to `ci.yml`.
/// `--run <n>` (branch + workflow resolved from that run), or
/// `--branch <name>`; `--workflow <file>` defaults to `ci.yml`.
CiRerun(verbs::ci_rerun::Args), CiRerun(verbs::ci_rerun::Args),
} }