@terminal49/cli
v0.1.0
Published
Terminal49 container tracking CLI — for LLM agents, chat interfaces, and humans
Maintainers
Readme
Terminal49 CLI
@terminal49/cli is a command-line interface for Terminal49 APIs, designed for humans and automation agents.
Installation
Use npm:
npm install -g @terminal49/cliOr run from source:
cd sdks/typescript-sdk-cli
npm run dev -- --helpAuthentication
Use one of:
T49_API_TOKENenvironment variablet49 config set token <token>--token <token>
Prefer the environment variable or config file for tokens. --token is useful for one-off calls, but command-line arguments can be visible to other local processes through tools such as ps.
Token handling follows the SDK:
- A raw token is sent as
Authorization: Token <token>. - A value already prefixed with
TokenorBeareris sent unchanged. - For user-scoped bearer tokens, pass
--account-id <id>, setT49_ACCOUNT_ID, or setaccountIdin config. The SDK sends this asx-account-id.
Configuration
Config lives at the path printed by:
t49 config pathConfig subcommands:
t49 config patht49 config get <key> [--reveal]t49 config set <key> <value>t49 config list [--reveal]t49 config cleart49 config auth-statust49 config client-check
Allowed config keys are: token, baseUrl, defaultFormat, maxRetries, accountId, timeoutMs.
Environment variables:
T49_API_TOKENT49_API_BASE_URLT49_ACCOUNT_ID
Resolution precedence:
- Token:
--token>T49_API_TOKEN> configtoken - Base URL:
--base-url>T49_API_BASE_URL> configbaseUrl - Account ID:
--account-id>T49_ACCOUNT_ID> configaccountId - Response format:
--format> configdefaultFormat>mapped - Max retries:
--max-retries> configmaxRetries> SDK default - Timeout:
--timeout> configtimeoutMs> SDK default
Global Flags
--jsonemits JSON envelopes.--tableforces table output.--compactminifies JSON output.--fields <fields>projects comma-separated fields from JSON output.--format <raw|mapped|both>selects SDK response format.--token <token>overrides auth config.--base-url <url>overrides the API base URL.--account-id <id>sends an account id for user-scoped bearer tokens.--timeout <ms>sets request timeout in milliseconds.--max-retries <n>sets retry attempts for 429/5xx responses.
--json and --table are mutually exclusive. Without either flag, the CLI prints tables to a TTY and JSON to pipes.
--quiet, --verbose, and --no-color were removed.
List commands may also support:
--allemits all pages as newline-delimited JSON, one item per line, without the normal JSON envelope.--max-pages <n>limits pages fetched by--all.--max-rows <n>limits rows emitted by--all.--page <n>selects a page for normal list output.--page-size <n>selects page size for normal list output and--all.
JSON Output
Success output in JSON mode:
{
"ok": true,
"command": "shipments.get",
"data": {},
"pagination": {},
"meta": {}
}pagination and meta are omitted when unavailable.
Error output:
{
"ok": false,
"error": {
"code": "AUTH_ERROR",
"message": "Missing authentication token.",
"details": {},
"retryable": true,
"retryAfterMs": 1000
}
}details, retryable, and retryAfterMs are omitted when unavailable. Rate-limit errors use retryable: true and include retryAfterMs when exposed by the SDK.
Exit Codes
0success1general or unknown error2usage or argument error3authentication or authorization error4rate limited5not found6validation error7reserved8upstream/server error9network/connection error
Stable error codes include USAGE_ERROR, NETWORK_ERROR, AUTH_ERROR, RATE_LIMITED, VALIDATION_ERROR, NOT_FOUND, UPSTREAM_ERROR, and INTERNAL_ERROR.
Commands
t49 shipments get|list|update|stop-tracking|resume-tracking|custom-fields|set-custom-fieldt49 containers get|list|events|route|map|raw-events|refresh|demurrage|rail|custom-fields|set-custom-fieldt49 tracking-requests list|get|create|update|infer|create-from-infert49 track <number>t49 shipping-lines listt49 webhooks list|get|create|update|delete|ipst49 webhook-notifications list|get|examplest49 vessels get|get-by-imo|future-positions|future-positions-coordst49 ports gett49 terminals gett49 parties list|gett49 metro-areas gett49 custom-fields list|get|create|update|deletet49 custom-field-definitions list|get|create|update|deletet49 custom-field-options list|get|create|update|deletet49 search <query>t49 config path|get|set|list|clear|auth-status|client-checkt49 commands
Live Fixture Smoke Coverage
To validate output formatting against real read-only API payloads:
cd sdks/typescript-sdk-cli
export T49_API_TOKEN=Token YOUR_API_KEY
npm run fixtures:capture:live
npm testThis captures JSON and table fixtures under:
test/fixtures/api/live/test/fixtures/table/live/
Error fixtures are also captured for known read-only failure modes so output behavior remains test-covered.
