Tracktile CLI
The Tracktile CLI (tt) provides command-line access to the Tracktile platform for automation, scripting, and device management.
Installation
Section titled “Installation”Install globally via npm:
# npmnpm install -g @tracktile/cli
# pnpmpnpm install -g @tracktile/cli
# yarnyarn global add @tracktile/cliConfiguration
Section titled “Configuration”API Token
Section titled “API Token”The CLI requires a valid Tracktile API token. Provide it via the TRACKTILE_TOKEN environment variable or the --token flag:
# Environment variable (recommended)export TRACKTILE_TOKEN=cli-YOUR_TOKEN_HERE
# Command-line flagtt --token=cli-YOUR_TOKEN_HERE auth identityEndpoint
Section titled “Endpoint”The CLI defaults to https://api.tracktile.io. Override with --endpoint:
tt --endpoint=https://api-next.dev.tracktile.io auth identityOutput Format
Section titled “Output Format”Control output format with --output:
| Format | Description |
|---|---|
json | JSON output (default) |
table | Human-readable table |
tt --output=table locations listCommands
Section titled “Commands”Identity management commands.
# Check current identitytt auth identityExample output:
{ "id": "57cf9a81-1054-4bf1-8a3e-41304ff1b9f1", "tenantId": "a1b2c3d4-5678-90ab-cdef-1234567890ab", "firstName": "John", "lastName": "Doe", "email": "john@example.com"}locations
Section titled “locations”Manage inventory locations and flow nodes.
# List all locations/stages in your flowtt locations listOutput includes: name, behaviour type, traits, and status.
webhooks
Section titled “webhooks”Manage webhook subscriptions.
# List all webhookstt webhooks list
# Register a new webhooktt webhooks register --name="My Webhook" --on="inventory.received" --url="https://example.com/webhook"devices
Section titled “devices”Manage IoT devices and relays.
# List all devices in your registrytt devices registry list
# List all relaystt devices relays list
# Register a new relaytt devices relays register --hardwareId="RELAY-001"Get help for any command:
tt --helptt auth --helptt webhooks --helptt devices --helpVersion
Section titled “Version”Check the installed CLI version:
tt --version