Skip to the page
Docs menu

Docs Tools and reference

Build with a coding agent

The prompt to give Claude Code, Codex or Cursor, what the agent can check by itself in test mode, the minimal starter to begin from and the rules it keeps; then the full path an agent follows to set up Timbereye for a business.

Give your coding agent (Claude Code, Codex, Cursor) this prompt in your project:

Text
Build on Timbereye in this project. Read https://www.timbereye.com/docs/llms.txt first and follow its links; do not
guess endpoints, fields or flags. Work in test mode only, with a te_test_sk_ key. Install the CLI
(`npm install -g timbereye`), run `timbereye login` (I will approve it in my browser), then run
`timbereye quickstart --json` to check the key and the API. Follow the minimal starter's shape: create a Timbereye
group when we create our record and store its id; handle group.measured in a webhook; read our record from our own
store. Keep these rules: verify every webhook signature against the raw body; apply group.measured only when its
revision is higher than the one stored; keep secret keys on the server; never present simulated numbers as
measurements. Prove the loop with the test-mode simulator and tests, and show me the commands you ran and what each
returned.

What the agent can check by itself#

In test mode, with no phone and nothing more from you once timbereye login is approved:

CheckCommandPasses when
The key and the APItimbereye quickstart --jsonexit 0, livemode: false, an event of type group.measured
The commands and flagstimbereye commands --jsonit uses these instead of guessing
A scan into its own grouptimbereye simulate scan --group grp_... --logs 12 --wait-until refined --jsonstatus: "refined", 12 logs
What Timbereye senttimbereye events tail --type group.measured --once --jsonthe event has the group's pieces and revision
Its webhook endpointtimbereye webhooks endpoints list --jsonstatus: "enabled"
Its own handlerits tests, signing a delivery with a test secretbad signature 400; duplicate and older revisions ignored

It cannot sign you up, create or roll keys, or turn on live mode. Those stay with you.

Start from the minimal starter#

The minimal starter is the smallest real integration: TypeScript on Node, with @timbereye/sdk its only dependency. POST /records creates a group for your record, POST /timbereye/webhooks verifies each delivery and applies group.measured once per revision, GET /records/:id answers from your own store, npm run simulate runs the loop in test mode and npm test checks the handler. Its AGENTS.md gives an agent the commands, the rules and five example tasks: a Postgres store, a packing-list view for lumber, a Slack message when a group is measured, capture tokens for a phone, each log in your store. It is to be published as its own public repository; until then, timbereye init my-server --template server-node scaffolds a smaller JavaScript server of the same loop.

The rules it keeps#

  1. Verify every webhook against the raw body, before reading it. A delivery that fails is answered 400.
  2. Idempotent on group and revision. Apply group.measured only when its revision is higher than the one on your record; a duplicate or an older revision changes nothing. A group has no end: each later scan sends the next revision.
  3. Secret keys on the server. Never in a repository, a browser or a phone; a phone uses a capture token or a publishable key (Keys).
  4. Test mode for development. Simulated logs are marked simulated and are not measurements.
  5. Your system keeps its records. Store the group id on your record, not your record in Timbereye.

The full path: setting up Timbereye for a business#

When the task is "create Timbereye for my business", the agent follows the rest of this page. It uses the CLI and these docs only. Timbereye is an API for forest products: a count, a measurement, an image and a location for every piece, grouped the way the business groups wood. It measures sawlogs and tallies lumber and panels (What is available). It does not run the business. An integration is three steps: the person's backend creates a Timbereye group when it creates its own record (a container, a truckload); a worker scans the logs into that group on a phone; Timbereye sends events and the backend syncs its record.

Limits. The limits are at the end. Do not promise the person anything beyond them.

What to ask the human first#

Ask these before you run a command that creates something. Do not invent the answers.

