CLI Command Reference
The opencodehub-cli (or och) is your primary tool for interacting with OpenCodeHub from the terminal.
Installation
Section titled “Installation”npm install -g opencodehub-cliGlobal Flags
Section titled “Global Flags”--help,-h: Show help for command.--version,-v: Show CLI version.--debug: Enable verbose debug output.
🔐 Auth
Section titled “🔐 Auth”Manage authentication state.
och auth login
Section titled “och auth login”Authenticates with an OpenCodeHub instance.
- Interactive Mode: Prompts for URL and credentials.
- Flags:
--url <url>: OCH instance URL.--token <token>: Bypass browser login with existing token.
och auth status
Section titled “och auth status”Check current login status and user.
och auth logout
Section titled “och auth logout”Clear stored credentials.
📦 Repo
Section titled “📦 Repo”Manage repositories.
och clone <repo>
Section titled “och clone <repo>”Clone a repository.
- Example:
och clone swadhin/my-project - Behavior: Automatically sets up remote
origin.
och create [name]
Section titled “och create [name]”Create a new repository.
- Flags:
--public: Make repository public.--private: Make repository private.--desc <text>: Description.
och push
Section titled “och push”Push changes to the remote.
- Features: Shows a progress bar and PR link on success.
📚 Stack
Section titled “📚 Stack”Manage Stacked Pull Requests.
och stack create <branch-name>
Section titled “och stack create <branch-name>”Create a new branch stacked on top of the current one.
- Example:
och stack create feature-b(when onfeature-a).
och stack submit
Section titled “och stack submit”Submit all branches in the current stack as Pull Requests.
- Behavior:
- Pushes all branches.
- Creates/Updates PRs.
- Sets correct base branches (
feature-a->main,feature-b->feature-a).
och stack sync
Section titled “och stack sync”Rebase the entire stack.
- Use Case: When
mainhas updated or a lower PR changed.
och stack view
Section titled “och stack view”Visualize the current stack in ASCII tree format.
Manage Pull Requests.
och pr list
Section titled “och pr list”List open PRs for current repo.
och pr checkout <number>
Section titled “och pr checkout <number>”Checkout a PR by its number.
och pr view <number>
Section titled “och pr view <number>”Show details for a PR including state and branches.