Work from the terminal

Track parcels, watch one until it arrives, and script daily jobs with the trackified CLI.

Embed
Preview of the card
<a href="https://trackified.net/guides/terminal"><img src="https://trackified.net/guides/_api/public/orgs/e2a7773e-db9e-41cb-bd59-bd248745cac3/spaces/5f05ba65-3f06-41a2-ad68-be7988522567/pages/f42a5c51-96e7-40a5-bee6-3487d276d82b/social-card.svg?v=3e7ae33eec8b" alt="Work from the terminal" width="600" height="315"></a>

The trackified CLI covers the API from your shell. This guide installs it, tracks a parcel end to end, and builds two small scripts.

  1. Install and sign in
    brew install trackified/tap/trackified
    export TRACKIFIED_API_KEY=live_...
    trackified health

    Keep the key in TRACKIFIED_API_KEY. In versions 0.1.0 and 0.2.0, trackified login rejects keys that start with live_ or test_.

  2. Track a parcel
    trackified track 1Z999AA10123456784 --custom-id order_1042

    If the carrier can't be detected, ask which one it is, or pass a name:

    trackified detect 1Z999AA10123456784
    trackified track 9434650110837017316201 --carrier "USPS Priority Mail"
  3. Watch it
    trackified watch trk_... --interval 5m

    This prints each new event until the parcel is delivered or returned. We check the carrier on our own schedule, every 30 minutes at the fastest, so a shorter interval rarely shows more.

  4. Look around
    trackified list --status in_transit
    trackified get trk_...
    trackified usage

Script: exceptions report

Every command takes --json. This prints one line per parcel in exception, then asks for a fresh check on each:

#!/usr/bin/env bash
set -euo pipefail

trackified list --status exception --all --json |
  jq -r '.[] | [.id, .custom_id // "-", .carrier, .tracking_number] | @tsv' |
  while IFS=$'\t' read -r id custom carrier number; do
    echo "$custom  $carrier  $number"
    trackified retrack "$id" >/dev/null
  done

Script: quota warning

#!/usr/bin/env bash
set -euo pipefail

left=$(trackified usage --json | jq '.trackings_remaining')
plan=$(trackified usage --json | jq -r '.plan')
if [ "$plan" != "scale" ] && [ "$left" -lt 50 ]; then
  echo "Only $left trackings left this month" >&2
  exit 1
fi

On Scale, trackings_remaining is always 0 because there's no monthly limit, hence the plan check.

Exit codes

Commands exit with 0 on success, 1 on an API error, and 2 on wrong usage, so set -e stops a script at the first failure. The CLI reference lists every command and flag.

Updated