| title | Legacy: CLI Command Reference |
|---|---|
| slug | legacy/reference/cli-commands |
The opencodehub-cli (or och) is your primary tool for interacting with OpenCodeHub from the terminal.
npm install -g opencodehub-cli--help,-h: Show help for command.--version,-v: Show CLI version.--debug: Enable verbose debug output.
Manage authentication state.
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.
Check current login status and user.
Clear stored credentials.
Manage repositories.
Clone a repository.
- Example:
och clone swadhin/my-project - Behavior: Automatically sets up remote
origin.
Create a new repository.
- Flags:
--public: Make repository public.--private: Make repository private.--desc <text>: Description.
Push changes to the remote.
- Features: Shows a progress bar and PR link on success.
Manage Stacked Pull Requests.
Create a new branch stacked on top of the current one.
- Example:
och stack create feature-b(when onfeature-a).
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).
Rebase the entire stack.
- Use Case: When
mainhas updated or a lower PR changed.
Visualize the current stack in ASCII tree format.
Manage Pull Requests.
List open PRs for current repo.
Checkout a PR by its number.
Show CI status and review state of a PR.