GitHub CLI
Open pull requests, triage issues, cut releases, spin up new repositories - the
whole GitHub workflow from inside your container, without switching to the
browser. That’s the GitHub CLI (gh), and it’s what a coding agent reaches for to
open a PR the moment its work is done.
git already moves your code in and out - clone, commit, push (see
Git and repositories). gh covers everything
around the repo on GitHub’s side. It’s a plain command-line tool, not an AI agent,
and once you authenticate it the login persists across container rebuilds.
Added automatically with a GitHub repo
Section titled “Added automatically with a GitHub repo”You usually don’t add this feature by hand. Configure a GitHub repo - with
monoceros init --with-repos=… or
monoceros add-repo - and Monoceros adds the
GitHub CLI for you, authenticated from the same token as the repo.
Add it explicitly only when a container has no GitHub repo but you still want
gh - for instance to spin up and push a brand-new project (see
Start a new project).
Add it
Section titled “Add it”At init, when you create the container:
monoceros init acme --with-features=githubOr later, on an existing one:
monoceros add-feature acme githubRemove it
Section titled “Remove it”monoceros remove-feature acme githubOr delete the feature’s entry from acme.yml by hand and re-run
monoceros apply acme - the yml is the source of truth.
Authentication
Section titled “Authentication”gh signs in with the same access token as your GitHub repos, so if you’ve set
that up there’s nothing more to do here.
Git and repositories shows how to create the
token and where to put it.
Prefer to log in by hand? Leave the token unset and run gh auth login on first
start - either way the login sticks across container rebuilds.
Options
Section titled “Options”| Option | Default | Description |
|---|---|---|
apiToken | (empty) | GitHub PAT - see Git and repositories for scopes. Empty for gh auth login. |
features: - ref: ghcr.io/getmonoceros/monoceros-features/github-cli:1 options: apiToken: ${GITHUB_API_TOKEN}What you get
Section titled “What you get”The gh command on PATH, ready in any
monoceros shell or via
monoceros run. With a token set it’s
authenticated in every shell; otherwise log in once and it persists across
rebuilds.
Because it’s just gh on PATH, the AI coding tools in the container reach for
it too - ask Claude Code to open a PR or check why CI
failed, and it shells out to gh on your behalf.