Skip to content

CLI

The codebahn CLI manages your repositories, pull requests, issues, and CI from the terminal. One binary, OAuth login, auto-updates.

Source: github.com/codebahn/codebahn-cli

Terminal window
curl -fsSL https://releases.codebahn.net/cli/install.sh | sh

This detects your platform, downloads the latest binary, verifies its SHA256 checksum, and installs to ~/.local/bin. Override the location with INSTALL_DIR:

Terminal window
curl -fsSL https://releases.codebahn.net/cli/install.sh | INSTALL_DIR=/usr/local/bin sh

Or install from source (source builds skip auto-update):

Terminal window
go install github.com/codebahn/codebahn-cli/cmd/codebahn@latest

Builds are available for Linux and macOS on amd64 and arm64.

The CLI checks for new versions once every 24 hours and prints a notice when one is available.

Terminal window
codebahn update

This downloads the new binary from releases.codebahn.net, verifies its GPG signature and SHA256 checksum, and replaces itself.

To check without installing: codebahn update --check. To silence the periodic check: set CODEBAHN_NO_UPDATE_CHECK=1.

Terminal window
codebahn auth login

This opens your browser for OAuth authorization. After you approve, the CLI saves your tokens to ~/.config/codebahn/config.json (it honors XDG_CONFIG_HOME). Tokens refresh automatically. Check the connection with codebahn auth status.

For CI or other headless environments, pass --token or set CODEBAHN_TOKEN. Create a token under Settings > Applications in your Codebahn account.

When you run inside a Git repo, --owner and --repo are detected from the remote. Add --json for machine-readable output and --no-color to turn off colored output. Every subcommand accepts --help.

CommandDescription
user infoShow current user info
CommandDescription
repo listList your repositories
repo createCreate a repository
repo catRead file content
repo lsList directory contents
repo treeShow the file tree
repo logList commits
repo branchesList branches
repo create-branchCreate a branch
repo delete-branchDelete a branch
repo create-fileCreate a file via commit
repo update-fileUpdate a file via commit
repo delete-fileDelete a file via commit
repo mirrorMirror a repo or org from GitHub/GitLab
repo importOne-time import from GitHub/GitLab
repo list-remotePreview repos available via the GitHub App
CommandDescription
pr listList pull requests
pr getShow a pull request
pr createOpen a pull request
pr updateUpdate title, body, base, or assignees
pr mergeMerge a pull request
pr diffPrint the unified diff
pr filesList changed files
pr reviewsList reviews
pr get-reviewShow a specific review
pr review-commentsList comments on a review
pr create-reviewCreate a review with inline comments
pr submit-reviewSubmit a pending review
pr dismiss-reviewDismiss a review
pr delete-reviewDelete a pending review
pr request-reviewRequest reviews from users or teams
pr cancel-reviewCancel pending review requests
CommandDescription
issue listList issues
issue getShow an issue
issue createOpen an issue
issue updateUpdate title, body, assignees, or milestone
issue stateOpen or close an issue
issue commentComment on an issue
issue commentsList comments
issue get-commentShow a comment
issue edit-commentEdit a comment
issue delete-commentDelete a comment
issue labelsList labels
issue add-labelsAdd labels to an issue
issue remove-labelsRemove labels from an issue
issue create-labelCreate a label
issue edit-labelEdit a label
issue delete-labelDelete a label
issue milestonesList milestones
CommandDescription
ci listList workflow runs
ci getShow a workflow run
ci logsPrint build logs (filterable by job)
ci dispatchTrigger a workflow
ci cancelCancel a running build
CommandDescription
search allSearch across code, repos, issues, and users
search codeSearch code (with language and filename filters)
search reposSearch repositories
Terminal window
codebahn pr merge --index 42 --style squash
codebahn repo cat --ref main --filePath README.md
codebahn ci logs --run_id 7 --job build
codebahn repo mirror github.com/acme/backend --owner my-org
codebahn repo import github.com/acme --owner my-org -y
codebahn repo list-remote github.com/acme

The CLI can mirror or import repositories from GitHub and GitLab, including bulk operations on entire organizations.

List remote previews which repos are accessible via the Codebahn GitHub App before you import or mirror:

Terminal window
codebahn repo list-remote github.com/acme

Use --include and --exclude with glob patterns to filter. Add --json for machine-readable output.

Mirror creates a pull mirror that stays in sync with the source:

Terminal window
# Single repo
codebahn repo mirror github.com/acme/backend
# Entire org
codebahn repo mirror github.com/acme --owner my-org --source-token $GITHUB_TOKEN -y

Import copies code, issues, PRs, labels, milestones, and releases as a one-time migration:

Terminal window
# Single repo
codebahn repo import github.com/acme/backend
# Entire org, skip wiki
codebahn repo import github.com/acme --owner my-org --source-token $GITHUB_TOKEN --no-wiki -y

For private repos and org-level operations, pass --source-token or set GITHUB_TOKEN. Use --include and --exclude with glob patterns to select repos from an org.

See also: Migrate from GitHub, Migrate from GitLab, Migrate from Forgejo, Mirror GitHub repos.