CLI
Track parcels, manage webhooks and check signatures from your terminal.
trackified is the command-line client for the API, built on the Go library. Source: trackified/trackified-cli.
Install
- Homebrew
- Go
- Download
brew install trackified/tap/trackified# Needs Go 1.26 or later
go install github.com/trackified/trackified-cli/cmd/trackified@latest# Archives for macOS, Linux and Windows (amd64 and arm64):
# https://github.com/trackified/trackified-cli/releases
gh attestation verify trackified_0.1.0_linux_amd64.tar.gz --repo trackified/trackified-cliEach release archive has a signed build-provenance attestation. gh attestation verify checks that the file was built from the trackified-cli repo.
Check it works:
trackified versionSign in
The CLI reads your key from TRACKIFIED_API_KEY first:
export TRACKIFIED_API_KEY=live_...Or save the key once with trackified login. It asks for the key without echoing it, checks it against the API, and saves it with file mode 0600 to trackified/config.json in your OS config directory (~/Library/Application Support on macOS, ~/.config on Linux, %AppData% on Windows).
trackified loginlogin rejects current keys
trackified login in versions 0.1.0 and 0.2.0 only accepts keys that start with tk_, so it rejects live_… and test_… keys. Use TRACKIFIED_API_KEY until a fixed release is out.
TRACKIFIED_BASE_URL points the CLI at another API host. It may end in /v1.
Commands
Command | What it does |
|---|---|
| Check an API key and save it. |
| Start tracking a parcel and print it. |
| Show a tracking with its events. |
| List trackings. |
| Print new events until the parcel is delivered or returned. |
| Check the carrier again now. |
| Stop tracking a parcel. |
| List the carriers we track, or search the full catalog. |
| Guess the carrier of a tracking number. |
| Map a carrier or service name to our carrier id. |
| List webhook endpoints. |
| Add an endpoint and print its signing secret. |
| Change an endpoint, or pause it. |
| Issue a new signing secret. |
| Remove an endpoint. |
| Print a signed sample event, without sending it. |
| This month's usage and limits. |
| Check that the API is up. Needs no key. |
| Check a webhook signature locally. |
| Print the CLI and Go library versions. |
Flags can go before or after the arguments.
track
trackified track 1Z999AA10123456784 --custom-id order_1042
trackified track 9434650110837017316201 --carrier uspsLeave out --carrier and we detect it from the number. If we can't, run trackified detect and pass the carrier.
get
trackified get trk_...Prints the status, the estimated delivery or delivery time, any exception, then every event, newest first.
list
trackified list # the 50 newest trackings
trackified list --status in_transit --limit 100
trackified list --carrier usps --all # every page--limit is the page size, 1 to 100. Without --all, the CLI tells you when there are more.
watch
trackified watch trk_... --interval 5mPolls the tracking and prints each new event, oldest first. It stops when the parcel is delivered or returned, or when you press Ctrl-C. --interval is at least 5s; the default is 60s. Trackified itself checks the carrier on a schedule (every 30 minutes once out for delivery), so polling faster than that rarely shows anything new.
retrack and stop
trackified retrack trk_... # queue a fresh carrier check, within a minute
trackified stop trk_... # stop trackingcarriers and detect
trackified carriers # every carrier we track
trackified carriers "royal" # search the full catalog, including carriers we don't track yet
trackified detect 1Z999AA10123456784detect prints each candidate carrier with its confidence and the reason, best first.
trackified resolve USPS Priority Mail # usps USPS (confidence 0.97, matched alias)
trackified resolve dhl_expressresolve maps a carrier name, a service name or another provider's slug to the id you pass as --carrier. Quotes are optional. It exits with status 1 when no carrier we serve matches. track --carrier takes these names directly too.
webhooks
trackified webhooks add https://example.com/webhooks/trackified \
--events tracking.status_changed,tracking.delivered
trackified webhooks list
trackified webhooks test wh_...
trackified webhooks rm wh_...add prints the signing secret once: store it. Leave out --events and the endpoint gets tracking.updated and tracking.delivered.
trackified webhooks update wh_... --events tracking.status_changed
trackified webhooks update wh_... --disable # pause it; --enable turns it back on
trackified webhooks rotate-secret wh_... --expires-in 48hupdate needs at least one of --url, --events, --enable or --disable; the secret doesn't change. rotate-secret prints the new secret once. The old one keeps working for --expires-in, in whole hours from 0h to 168h (default 24h); 0h drops it at once. See Rotate the secret.
usage
trackified usagePrints your plan, this month's period, trackings used and left, your rate limit, webhook deliveries and trackings per carrier.
verify-webhook
trackified verify-webhook \
--secret "$TRACKIFIED_WEBHOOK_SECRET" \
--header "t=1792560000,v1=5f2c..." \
--body-file body.json--secret defaults to TRACKIFIED_WEBHOOK_SECRET. --body-file - reads the body from stdin. --tolerance changes the allowed clock difference (default 5m0s). A header with several v1= signatures is valid if any matches. When the signature is invalid, the command prints why (missing, malformed, timestamp or mismatch; reason with --json) and exits with status 1.
health
trackified health # API status: okJSON output
Every command takes --json and prints JSON instead of a table, with the same field names as the API. Pipe it into jq:
# Tracking numbers of everything in exception
trackified list --status exception --all --json | jq -r '.[].tracking_number'
# The latest event of one parcel
trackified get trk_... --json | jq '.events[0]'
# Trackings left this month
trackified usage --json | jq '.trackings_remaining'
# Fail a script on a bad signature
trackified verify-webhook --body-file body.json --header "$SIG" --json # {"valid": false, "reason": "timestamp"}list --json prints an array of trackings. watch --json prints each new event as its own JSON object.
Exit status
Code | Meaning |
|---|---|
| Success. |
| The API returned an error, |
| Wrong usage: an unknown command, a missing argument or a bad flag. |