orahub-cli
v0.1.2
Published
Orahub CLI - command-line client for Orahub image AI workflows
Readme
orahub-cli
orahub is the command-line client for Orahub image workflows.
Requirements
- Node.js 18 or later
Installation
The published npm package name is orahub-cli.
After installation, the command is still orahub.
npm install -g orahub-cliQuick Start
Sign in from the browser and save a fresh AK/SK locally:
orahub auth device-loginIf the automatic flow does not complete, switch to the manual fallback when:
- the browser does not open automatically
- device login times out
- the web page finishes login but the CLI still does not receive credentials
- you already have an assigned AK/SK pair from Console or ops
Manual fallback:
orahub config set --access-key <your-access-key> --secret-key <your-secret-key>Or provide them through environment variables:
export ORAHUB_CLI_ACCESS_KEY=<your-access-key>
export ORAHUB_CLI_SECRET_KEY=<your-secret-key>Remove passersby and print the result URL:
orahub photo-passersby-removal --input https://example.com/demo.jpgRemove passersby from a local file:
orahub photo-passersby-removal --input ./demo.jpgRun AI color match:
orahub photo-color-match \
--input https://example.com/demo.jpg \
--color-ref https://cdn.example.com/ref.jpgRun AI color match with a local reference image:
orahub photo-color-match \
--input https://example.com/demo.jpg \
--color-ref ./ref.jpgRun photo background replace:
orahub photo-background-replace \
--input https://example.com/demo.jpg \
--background-ref-url ./background.jpgRun photo remove background:
orahub photo-remove-background --input https://example.com/demo.jpgSave a result to a local file only when you need it:
orahub photo-remove-background --input https://example.com/demo.jpg --output ./result.pngVerify the current credential and endpoint combination:
orahub auth verify --jsonWait for an existing task and optionally download all generated artifacts:
orahub task wait <task-id> --download-dir ./artifacts --jsonCommon Commands
orahub auth device-login [--timeout-ms <ms>] [--no-open] [--json]orahub config set --access-key <ak> --secret-key <sk> [--json]orahub auth verify [--json]orahub task wait <task-id> [--interval-ms <ms>] [--timeout-ms <ms>] [--download-dir <dir>] [--json]orahub photo-color-match --input <file-or-url> --color-ref <file-or-url> [--output <file>] [--timeout-ms <ms>] [--json]orahub photo-background-replace --input <file-or-url> --background-ref-url <file-or-url> [--output <file>] [--timeout-ms <ms>] [--json]orahub photo-remove-background --input <file-or-url> [--output <file>] [--timeout-ms <ms>] [--json]orahub photo-passersby-removal --input <file-or-url> [--output <file>] [--timeout-ms <ms>] [--json]
JSON Output And Exit Codes
- Public commands support
--jsonfor machine-readable output. - Exit code
0: success - Exit code
1: usage error or unknown command - Exit code
2: local configuration error - Exit code
3: authentication failed - Exit code
4: request or network failure - Exit code
5: task finished with failure - Exit code
6: task wait timeout
Behavior Notes
- Release builds embed the public Orahub API endpoint. End users do not need to configure an endpoint manually.
orahub auth device-loginis the recommended way to get a fresh AK/SK and save it to~/.orahub/config.json.ORAHUB_CLI_ACCESS_KEYandORAHUB_CLI_SECRET_KEYoverride locally saved credentials when both are set.--inputis the standard user-facing input flag and automatically detects whether the value is a local file path or anhttp/httpsimage URL.- Effect commands print the result URL by default; add
--output <file>only when you want to save the artifact locally. photo-color-matchrequires--color-refand accepts either a local file path or anhttp/httpsimage URL.photo-background-replacerequires--background-ref-urland accepts either a local file path or anhttp/httpsimage URL.
