OXYGENHUB
# e9bfea8e26db oxygenhub / docs / oh.md
2.7 KiB · Markdown · last changed oh: OxygenHub from the command line 1 month ago renderedsource blame history raw

oh: OxygenHub from the command line

oh is to OxygenHub what gh is to GitHub. It talks to the hub's JSON API (hub spec §12) and prints what it gets back: in colour on a terminal, as plain text with --plain or NO_COLOR, and as the API's own JSON with --json.

Which hub, which repository, which token

Inside an Oxygen checkout, oh uses the checkout's remote:

  • Remote: origin, or the only remote, or --remote NAME.
  • Hub and repository: from the remote's URL (https://hub/OWNER/NAME).
  • Token and CA: the ones oxy pushes with (remote.NAME.token, remote.NAME.ca).

So in a checkout that pushes to the hub, oh needs no setup.

Elsewhere, sign in once and name the repository:

oh auth login --with-hub https://earth.andymccall.xyz:7343 --ca ~/.config/oxy/earth-ca.pem
oh issue list --repo andymccall/oxygen

oh auth login checks the token, saves it with the CA in ~/.config/oh/config.toml (owner-only), and makes that hub the default. It reads the token from stdin unless --token is given. OH_TOKEN (or OXY_TOKEN), OH_HUB and OXY_CA override the saved values.

Commands

CommandWhat it does
oh auth login, oh auth statusSave a token; show who you are
oh repo viewName, description, visibility, default bookmark, clone command
oh issue list [--state open|closed|all]Issues
oh issue view NAn issue with its comments
oh issue create -t TITLE [-b BODY | -F FILE] [-l LABEL]…Open an issue
oh issue close N [--reason not_planned], oh issue reopen NClose or reopen
oh issue comment N -b BODYComment
oh proposal list, oh proposal view NProposals, with changes, approvals and blockers
oh proposal create -t TITLE --from BOOKMARK [--into BOOKMARK] [--draft]Propose a bookmark's changes
oh proposal checks NChecks on the projected state
oh run list, oh run view NOxygenFlow runs and their jobs
oh run start [--bookmark B | --change HASH] [--watch]Run the pipeline without a push
oh run watch NFollow a run; exit 0 if it passes, 1 if not
oh run log N JOBA job's log
oh run rerun NRun a finished run's state again
oh release list, oh release create TAG [-t TITLE] [-n NOTES]Releases
oh release upload TAG FILE…Attach assets
oh release trust TAGThe release's trust audit; exit 1 on a failure
oh api PATH [-X METHOD] [-d JSON]Any API call, JSON out

Exit codes: 0 on success, 1 when a watched run or an audit fails, 2 on an error.

Not yet

  • Landing a proposal needs an API route, which comes next.
  • Also still to come: reviews, labels and milestones as commands, runner management (oxygenhub#41), and shell completions.