# Tic CLI - Full Agent Operating Manual Fast, native command-line tool and agent interface for the TIC (tic.io) business intelligence and datasets API (company, person, vehicle, and bankruptcy lookup). Built in Rust Edition 2024 for developers and autonomous AI agents. ## Architectural Guarantees 1. Sub-millisecond cold starts (1–3 ms), compiled with LTO and zero runtime dependencies. 2. Secure OS keystore credential management (macOS Keychain, Windows DPAPI, Linux Secret Service). 3. YAML by default on stdout for concise, readable inspection; `--json` outputs clean, structured JSON. 4. Error envelopes on stderr with deterministic machine-readable codes and remediation steps. 5. Fully offline mockable with `TIC_API_URL`. ## Exit Codes | Code | Machine Name | Meaning | Remediation | |:---|:---|:---|:---| | 0 | `ok` | Command completed successfully | None | | 1 | `error` | General or unclassified error | Report error and stop | | 2 | `network` | Request timed out or network error | Retry once, then stop | | 3 | `auth_required` | Missing or invalid API key | Set TIC_API_KEY, pass --api-key, or run tic login | | 4 | `not_found` | Resource does not exist | Do not retry | | 5 | `rate_limited` | Rate limit (429) reached | Exponential backoff before retrying | | 6 | `invalid_input` | Parameter or validation error | Fix the CLI arguments | | 7 | `no_account` | No account specified and none found | Run tic accounts list | ## Detailed Command Reference ### Global Flags - `--json`: Force JSON output on stdout and stderr. - `--format `: Optional output format override (`yaml`, `json`). - `-a, --account `: Specify stored account name. - `--api-key `: Pass API key directly. - `--verbose`: Print HTTP request and response information to stderr. ### Authentication & Accounts - `tic login [] [--api-key ] [--api-key-stdin] [--no-browser] [--force] [--no-verify]` Authenticate interactively or with provided key. Stores key in OS keystore. - `tic accounts add [--api-key ] [--api-key-stdin] [--force] [--no-verify]` Add or replace an account in the local configuration. - `tic accounts list [--check]` List all configured accounts. With `--check`, verifies keys against live API. - `tic accounts test ` Test connectivity for a specific account. - `tic accounts remove [--yes]` Remove an account and wipe its stored secret. ### Company Commands - `tic company get ` Look up company by Swedish organization number (e.g. 556792-6687). Hyphens are automatically stripped. - `tic company get-by-id ` Look up company by internal TIC integer identifier. - `tic company search [--query-by ] [--filter-by ] [--sort-by ] [--per-page ]` Search company database. Default query-by: `names.nameOrIdentifier`. - `tic company graph [--include-beneficial-owners ] [--max-nodes ] [--max-roles ]` Fetch ownership network graph. - `tic company tree ` Fetch corporate group structure and ownership hierarchy tree. - `tic company intelligence ` Fetch intelligence anomalies, warnings, and fraud indicators. - `tic company beneficial-owners ` List ultimate beneficial owners (UBO) for the company. - `tic company parties ` List board members, executives, auditors, and signatories. - `tic company debtor-summary ` Retrieve debt enforcement summary (Kronofogden unpaid debts and balances). - `tic company vehicles [--page ] [--page-size ]` List motor vehicles registered to the company. - `tic company properties [--include-historical]` List real estate and properties owned by the company. ### Person Commands - `tic person search [--page-size ]` Search individuals by personal identity number (personnummer). Supports `%` wildcards. - `tic person get ` Retrieve detailed personal information. - `tic person companies [--page-size ]` List all companies where the person currently holds or previously held roles. ### Vehicle Commands - `tic vehicle search [--query-by ] [--filter-by ] [--sort-by ] [--per-page ]` Search vehicle registry by licence plate (default), VIN, or make. ### Bankruptcy Commands - `tic bankruptcy search [--query-by ] [--filter-by ] [--sort-by ] [--per-page ]` Search Swedish bankruptcy records by registration number or company name. ### Generic Search - `tic search [--query-by ] [--filter-by ] [--sort-by ] [--per-page ]` Search any TIC collection directly. ### Agent Manual - `tic agent-readme [--json]` Self-documenting manual embedded directly in binary.