@xyteai/cli
v0.10.4
Published
Xyte CLI, TUI, skills, and headless contracts for zero-friction AI operations
Readme
xyte-cli
Deterministic Xyte operations for humans and AI agents.
- npm: @xyteai/cli
- GitHub Page: docs/index.html
- Command reference: docs/commands.md
- Flows: docs/flows/agent-ops.md
- Schemas: docs/schemas
AI Agent Prompt (Copy/Paste)
Use @xyteai/cli in this workspace. Keep it concise and safe.
Rules:
- Never print secrets.
- Do not invent IDs or outputs.
Run:
npm install -g @xyteai/cli@latest
xyte-cli --version
xyte-cli init --no-setup
Then connect the tenant:
xyte-cli setup run
xyte-cli setup status --field tenantId
Read tenantId from setup status and continue:
xyte-cli ops watch incidents --tenant <tenant-id> --profile incidents-active --once --output json --strict-json
xyte-cli ops inspect deep-dive --tenant <tenant-id> --window 24 --output json --out ./artifacts/deep-dive.json
xyte-cli ops report generate --tenant <tenant-id> --input ./artifacts/deep-dive.json --out ./reports/fleet-report.pdf
Finish with:
- concise success/failure summary
- exact failing command (if any)Install Flow
1) Install CLI
npm install -g @xyteai/cli@latest
xyte-cli --versionIf your global npm bin is not on PATH, replace xyte-cli in the commands below with one of these published-package fallbacks:
npx @xyteai/cli@latest <command>
npm exec -- @xyteai/cli@latest <command>2) Install agent skills
xyte-cli init --no-setup3) Connect with tenant-bound API key
xyte-cli setup run
xyte-cli setup status --field tenantIdUse that value as <tenant-id> in the examples below. Persisted credentials default to secure OS-native storage: macOS Keychain, Windows DPAPI, Linux Secret Service. If native storage is unavailable, xyte-cli warns and falls back to file storage. For non-interactive automation and backend details, use the setup guidance in docs/getting-started.md.
Examples (Feature Catalog)
1) Endpoint discovery
xyte-cli api endpoints list
xyte-cli api endpoints describe organization.devices.getDevicesKey params:
api endpoints describe <endpoint-key>
2) Read endpoint call (safe)
xyte-cli api call organization.devices.getDevices --tenant <tenant-id>Key params:
--tenant <tenant-id>--output-mode envelopefor contract output--strict-jsonfor machine parsing
3) Incident watch (active incidents)
xyte-cli ops watch incidents --tenant <tenant-id> --profile incidents-active --once
xyte-cli ops watch incidents --tenant <tenant-id> --profile incidents-active --interval-ms 2000 --max-polls 10Key params:
- terminal output is human-readable by default; add
--output json --strict-jsonfor machine parsing --onceone snapshot poll and exit--interval-msminimum1000--max-pollsbounded polling
4) Flow discovery and guided remediation
xyte-cli flow list --format text
xyte-cli flow run flow.guided-remediation --tenant <tenant-id> --var incident_id=<incident-id> --var device_id=<device-id> --var command=reboot --var updated_device_name=<device-name>Key params:
flow rundefaults to plan mode--var key=valuefor runtime context- non-completed runs include
nextActionwith the safest next operator command - gate continuation is
--apply --resume <run-id-or-path>
5) Tenant and key slots
xyte-cli config tenant add <tenant-id> --name "Acme"
xyte-cli config tenant use <tenant-id>
xyte-cli config key add --tenant <tenant-id> --provider xyte-org --name primary --key-file ~/.config/xyte/acme.key --set-active
xyte-cli config key list --tenant <tenant-id> --output json
xyte-cli config tenant remove <tenant-id> --confirmKey params:
config tenant removerequires--confirm- prefer
--key-file,--key-stdin, or--key-commandover inline keys - pass
--provider xyte-org|xyte-partnerwhen you need deterministic routing
6) Write example
Primary read/setup/reporting workflows are shell-neutral. Advanced raw API examples like this one remain shell-specific because inline JSON quoting differs across PowerShell, CMD, Bash, and zsh.
xyte-cli api call organization.commands.sendCommand \
--tenant <tenant-id> \
--path-json '{"device_id":"<device-id>"}' \
--body-json '{"command":"reboot"}'Behavior:
- executes directly once you choose the write step
7) Fleet insights and deep-dive data
xyte-cli ops inspect fleet --tenant <tenant-id> --provider-scope auto --output json
xyte-cli ops inspect deep-dive --tenant <tenant-id> --provider-scope auto --window 24 --output json --out ./artifacts/deep-dive.jsonKey params:
--provider-scope organization|partner|auto--window <hours>for deep-dive--output jsonfor pipelines
8) Generate report artifacts
xyte-cli ops report generate --tenant <tenant-id> --input ./artifacts/deep-dive.json --render pdf --out ./reports/fleet-report.pdf
xyte-cli ops report generate --tenant <tenant-id> --input ./artifacts/deep-dive.json --render markdown --out ./reports/fleet-report.mdKey params:
--inputdeep-dive JSON--render markdown|pdffor artifact format--output text|jsoncontrols stdout, not report rendering
9) Headless console snapshots (for agents/automation)
xyte-cli ops console --headless --screen dashboard --once --tenant <tenant-id> --output json
xyte-cli ops console --headless --screen spaces --follow --interval-ms 2000 --tenant <tenant-id> --output jsonKey params:
--screen dashboard|spaces|...--oncesnapshot mode--followstream mode
10) Utility preprocessing + executable workflows
xyte-cli util list-actions --output text --mode friendly
xyte-cli util list-actions --output text --execution-support edge.claim-batch
xyte-cli util prepare \
--action space.import-tree \
--input ./raw-hierarchy.xlsx \
--output-dir ./prepared
xyte-cli util prepare \
--action organization.connectors.prepareSetup \
--input ./raw-connectors.csv \
--output-dir ./prepared
xyte-cli util prepare \
--action organization.teamAccess.groups \
--input ./raw-team.csv \
--output-dir ./prepared
xyte-cli util prepare \
--action organization.teamAccess.users \
--input ./raw-team.csv \
--output-dir ./prepared
xyte-cli util prepare \
--action organization.teamAccess.memberships \
--input ./raw-team.csv \
--output-dir ./prepared
xyte-cli util import-tree --tenant <tenant-id> --input ./prepared/space-import-tree.csv
xyte-cli util import-tree --tenant <tenant-id> --input ./prepared/space-import-tree.csv --apply --report ./reports/space-import.apply.ndjson
xyte-cli util match \
--source ./source-devices.json --target ./target-spaces.json \
--source-field name --target-field name \
--out ./device-moves.csv
xyte-cli util move-devices --tenant <tenant-id> --input ./device-moves.csv
xyte-cli util move-devices --tenant <tenant-id> --input ./device-moves.csv --apply --report ./reports/device-moves.apply.ndjsonKey params:
util prepare --action ... --input ... --output-dir ...util import-treeandutil move-devicesare dry-run unless--apply- dry-runs count validated rows under
totals.planned;totals.succeededis for apply mode - generated
.notes.mdfiles are the human review artifact for prepared data - connector and team-access prepare actions are prepare-only normalization utilities
--reportwrites an NDJSON row report
11) Claim devices
Use docs/claim-devices.md first when the claim path is not explicit. Native/direct, Edge, and C2C are different flows.
# Native / direct claim
xyte-cli api call organization.devices.claimDevice \
--tenant <tenant-id> \
--body-json '{"name":"<name>","space_id":<space-id>,"sn":"<sn>","mac":"<mac>","cloud_id":"<cloud-id>"}'
# Single Edge claim, plan first
xyte-cli edge claim \
--tenant <tenant-id> \
--proxy-id <proxy-id> \
--device-ip <device-ip> \
--device-model-id <device-model-id> \
--space-id <space-id> \
--plan
# Bulk Edge claim, plan first
xyte-cli util prepare --action organization.edge.startClaim --input ./edge-devices.xlsx --output-dir ./prepared
xyte-cli edge claim-batch --tenant <tenant-id> --input ./prepared/organization-edge-startclaim.csv --plan
xyte-cli edge claim-batch --tenant <tenant-id> --input ./prepared/organization-edge-startclaim.csv --apply --report ./reports/edge-claim.apply.ndjson --resume-artifact ./reports/edge-claim.resume.ndjsonKey params:
edge claim,edge claim-batch, andedge pingare mutating; run--planfirst- blank or
skip_connectivity_check=falsebatch rows run a pre-claim ping beforestartClaim skip_connectivity_check=truerows skip that batch-owned ping- C2C claiming is not exposed through the public API; use the End Customer Portal
12) Edge diagnostics
xyte-cli edge claim-status --tenant <tenant-id> --proxy-id <proxy-id> --device-ip <device-ip>
xyte-cli edge ping --tenant <tenant-id> --proxy-id <proxy-id> --device-ip <device-ip> --plan
xyte-cli edge ping-status --tenant <tenant-id> --proxy-id <proxy-id> --device-ip <device-ip>Key params:
edge claim-statusandedge ping-statusare read-onlyedge pingis a standalone diagnostic command- batch claim owns its own pre-claim ping for rows that require connectivity verification
13) Upgrade flow
xyte-cli upgrade --check --output json
xyte-cli upgrade --yes --output jsonKey params:
--checkdry check--yesnon-interactive upgrade
14) Action logs and diagnostics
xyte-cli --log-actions --log-actions-path ./logs/xyte-cli.actions.ndjson status --tenant <tenant-id>
xyte-cli logs list --path ./logs/xyte-cli.actions.ndjson --limit 200
xyte-cli logs list --path ./logs/xyte-cli.actions.ndjson --session-id <session-id> --output json
xyte-cli logs show --path ./logs/xyte-cli.actions.ndjson --entry <sessionId>:<seq> --output json
xyte-cli logs show --path ./logs/xyte-cli.actions.ndjson --request-id <request-id> --output json
xyte-cli logs stats --path ./logs/xyte-cli.actions.ndjsonKey params:
--log-actionslifecycle NDJSONlogs list --session-idnarrows a runlogs show --entryandlogs show --request-idare exact non-interactive lookups
