watsonx-playground-cli
v0.2.1
Published
CLI for watsonx-chat playground tool automation
Readme
watsonx-playground-cli
Install:
npm install -g watsonx-playground-cli@latestConfigure:
wxp auth set-token --token <playground_cli_token> --base-url https://your-site.example.com
wxp auth tokens list
wxp auth tokens create --name "CI token"
wxp auth tokens revoke ptk_xxx_yyy --yesCommon commands:
wxp tools list
wxp tools fetch --out ./tools-export.json
wxp tools push --file ./tools-export.json --overwrite --yes
wxp tools share my_tool --email [email protected] --yes
wxp tools unshare my_tool --email [email protected] --yes
wxp tools generate-draft --prompt "Build a PTO request tool"
wxp tools create --file ./tool.json --yes
wxp tools update my_tool --file ./updates.json --yes
wxp tools delete my_tool --yes
wxp tools export my_tool --out ./my_tool.zip
wxp tools bundle-export --tool-ids pto_tool,expense_tool --agent-name hr_bundle_agent --display-name "HR Bundle"
wxp tools push-wxo --tool-ids pto_tool,expense_tool --overwrite --yes
wxp tools fetch-wxo --tool-names get_pto_tool,add_pto_tool --export-dir ./wxo-tools
wxp tools delete-wxo --tool-names get_pto_tool,add_pto_tool --yes
wxp tools import-wxo --tool-names get_pto_tool,add_pto_tool --overwrite --yes
wxp agents list
wxp agents fetch --json
wxp agents sync --connection-id conn-default --yes
wxp agents push hr_assistant --file ./agent-update.json --connection-id conn-default --yes
wxp agents generate-draft --prompt "Build an HR policy assistant"
wxp agents chat hr_assistant --connection-id conn-default --prompt "Summarize open PTO requests"
wxp agents smoke --prompt "Summarize open PTO requests" --connection-id conn-default --agent-ids hr_assistant,travel_agent
wxp testing get
wxp testing save --file ./testing-suites.json --yes
wxp testing generate-cases --agent-name "HR Assistant" --connection-label "Default Connection" --count 25
wxp testing run --agent-id hr_assistant --connection-id conn-default --cases-file ./cases.json
wxp testing run --agent-id hr_assistant --service-url https://api.dl.watson-orchestrate.ibm.com/instances/<id>/v1/orchestrate/runs --api-key <key> --token-mode aws --cases-file ./cases.json
wxp settings get
wxp settings save --file ./settings-update.json --yes
wxp settings get-api-key --connection-id conn-default
wxp connections list
wxp connections add --file ./connection.json --activate --yes
wxp connections add --service-url https://api.dl.watson-orchestrate.ibm.com/instances/<id>/v1/orchestrate/runs --api-key <key> --token-mode ibmcloud --label "Prod" --activate --yes
wxp connections activate conn-default --yes
wxp connections remove conn-old --yes
wxp setup doctor
wxp setup install-orchestrate --yesNotes:
tools push-wxoandtools fetch-wxocall server-side sync endpoints (/api/playground/tools/wxo/pushand/api/playground/tools/wxo/fetch).tools delete-wxoandtools import-wxocall/api/playground/tools/wxo/deleteand/api/playground/tools/wxo/import.auth tokens list|create|revokemanages owner-scoped Playground CLI tokens without using the UI.- No local IBM ADK
orchestrateCLI is required for WXO tool sync commands. - WXO sync uses your saved Playground connection (
connectionId) or explicit--service-url/--api-keyoverrides. agents fetchreads agents from the instance but does not persist them into connection settings.agents syncis the one-step persist flow (fetch + save) that enables connection-basedagents chat/agents smoke.--token-modesupportsibmcloudandaws; default isibmcloudso--token-urlis optional.- For handoff workflows, use “handoff to IBM Bob” wording in internal runbooks/docs.
- Testing cases can include
profileUserIds; runtime sends the first attached profile asuser_id,userid,userId, andcustomer_id.
Exit codes:
0: success2: config/auth setup problem (missing token/base URL)3: unauthorized/forbidden API auth error4: resource not found5: network/connectivity error64: usage error (invalid command/flags)
