Commit graph

4 commits

Author SHA1 Message Date
Stephen Way fbf1354367
fix: pager via libc::dup2, harden pre-push hook stdin handling
* New `output::pager` module spawns `$FJ_PAGER` / `$PAGER` / `less -FRX`
  when stdout is a TTY and dup2's our stdout onto its stdin. The
  `PagerGuard` restores the original stdout and waits on the child on
  drop so all output flushes before exit.
* Wired into the top-level dispatch: list/view/diff/api/search/status
  output is now paged automatically. Short output passes through via
  `less -F`. Global `--no-pager` flag and `FJ_NO_PAGER` env opt out.
* libc 0.2 added as a small dep (needed for dup/dup2/close).
* Pre-push hook now drains and closes stdin at the top, then runs every
  step with `</dev/null`. Previously a test or build could in principle
  inherit git push's stdin (the list of refs being pushed) and block
  if it ever tried to read it. Adds CARGO_TERM_PROGRESS_WHEN=never so
  the progress bar doesn't muddle non-TTY runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 08:53:13 -07:00
Stephen Way 35d88bb370
expand: auth token/refresh/setup-git, protect, hook, --debug, man pages
* `fj auth token` prints the stored token for scripting.
* `fj auth refresh` re-verifies (or replaces) the stored token.
* `fj auth setup-git` installs a git credential helper that delegates
  password lookup to `fj auth token`.
* New top-level `fj protect` group: list / view / set / delete branch
  protection rules.
* New top-level `fj hook` group: webhook CRUD + test delivery.
* Global `--debug` (`FJ_DEBUG`) flag dumps every HTTP request fj makes
  to stderr (method, URL, query, body preview, status).
* `fj man -o ./man` generates `clap_mangen` pages for fj and every
  subcommand. Useful for downstream packaging.
* Fixed: several subcommand groups (hook, label, search, key, workflow
  secrets/variables) were showing the flattened RepoFlag's doc string
  in their --help summary line. Added explicit doc comments per variant.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 08:34:01 -07:00
Stephen Way de49c33921
batch: release, label, workflow, search, browse, status, org, keys, alias, config, extension, gist
* New top-level groups, each with full CRUD where the API supports it:
  - release: list/view/create/edit/delete/upload/download
  - label: list/create/edit/delete
  - run: workflow runs (list/view/rerun/cancel)
  - secret + variable: Actions secrets/vars (list/set/delete)
  - search: cross-cutting (repos/issues/prs/users)
  - browse: open repo/path on the web
  - status: notifications inbox + mark-all-read
  - org: list/view/teams
  - ssh-key, gpg-key: list/add/delete on your account
  - alias: user-defined shortcuts (e.g. `fj alias set co "pr checkout"`)
  - config: local prefs (editor, pager, browser, etc.)
  - extension: discover and run `fj-<name>` plugin binaries on PATH
  - gist: thin wrapper over `gist-*` repos
* main.rs now expands aliases before clap and dispatches to plugins for
  unknown subcommands (matching gh).
* New API modules: release, label, notification, search, org, workflow,
  with the corresponding strongly-typed wrappers.
* Release asset upload uses reqwest multipart (feature flag added).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 08:29:31 -07:00
Stephen Way 495276f654
initial: fj, a CLI for Forgejo
Multi-host auth (tokens in OS keychain), repo/issue/pr CRUD, and a
gh-style `api` escape hatch with -f/-F/-X/-q. Targets Forgejo 7.x via
the Gitea-compatible /api/v1 surface.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 07:56:28 -07:00