@ziniao-agent/cli
v0.1.4
Published
Ziniao Open Eco CLI
Downloads
1,226
Readme
@ziniao-agent/cli
Install ziniao-cli and the Ziniao Open Eco CLI independently. npm selects the matching Windows, macOS, or Linux native Open Eco package during installation:
npm install -g @ziniao-open/cli@latest
npm install -g @ziniao-agent/cli@latest
ziniao-cli doctor
zn-open-eco capabilities --json
zn-open-eco skillsThe root package materializes a stable native zn-open-eco entry at install time. Normal CLI execution does not use Node or a JavaScript launcher.
zn-open-eco reads the active encrypted API Key created by ziniao-cli on Windows, macOS, and Linux. Initialize it with ziniao-cli config init and diagnose it with ziniao-cli doctor; zn-open-eco has no separate authentication command or credential store.
The default shared directory is ~/.ziniao-cli. Codex and WorkBuddy local sandboxes normally use that directory directly. If an agent sandbox remaps the user Home, expose the same directory to the sandbox and set ZINIAO_CLI_CONFIG_DIR to its absolute sandbox-visible path for both CLIs.
The npm package does not persistently set ZINIAO_CLI_CONFIG_DIR, does not install ziniao-cli, and never prints the decrypted API Key.
Linux and containers
Linux x64/ARM64 runs in remote API-only mode: remote_api=true and local_browser=false. It reads the same active ziniao-cli encrypted credential as desktop platforms.
In a container, mount the initialized .ziniao-cli directory read-only, set ZINIAO_CLI_CONFIG_DIR to that absolute mount path, and ensure the final runtime UID/GID can read config.json and credentials.
Remote Amazon, Temu, Linkfox, Product Skill, knowledge, and account operations remain available. Local browser commands return LOCAL_BROWSER_UNSUPPORTED and must be run on a Windows/macOS computer with the Ziniao App installed and signed in.
Pass the account/browser ID on each applicable HTTP request. It is not persisted or injected automatically:
Query stores or platform authorizations with the effective authentication. These commands preserve the service response exactly:
zn-open-eco account stores --store-name "<name-or-keyword>"
zn-open-eco account platform-auths --platform-type amazon-sp-api
zn-open-eco account platform-auths --platform-type amazon-ads-api
zn-open-eco account platform-auths --platform-type temu-apiLocal browser lifecycle
These browser lifecycle commands are included in packages starting with version 0.0.13.
Browser lifecycle commands run only on the user's local Windows or macOS computer. The CLI and Ziniao App must be running on the same computer, and the App must already be open. The CLI connects only to 127.0.0.1, trying fixed ports 33178, 33179, then 33180; it stops at the first valid service. If all attempts fail, it reports that the local Ziniao App cannot be connected.
Confirm authentication and query the store first. Use the store_id from the current, actual account stores response; a store name is not a substitute:
ziniao-cli doctor
zn-open-eco account stores --store-name "<store-name-or-keyword>"
zn-open-eco browser health
zn-open-eco browser capabilities
zn-open-eco browser list-online
zn-open-eco browser connection-status --store-id "<store_id>"
zn-open-eco browser open --store-id "<store_id>"Only after the user explicitly requests it and reconfirms closing the target store, run this separately:
zn-open-eco browser close --store-id "<store_id>"health does not send an Auth Key; every other browser command requires configured authentication. capabilities is dynamic admission information. The currently available lifecycle operations are list-online, connection-status, open, and close; page click, input, navigation, screenshot, download, and similar commands are not provided.
open and close accept an optional --idempotency-key "<key>"; when omitted, the CLI generates one. The CLI does not automatically retry POST requests. Server JSON is passed through unchanged to stdout; errors go to stderr and return a nonzero exit code. close is not automatic cleanup—run it only when the user explicitly requests or confirms it.
Browser automation concurrency
agent tool does not maintain a local waiting queue. It submits one tool call directly to the local Ziniao App. Calls for the same browser_id must be serialized by the caller: submit the next tool only after the previous one reaches succeeded, failed, or timed_out. If the App returns BROWSER_BUSY or TASK_CONTEXT_MISMATCH, the CLI reports the error without background queuing or automatic retry.
agent tool status and agent interaction respond can still query or restore an existing call directly. Ordinary API commands are unaffected. Agents must not submit tools for the same browser in parallel, invent replacement IDs to hide conflicts, or retry an uncertain PUT automatically. The CLI, Ziniao App, and target browser must remain on the same local computer, and the App must stay open.
Discover server-side Product Skills progressively and retrieve agent knowledge. A deeper Skill path must come from the previous response; a knowledge ID must come from a query result:
zn-open-eco agent skills browse --page 1 --page-size 50
zn-open-eco agent skills browse --page 2 --page-size 50
zn-open-eco agent skills browse --path "amazon-sp-api reports-api"
zn-open-eco agent knowledge query --query "download the US returns report for the past 60 days"
zn-open-eco agent knowledge get --kb-id "<kb_id>"These commands use the independent Agent service at https://agent-swarm.ziniao.com, encrypt their HTTP payloads, and write decrypted JSON to stdout. The platform HTTP proxy and account service use the same production environment.
zn-open-eco http POST /proxy/cn/cross-border-semi-managed --module temu-api --headers '{"X-Account-Id":"<browser_id>"}' --body '{"type":"bg.mall.info.get"}'Supported platforms: Windows x64/ARM64, macOS Intel/Apple Silicon, and Linux x64/ARM64. Normal zn-open-eco commands execute the packaged Go binary directly and do not require Node.js.
