Skip to content

xyte-io/xyte-cli

Repository files navigation

xyte-cli

Deterministic Xyte operations for humans and AI agents.

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 --version

If 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-setup

3) Connect with tenant-bound API key

xyte-cli setup run
xyte-cli setup status --field tenantId

Use 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.getDevices

Key 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 envelope for contract output
  • --strict-json for 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 10

Key params:

  • terminal output is human-readable by default; add --output json --strict-json for machine parsing
  • --once one snapshot poll and exit
  • --interval-ms minimum 1000
  • --max-polls bounded polling

4) Guided remediation plan (no writes)

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 run defaults to plan mode
  • --var key=value for runtime context
  • --resume <run-id-or-path> for follow-up runs

5) 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

6) 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.json

Key params:

  • --provider-scope organization|partner|auto
  • --window <hours> for deep-dive
  • --output json for pipelines

7) Generate PDF report

xyte-cli ops report generate --tenant <tenant-id> --input ./artifacts/deep-dive.json --out ./reports/fleet-report.pdf

Key params:

  • --input deep-dive JSON
  • --out target PDF path

8) 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 json

Key params:

  • --screen dashboard|spaces|...
  • --once snapshot mode
  • --follow stream mode

9) Utility preprocessing + import-tree

xyte-cli util list-actions --output text

xyte-cli util prepare \
  --action space.import-tree \
  --input ./raw-hierarchy.xlsx \
  --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

Key params:

  • util prepare --action ... --input ... --output-dir ...
  • util import-tree is dry-run unless --apply
  • --report writes apply NDJSON report

10) Upgrade flow

xyte-cli upgrade --check --output json
xyte-cli upgrade --yes --output json

Key params:

  • --check dry check
  • --yes non-interactive upgrade

11) 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 stats --path ./logs/xyte-cli.actions.ndjson

Key params:

  • --log-actions lifecycle NDJSON
  • logs list|stats|gc|view for operations logs

Deep Docs

About

xyte-cli gives coding agents and operators one deterministic runtime for endpoint calls, guarded writes, interactive TUI workflows, and schema-validated JSON outputs.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors