@openwonder/ow
v0.2.2
Published
Open Wonder CLI
Readme
Open Wonder CLI (Draft)
This package contains the first in-repo draft of the Open Wonder CLI using oclif.
Command Contract (Agent-Oriented)
- Use
--jsonfor machine-readable output. - Success responses are emitted to stdout as JSON.
- Error payloads are emitted to stderr as JSON.
- Exit codes:
0success2validation errors3auth errors4not found5rate-limited1other API/internal errors
Context Model
The CLI supports brand-scoped abstraction on top of API endpoints.
Brand resolution order for brand-scoped commands:
--brand-idOPEN_WONDER_BRAND_ID- saved context via
ow context:set --brand-id ...
Commands (Draft)
ow auth:token:set --token <token> [--base-url <url>] [--json]ow context:set [--brand-id <id>] [--base-url <url>] [--json]ow context:get [--json]ow brands:list [--base-url <url>] [--json]ow brand:info [--brand-id <id>] [--base-url <url>] [--json]ow visual-styles:list [--brand-id <id>] [--type USER|DEMO] [--json]ow assets:list [--brand-id <id>] [--style <style>] [--json]ow assets:get --asset-id <id> [--brand-id <id>] [--json]ow jobs:status --job-id <id> [--brand-id <id>] [--wait] [--json]ow permissions:get [--brand-id <id>] [--org-id <id>] [--base-url <url>] [--json]ow usage:get --brand-id <id> [--base-url <url>] [--json]ow generate:image --style-id <id> --prompt "..." [--brand-id <id>] [--wait] [--json]ow version:check [--fail-if-outdated] [--json]
Local Development
From repository root:
yarn cli:install
yarn openapi:generate
yarn cli:generate
yarn cli:lint
yarn cli:buildRun CLI commands from package directory:
cd packages/cli
node dist/bin/run.js --help
node dist/bin/run.js context:get --jsonOpenAPI Sync
The CLI currently synchronizes from the app's embedded OpenAPI spec:
yarn spec:syncwritesopenapi/openapi.jsonyarn client:typesgeneratessrc/generated/api-types.ts
Combined:
yarn client:generatePublic Distribution (npmjs)
Package name: @openwonder/ow
Publish
Use the GitHub Actions workflow CLI Publish:
- Update
versioninpackages/cli/package.jsonand add a changelog entry inpackages/cli/CHANGELOG.md. - Open Actions ->
CLI Publish. - Run workflow (
dry_run=trueoptional). - Ensure repository secret
NPM_TOKENis set (npm publish token). - On publish, workflow tags the release as
ow-cli-v<version>.
Install On VPS (for OpenClaw)
Install and run:
npm install -g @openwonder/[email protected]
ow --helpOr pin and run without global install:
npx -y @openwonder/[email protected] --helpVersion check in automation
ow version:check --json
ow version:check --fail-if-outdatedWith --fail-if-outdated, exit code is 10 when a newer version exists in the registry.
