timbereye
The Timbereye command line. Count and measure logs and loads from a terminal or a coding agent: create a group,
scan it, read the tally, receive the events. Binary timbereye, alias te. Apache-2.0. Node 20 or later.
Start in a minute
npm install -g timbereye
timbereye login # opens your browser; approve, and the CLI has your test key
timbereye quickstart # Create, Scan, Sync in test mode with a simulated scan: no phone
Or without npm: curl -fsSL https://www.timbereye.com/install.sh | sh (installs into ~/.timbereye, no sudo).
quickstart creates a group, runs a simulated scan into it, waits until it is measured, prints the tally (pieces,
volume and the volume rule) and the group.measured event your server would receive, then three commands to try
next. --json prints the same as one JSON document, so a coding agent can check its setup with
timbereye quickstart --json.
Test mode is free and needs no phone. Sign up at timbereye.com. Docs:
timbereye.com/docs/cli.
The boundary: Timbereye produces measurement data. Your software runs your business. The CLI has no workflow
features (no orders, bookings, approvals, reports) and will not grow any.
Sign in
timbereye login # browser sign-in: a code in the terminal, Approve in the console
timbereye whoami # organisation, mode, profile and key prefix; never the secret
timbereye logout # forget the key on this computer (it keeps working until rolled)
login shows a short code and opens the console; an owner or developer of your organisation checks the code and
approves, and the CLI receives the organisation's default test secret key. Nobody pastes a key. The console's
audit log records it. The browser sign-in never gives a live key. Keys are used under the
Terms of Service; see also the Privacy Policy.
- The key goes to the system's credential store where Node can reach one without extra software (the macOS Keychain,
the Secret Service via
secret-tool on Linux, Windows Credential Manager), else to ~/.timbereye/config.json
(directory 0700, file 0600). TIMBEREYE_KEY_STORE=file chooses the file.
- Profiles:
timbereye login --profile acme keeps another organisation beside the default; --profile or
TIMBEREYE_PROFILE chooses one per command. whoami lists them.
- Off a terminal,
login --web prints the link and waits. With a key in hand, printf %s "$KEY" | timbereye login --key -
checks it with GET /account and saves it the same way; a live secret key needs --allow-live.
- In CI skip
login: set TIMBEREYE_SECRET_KEY, the same variable the TypeScript SDK reads. It always wins over a
saved profile.
| Environment |
Meaning |
TIMBEREYE_SECRET_KEY |
The key. Overrides any profile. TIMBEREYE_API_KEY is read if unset. |
TIMBEREYE_API_URL |
API base URL. Default https://api.timbereye.com/v1. |
TIMBEREYE_PROFILE |
Which saved profile to use. --profile wins over it. |
TIMBEREYE_CONFIG_DIR |
Where config.json lives. Default ~/.timbereye. |
TIMBEREYE_KEY_STORE |
file keeps keys in config.json instead of the system credential store. |
NO_COLOR |
Disable colour (it is already off when stderr is not a terminal). |
The agent contract
These are enforced by tests in tests/agent-contract.test.ts.
-
stdout is only the result. Progress, warnings, "more results" hints and human-readable errors go to stderr.
-
--json prints exactly one JSON value on stdout. Keys are the API's own snake_case, as in the REST docs and
the OpenAPI file (the SDK's camelCase is converted back). The two streaming commands, events tail and
webhooks listen, print one compact JSON value per line instead.
-
--json errors are one object on stdout, with the exit code set:
{ "error": { "type", "code", "message", "param", "request_id" } }. Usage errors have type: "usage_error".
-
Exit codes: 0 success, 1 failure (API errors other than auth, network errors, a webhook that did not verify,
a wait that timed out), 2 usage (unknown command or flag, missing argument, bad unit, refused action),
3 authentication (no key, key rejected), 4 permission (valid key, not allowed).
-
No prompts. The CLI never reads a terminal or waits for input unless you pass --interactive (only login has a
prompt), with two exceptions for a person on a terminal: a destructive or bulk command without --yes shows its
effect and asks, and login with no key waits for the browser approval. Without a terminal neither happens; both
exit 2 (login --web opts in to waiting). It reads stdin only when you ask (--key -,
--data -, --tags -).
-
No colour or spinners when stderr is not a terminal, when NO_COLOR is set, or with --no-color. There are no
spinners at all.
-
Secrets are never printed. API keys (sk, rk) are scrubbed from every line the CLI writes, whatever the
source. The two secrets that exist only once, a capture token and a webhook signing secret, are printed
exactly once, on creation or on webhooks endpoints roll-secret: to stdout (and inside the --json value), with a
warning on stderr. They cannot be read again.
-
Environment overrides config, so CI needs no login.
-
Long operations poll to a terminal state and log each stage change to stderr: scans submit --wait-until,
scans wait, events tail.
-
Writes are retry-safe. Every POST carries an idempotency key (generated, or yours with --idempotency-key).
Lists page with --limit and --starting-after, or --all.
-
Every change can be previewed. --dry-run on any command that changes data prints the requests it would send
(method, path, body, idempotency key, If-Match) and, where it can be read, the effect, then exits 0 and sends
nothing. On a command that only reads it is exit 2. The mechanism is in the transport (src/program.ts): every
request that is not a GET is recorded, and in a dry run answered locally, so no command can forget it.
-
Destructive or bulk changes need --yes when stdin is not a terminal (exit 2, confirmation_required, before
any request); on a terminal they show the effect and ask. After a write, stderr says what changed and which
idempotency key was used; a failed write says which key to retry with.
-
Results state their mode. Every JSON result has livemode; lists and composite results also profile.
--fields never removes them.
-
Output is small on request. --fields a,b.c, --summary, and --output json|ndjson|table|csv (--json is
--output json).
Discovery: timbereye --help and every <command> --help are complete enough to use without the docs, and
timbereye commands --json dumps the whole command tree (arguments, flags with their choices and defaults, the API
operation ids and schema refs into the OpenAPI document, which commands change data or need --yes, which return a
one-time secret, exit codes, environment) in one call. commands --summary is short; commands "groups describe" is
one command in full with a JSON Schema of its inputs. timbereye mcp serve exposes the same table as MCP tools.
Commands
Each is one API operation; --help shows the operation id. Add --json to any.
login | logout | whoami | doctor | init | commands | explain | open | completion | mcp serve
groups create | get | list | update | open | lookup | set-weight | volume | origin | images
groups items add | remove | bulk-update | list
items list | get | update | remove | volume | groups | images
items measurements list | create
scans create | list | get | wait | add-items | add-observations | submit | upload-image
images create | get | complete
places create | get | list | update | validate
species list | create | update
volume-rules list
events list | get | tail
webhooks endpoints create | list | get | update | delete | roll-secret | test
webhooks verify | listen
capture-tokens create
usage get | records
account get
models detector
# composite: one question, one call (several API operations each)
groups describe | find | diff | reconcile
groups items move
items find | describe
import items | export group
simulate scan | refine (test mode only)
# offline
volume calc | rules
units convert
Not here, by design: creating or rolling API keys (key management is dashboard-only; the API has no such
operation) and creating an account.
Inputs
- Flags for common fields;
--data @file.json or --data - for a full body in the API's snake_case. Flags override
fields in it. --metadata k=v is repeatable (k= deletes on update).
- Units:
--length 5.8m, --weight-gross-style flags such as --gross 42000lb, --diameter-class 24cm.
Lengths: m cm ft in. Weights: kg lb t short_ton. A bare number or a bare ton is rejected with exit 2.
Diameter classes are converted to metres because the API field is diameter_class_m.
- GeoJSON:
--geometry @tract.geojson (a Feature is unwrapped; places validate checks it first).
- Lists:
--limit N (page size, 1 to 100), --starting-after CURSOR, --all (every page; with --limit it caps the
total).
Questions, safe changes, bulk, the simulator
See the CLI docs for the full tour. In short:
timbereye groups describe --external-ref MSKU1234567 --items --json # what was in this container
timbereye groups find --metadata booking=B123 --json # what was on this booking
timbereye items find --tag TE-4F7K2Q1 --json # where is this log, where has it been
timbereye groups delete grp_1 --dry-run # preview; then add --yes
timbereye import items --group grp_1 --file tally.csv --validate-only # tally CSV, validated first
timbereye simulate scan --group grp_1 --logs 12 --wait-until refined # test mode, no phone, simulated
timbereye volume calc --rule jas --diameter 24cm --length 5.8m # offline, no account
Webhook tools
# Your server on localhost gets each event, signed, with no tunnel and no public URL:
timbereye webhooks listen --forward-to http://localhost:4242/timbereye/webhooks --secret-env TIMBEREYE_WEBHOOK_SECRET
WH=whsec_... timbereye webhooks verify --secret-env WH --headers @headers.json --body @body.json
WH=whsec_... timbereye webhooks listen --port 8787 --secret-env WH --max-events 5 --json
The secret is taken from an environment variable, never a flag; it is the one your server verifies with.
listen --forward-to URL follows your account's events (GET /events, every 2 seconds, from when it starts) and
POSTs each one to URL as a delivery arrives: the event's JSON, webhook-id the event id, signed with your secret.
It needs an API key (like events tail), and no tunnel, no public URL and no webhook endpoint. Each forward is
tried once and its answer printed; --fail-on-error makes a failed one exit 1.
listen --port N is a local HTTP receiver on 127.0.0.1: it verifies each delivery and prints it (with
--forward-to, passes it on unchanged). It creates no tunnel: Timbereye reaches it only through a tunnel you run
and register with webhooks endpoints create.
verify checks a saved delivery offline.
Scaffolds
timbereye init ./my-integration --template server-node
timbereye init ./export-demo --template container-export-example
Both need an empty directory (or --force). server-node: a tiny Node server that creates a group, mints a capture
token, receives signed webhooks and reads items and volume. container-export-example adds the container use case as
a labelled worked example (container number as external_ref, booking number in metadata, weight ticket, the tally as it settles,
origin export). They are examples with no secrets, using the SDK's real method names; they contain no ERP features.
Licence
Apache License 2.0. Using the hosted Timbereye service through this package is governed by the
Terms of Service; what the service collects is in the
Privacy Policy.