AskWhy
What do you measure, and where? Containers, truck loads, stacks, loads, other?Each becomes a group kind, in their word for it.
What is the record for one of them in your own system, and its id? (and the container number on it)Their unique record id is the group's external_ref; the container or load number is its name. Containers are reused, so the number alone is not unique.
What species, typical log lengths and diameter classes?These become the group's defaults and the species catalogue. They let a QR count produce volume.
Which units do people use: metres and kilograms, or feet and pounds? Weights in tonnes?Flags take units (5.8m, 42000lb). Never guess ton: ask metric tonne or short ton.
Where do the logs come from? Do you have tract boundaries as GeoJSON?These become places. A group points at its origin place for the origin export.
Do crews have iPhones or Android phones? Or will a person scan with something else?This decides what you can promise. See the limits: phone capture is not run in the field.
Where is your system of record, and what should hear about new measurements?That is the webhook URL, and the reference you store in metadata or external_ref.
Have you signed up at timbereye.com? Will you approve timbereye login in your browser?login needs a person to approve it in the console. You cannot create an account or a key.

Write the answers down in the project (a short TIMBEREYE.md) so a later agent does not ask again.

How the answers map to Timbereye#

Their answerIn TimbereyeCommand
A container, a load, a stackA group with that kindgroups create --kind ...
Their record id for itThe group's external_ref; store the group's grp_ id on their record too--external-ref
Their container or load numberThe group's name--name
Their booking, order or ticket idmetadata (a reference back to their system; Timbereye does not model bookings)--metadata booking=BK-2231
Species, length, diameter classThe group's defaults (the spec for what is scanned into it)--species --length --diameter-class
A species not in the catalogueA species entryspecies create --code ...
A tract, yard or portA place (GeoJSON), referenced as the group's origin_place_idplaces validate, places create
A weighbridge ticketThe group's weightgroups set-weight --gross --tare
"Tell my system when it is done"A webhook endpointwebhooks endpoints create
A phone that scansA capture token minted by their servercapture-tokens create

Groups can nest up to four levels: your system can place loads in a yard row, or under a vessel's hold, as parent groups. The phone scans into the load. Read Create groups, Stay in sync and Read logs, volume and photos once.

The commands, in order#

Work in test mode. After every step, check the exit code and the fields named. A non-zero exit is a stop: read the error.code in the JSON on stdout. Add --json to everything you will parse.

1. Install, sign in, verify#

Shell
npm install -g timbereye                                # or: curl -fsSL https://www.timbereye.com/install.sh | sh
timbereye login                                         # the human approves in their browser
timbereye quickstart --json
timbereye doctor --json

timbereye login prints a code and a link on stderr and waits for the human to approve it in the console; tell them to check the code and click Approve. It never needs a pasted key. If you have no terminal, use timbereye login --web, or have the human export TIMBEREYE_SECRET_KEY (the test key on the console's Home page), which always wins over a saved sign-in.

Verify your environment with timbereye quickstart --json before anything else: exit 0, livemode: false, tally.pieces equal to scan.logs, and an event of type: "group.measured". It creates a throwaway test group; add --cleanup to delete it afterwards. Exit 3 means no key (run login), exit 2 with test_mode_only means a live key: stop and ask for a test key. doctor has ok: true. If doctor shows a clock skew warning, tell the human: webhook verification will fail.

Read what is available in this build from doctor's capabilities. Do not rely on this page's limits list when doctor disagrees.

2. Learn the commands#

Shell
timbereye commands --json

One call gives every command, flag, choice, default and schema ref. Use it instead of guessing flags. It is long: timbereye commands --summary --json lists names and summaries, and timbereye commands "groups describe" --json describes one command in full, with a JSON Schema of its inputs. timbereye explain <error-code> says what an error code means and what to do next.

3. Reference data#

Shell
timbereye species list --all --json
timbereye species create --code PINE_TAEDA --trade-name "Loblolly pine"
timbereye volume-rules list --json

Verify: the species code you will use is in species list. Pick the volume rule with the human. The server computes jas only. The open library's board-foot rules doyle, international_quarter and scribner_decimal_c are verified against published tables; scribner_formula (old id scribner) is not.

4. Places (if they have origin data)#

Shell
timbereye places validate --geometry @tract14.geojson --json
timbereye places create --type tract --name "Tract 14" --lat -1.95 --lon 30.06 --geometry @tract14.geojson --json

Verify: validate returns no blocking issues before you create. Keep the plc_ ids.

5. A group with a spec#

Shell
timbereye groups create --kind container --external-ref ctr_4821 --name MSKU1234567 \
  --species PINE_TAEDA --length 5.8m --diameter-class 24cm \
  --origin-place plc_... --metadata booking=BK-2231 --json
timbereye groups get grp_... --json

Verify: groups describe grp_... --json shows group.open: true, the defaults you set and the external_ref. To find it later: groups describe --external-ref ctr_4821, or by your own identifier, groups find --metadata booking=BK-2231.

6. A webhook endpoint#

Shell
timbereye webhooks endpoints create --url https://THEIR-SERVER/timbereye/webhooks \
  --event group.created --event group.measured --event item.updated --event item.removed --json

The secret (whsec_...) is printed once. Put it in their secret store, not in the repository. Then:

Shell
timbereye webhooks endpoints test whk_... --json

Verify: their receiver shows a verified delivery. With no public URL yet, run their server and timbereye webhooks listen --forward-to http://localhost:<port>/<their webhook route> --secret-env TIMBEREYE_WEBHOOK_SECRET --event group.measured --max-events 1 --fail-on-error --json, then a simulated scan: it posts the real group.measured to their route, signed, with no tunnel, and exits 0 once their server answered 2xx. (webhooks endpoints test goes to a registered endpoint only; it is not an event, so --forward-to does not see it.) With no server at all, use timbereye events tail --json or poll events list. Check webhooks endpoints list for status: "enabled" later: a failing endpoint is disabled silently after about three days.

7. Their server and the device#

Do not put a secret key on a phone or in a browser. A phone uses a publishable key (created in the console, built into the app) or a capture token the person's server mints with its secret key (Keys). The worker scans with the Timbereye app, signed in once with an emailed code after the office adds them on the Team page (Scan with the Timbereye app, built from source; no code to write) or inside the person's own app with the drop-in scanner (Scan in your app: in the Swift and Kotlin SDKs).

Shell
timbereye init ./server --template server-node

For containers there is --template container-export-example, a worked example. Read it, then change it to their identifiers. Both are examples with no secrets. Generated code uses the real SDK methods.

Verify: npm run check passes in the scaffold and the server starts. capture-tokens create --group grp_... (or the scaffold's route) returns a token once.

8. Prove the loop, with no phone#

Two ways, both in test mode and both without a device. Say which one you used.

A QR count, as a device would do it:

Shell
timbereye scans create --method qr_count --intent add --group grp_... --json
timbereye scans add-observations scn_... --payload TE-4F7K2Q1 --payload TE-4F7K2Q2
timbereye scans submit scn_... --wait-until refined --json
timbereye groups describe grp_... --items --json

Verify: the scan is refined; the logs (the API calls them items) have a measurement with stage assigned, from the group's diameter class; summary.volume.m3 is greater than 0. A scan.refined event reaches the endpoint.

Simulated measured logs, so you reach a refined measurement and scan.refined without a camera or the segmentation service. The numbers are synthetic and marked provenance.simulated: true. Test mode only; a live key is refused. Tell the human these are simulated and are not evidence of anything:

Shell
timbereye simulate scan --group grp_... --logs 12 --species PINE_TAEDA --length 5.8m --seed 7 --wait-until refined --json
timbereye groups describe grp_... --items --fields summary,items.data --json

Verify: scan.status is refined; each item's measurement stage is server_refined with simulated: true; the group summary has items and volume; the webhook endpoint received scan.estimated and scan.refined, then group.measured (revision 1), which is what the person's handler waits for (or timbereye events tail --type group.measured --once --json shows it), with pieces and volume.m3 matching the group's summary. A second simulate scan into the same group sends revision 2: check the handler keeps the highest revision.

9. Answer the questions they will ask#

Once there is data, these are the questions the person's team will put to you. Each is one command. Use --fields to keep the answer short, and say what you ran.

Shell
timbereye groups describe --external-ref ctr_4821 --items --json         # what was in this container
timbereye groups find --metadata booking=BK-2231 --json                      # what was on this booking
timbereye items find --tag TE-4F7K2Q1 --json                                 # where is this log, where has it been
timbereye groups reconcile --external-ref ctr_4821 --tags @manifest.txt --json   # does the manifest match

To load a tally someone already has in a spreadsheet, save it as CSV and import it. Always validate first:

Shell
timbereye import items --group grp_... --file tally.csv --validate-only --json
timbereye import items --group grp_... --file tally.csv --dry-run --json
timbereye import items --group grp_... --file tally.csv --results tally.results.ndjson --yes --json

Verify: the report has errors: 0; after the import groups describe shows the item count you expect; the results file has no error rows.

10. Changing data: preview, then confirm#

Any command that changes data takes --dry-run: it shows the request and its idempotency key and changes nothing. Run it first, show the human, then run for real. Destructive or bulk commands (groups delete, groups items remove, groups items bulk-update, groups items move, items remove, webhooks endpoints delete, webhooks endpoints roll-secret, import items) need --yes without a terminal; do not add it until the human has seen the dry run. Every JSON result carries livemode: check it matches the mode you mean to be in. A failed write prints the idempotency key to retry with.

11. Weights, photos, origin#

Shell
timbereye groups images add grp_... --file ticket.jpg --kind weigh_ticket --json     # note the image id
timbereye groups set-weight grp_... --gross 42000lb --tare 9000lb --ticket-ref WT-118 --ticket-image img_... --json
timbereye groups origin grp_... --json               # or: export group grp_... --format geojson

Verify: weight.net_kg and weight.ticket_image_id set, and the origin export has eudr_valid and its features. Say plainly that this is origin data. Timbereye does not file or certify anything.

What not to build into Timbereye#

  • No customer-specific fields or endpoints. Their data goes in metadata, as a reference to their system.
  • No workflow: orders, bookings, approvals, invoices, settlement, reports. Those are the person's software. A webhook handler that calls their API is the integration.
  • No second copy of their system of record. Store the Timbereye id next to their record, not their record in Timbereye.
  • No claims about accuracy or compliance, in code, comments or messages. Accuracy evidence is to be published by Timbereye. Origin data is not a filing.
  • No secret key outside a server. No key in a repository.
  • No reaching for bookings, shipments or compliance records through Timbereye. They are not in the API; the CLI has no command for them. If the person's question is about a booking, answer from the metadata they stored on groups (groups find --metadata booking=...) and say that the booking itself lives in their system.
  • No simulated number presented as a measurement. The simulator is for exercising an integration in test mode.

The limits of the current build, stated honestly#

Run timbereye doctor for the live answer. As of this writing:

AreaState
Getting a keyA human signs up, verifies their email and creates a test key in the developer console, then supplies it. You cannot create or roll keys. Live keys need live mode turned on.
Groups, items, scans, places, species, webhooks, capture tokens, events, usageAvailable
Open by reference, group.created, group.measured, publishable keysAvailable. Publishable keys are created by a human in the console
Tag counts (qr_count)Available, end to end, with scan.refined
Server-side photo countingNot available. A photo_count scan counts the detections the client supplies and ends at estimated
Image uploadNeeds hosted image storage, not wired in the cloud environment: 503
Measured logs (qr_scale, ar_scale)Reach refined after server refinement from a real device, which is not verified end to end. In test mode, the simulator reaches refined with synthetic numbers
Detector model (models detector)Log detector 1.0.0 where the environment holds it, else 503 model_unavailable
Capture on a phone (iOS and Android)The Swift and Kotlin SDKs have camera screens, device layers, the journal and upload, and reference Capture apps built from source, not published or distributed. On a real iPhone the Timbereye app signs in and downloads the log detector; scanning is not run on a phone. The drop-in TimbereyeScanner is in the Swift and Kotlin SDKs. Do not promise a crew phone capture
Board-foot volume rulesOpen library only (the server computes jas): doyle, international_quarter and scribner_decimal_c are verified against published tables; scribner_formula is not
MCP serverAvailable: timbereye mcp serve (stdio), the same commands as tools with the same safety rules. Add --read-only to leave out every tool that changes data
SimulatorAvailable in test mode only (simulate scan, simulate refine). Synthetic and labelled simulated; never billed; refused with a live key

So "create Timbereye for my business" can set up the data model, the webhook and the server-side loop, and prove it with QR counts and a weighed group with an origin export. It cannot put a working phone capture in a crew's hands, count logs in a photo on the server, or sign the person up. Say so.

Next#