CLI
traceiq-cli sets up TraceIQ in your app and lets you work with your projects from the terminal: switch projects, write env files, and read logs, events and errors. Run it with npx, or install it globally to get the shorter traceiq command.
npx traceiq-cli # setup wizard npx traceiq-cli help # every command npm install -g traceiq-cli traceiq help logs # flags for one command
Setup wizard
With no command, the CLI detects your framework (Next.js, Vite + React, Node), installs the SDK, writes your project ID and write key to the env file, and waits until the first real event reaches TraceIQ.
traceiq— Install and verify. Flags: --project-id, --write-key, --api-url, --dry-run, --skip-verify.traceiq audit— Check the instrumentation already in this project (alias: doctor).traceiq verify— Wait for a live event using the credentials in your .env file.
Log in
Every other command uses a personal access token. Create one in Settings under Personal access tokens with projects:read, analytics:read and errors:read, then log in. The token is saved to ~/.traceiq/config.json, readable only by you.
traceiq login # prompts for the token (input hidden) traceiq login --token tiq_pat_... # non-interactive traceiq login --api-url https://api.traceiq.run # a self-hosted or local API traceiq whoami traceiq logout
In CI, set TRACEIQ_TOKEN instead of logging in. logout only forgets the token locally; revoke it in Settings to disable it.
Projects and env files
traceiq projects list traceiq projects use # pick from a list traceiq projects use my-app # by id, slug or name traceiq env pull # writes .env.local (or your existing .env file) traceiq env pull --print # print instead of writing traceiq env pull --write-key trq_...
Logs, events, errors, status and env pull use the active project; pass --project <id> to use another one for a single run. env pull writes TRACEIQ_PROJECT_ID, TRACEIQ_API_URL and TRACEIQ_WRITE_KEY with the prefix your framework needs (NEXT_PUBLIC_, VITE_, or none for Node) and keeps the rest of the file. Write keys are stored hashed, so the CLI keeps the key already in your env file for that project, or uses --write-key.
Logs, events and errors
traceiq logs # last hour, oldest first traceiq logs --level error --since 24h traceiq logs -s checkout --follow # stream new logs until Ctrl+C traceiq logs --trace 4bf92f35... --json # one JSON object per line traceiq events --follow traceiq events --name signup_completed -n 50 traceiq errors --days 30
Status and the dashboard
traceiq status # API health, last event, last log, event counts traceiq open logs # also: events, errors, users, web, api, flags, replays, alerts, settings traceiq open logs --print # print the URL instead of opening a browser
status exits with code 1 when the API can't be reached, so it also works as a CI check.
Configuration
Flags win over environment variables, which win over the saved config. Creating, renaming or deleting projects and showing or rotating write keys need a signed-in dashboard session, so they stay in Settings; the CLI points you there if you try them.

