ghget

command
v0.188.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2026 License: BSD-3-Clause Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command ghget is the fleet's read-only GitHub REST client: it replaces `gh api` for GET requests, with the right token.

`gh` uses its own login, which lacks scopes the fleet's token file has (admin:org): `gh api orgs/<org>/actions/permissions/fork-pr-contributor-approval` answered 403 in four organisations while ~/.github-token could read it.

It can only send GET: the method is a constant in one place, there is no flag that sets a method or a body, and the path is refused if it is not a relative API path. The token comes from a 0600 file (default ~/.github-token), goes only in the Authorization header, and is redacted from anything printed. https only (http for 127.0.0.1 test servers); redirects are refused, so the token never follows a Location elsewhere.

Exit status separates an answer from the absence of one:

0  answer read (JSON on stdout)
3  404: the thing is absent
4  401/403: UNREAD, not empty; the missing scope is printed
5  rate limited; the reset time is printed
2  usage or any other failure
6  redirect refused (default mode), 3xx without Location, or leaving https
7  more than --max-hops redirects (download mode)
8  body over --max-bytes (download mode)
9  --output exists and --force was not given

Download mode (--output) follows redirects with the Authorization header dropped, https only; see the help text.

References (read 2026-11-28):

https://docs.github.com/en/rest/using-the-rest-api/using-pagination-in-the-rest-api   (Link header, rel="next")
https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api       (x-ratelimit-remaining/reset, retry-after, 403/429)
https://docs.github.com/rest/actions/permissions#get-fork-pr-contributor-approval-permissions-for-an-organization

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL