crumbtrail

Record, copy and replay a task

Record one task in your app, get a small copy of the database rows it touched, then replay the task on that copy as often as you need.

About 15 minutes the first timeNo changes to your app's codeDatabase copies Beta in Team and Enterprise

The short version

  • Record once, retry as often as you like. Crumbtrail saves the rows a task touched as a small real copy.
  • Your app is unchanged. You point it at the copy instead of the original.
  • Works with the access you have. The app's login is enough. More access gives a more exact copy.
  • Clear results. Every copy says Complete or Incomplete, and why. Recognised passwords are replaced; replacement has limits.

Install, then four commands: init, record, open, reset.

Before you start

You need an app that talks to a Postgres, MySQL or SQL Server database, and a login that can read it. Crumbtrail sits between them only while you record.

  • Start on a test or staging copy of the app.
  • Know the database address. It looks like postgres://db.internal:5432/shop. Do not include a password in that address.
  • Database login passwords. The database passwords you give Crumbtrail are read from environment variables and are not written to the recording.

On Free, start with Your first run. Free works with an app on this computer, over HTTP, PostgreSQL and MySQL, includes saved setups (init), local coding agent tools (assistants) and local checks (check, on your own computer only; the first three saved checks by name never expire), and keeps other recordings for seven days. CI checks, stopping a build and apps on another machine are in Team and Enterprise. Database copies, with open and reset below, are in Team and Enterprise.

Prefer a browser? Run crumbtrail desk serve and open the address it prints. It does everything on this page. Add --help to any command for its options.

Install Crumbtrail

One command installs crumbtrail on Linux, Mac or Windows. It checks the download first and installs to your own folder without administrator rights.

Terminal · install
Sign in at https://crumbtrail.ai/download and generate your personal install command.

To sign in from a terminal, run crumbtrail sign-in, open the address it prints and enter the code.

Check it:

Terminal · check the install
crumbtrail --version

Done when it prints a version number. If the shell says crumbtrail: command not found, open a new terminal window. On Linux and Mac you can also add ~/.local/bin to your PATH: export PATH="$HOME/.local/bin:$PATH". To install by hand or offline, see Download.

01

Add your app

Save a setup once for each app, so later commands need almost no options. In the console this is Apps, then Add app.

Repeat --database for every database the app uses, or use --from-app to read the addresses from the app's settings file (.env or appsettings.json, Laravel's pgsql and sqlsrv settings included). Any password in that file is dropped. Then crumbtrail record -- YOUR-START-COMMAND starts the app already pointed at the recorder: two commands in all.

Terminal · save a setup named default
crumbtrail init --database shop=postgres://db.internal:5432/shop
Terminal · or read the addresses from the app
crumbtrail init --from-app ./my-app

Use --name to keep one setup per app. See what you have saved:

Terminal · list and show saved setups
crumbtrail init --list
crumbtrail init --show default

Done when init --list shows the setup. Secrets in a setup are shown only as saved or missing.

02

Record the task

Recording runs until you stop it and captures everything done in that window. Add --collect-copy to also save the rows the task read and wrote.

Terminal · start recording
crumbtrail record --collect-copy

Point the app's database settings at the addresses the command prints and restart its connection pool. The app keeps its own login and database names. Then do the task in the app.

Or let Crumbtrail start the app: put its start command after --. Recording stops when the app exits.

Terminal · record and start the app together
crumbtrail record --collect-copy -- npm start

To stop and save, press Ctrl+C in the recording window. Keep the app's connections open until the recorder reports its result. In the console, press Stop and save. Work still in progress is saved as missing rather than failing the recording.

Done when the recorder prints Complete or Incomplete for each database. Incomplete names each reason and the next step.

OptionWhat it does
--output DIRFolder the recording is written to.
--deadline 1hStops cleanly after this long. The default is 12 hours.
--database NAME=URINames a database without saving the setup. Repeat for each one.
--target-port PORTAlso records the app's incoming web requests. Give the port the app listens on.
--httpsAlso records the app's secure web calls and encrypted database connections. The command prints the settings that make the app trust the recorder. PHP apps need no change to their code.
--replace-values CHOICEHow much private data is replaced. automatic (the default) replaces sign-in secrets, personal data Crumbtrail recognises and what your rules name. team-rules replaces sign-in secrets and what your rules name. sign-in-only replaces sign-in secrets only, so the recording holds real personal data and stays on your machines.
--leave-out RULEKeeps matching web calls out of the recording, such as 'GET /health' or '/static/*'. The app still gets its responses. Repeat for more, or list them in .crumbtrail/leave-out.txt.
--setup NAMEUses another saved setup. With several setups and no name, the command lists them and stops.
--no-setupIgnores saved setups.

Choose how the copy is built

Crumbtrail checks what each database allows and picks the best method it can use on its own. There are three levels. Each needs a little more access and gives a more exact copy.

LevelWhat it needsWhat you get
No setupOnly the app's own login.The rows the app was shown. They may differ slightly from the starting rows, and the copy says so.
Separate read-only loginA plain read-only login that Crumbtrail uses on its own connection.Nothing extra is sent on the app's connection. Rows are read just after each statement, so they can be slightly newer than the app saw. The copy says so.
Change historyA login that may read the database's change history, set up by whoever runs the database.The exact starting rows.

The connection method can use the app’s existing access; other methods can need an administrator’s help. The recording says which method was used and why.

Pick a level. Pass the method with --copy-method: auto (the default), connection or history. For the read-only login, add --read-login and name the variable that holds its connection string with --history-env. Keep the value in the variable, never on the command line.

Terminal · separate read-only login
read -r -s -p "Read-only login URL: " SHOP_READ_LOGIN
export SHOP_READ_LOGIN
crumbtrail record --collect-copy --read-login --history-env shop=SHOP_READ_LOGIN
Terminal · change history
crumbtrail record --collect-copy --copy-method history --history-env shop=SHOP_HISTORY --publication shop=app_history

With no change-history access, --keep-rows decides which rows are kept. auto (the default) also keeps useful PostgreSQL and MySQL rows that are not proven, and labels the copy Incomplete. proven keeps only rows proven to be the starting rows. shown keeps useful rows for every database and says what proof is missing.

To see what a database allows before you record, run this. It changes nothing.

Terminal · check access first
crumbtrail copies preflight --database shop=postgres://db.internal:5432/shop --history-env shop=SHOP_HISTORY
03

Run your app on a copy

Open the recorded rows as a small real copy of the databases. The originals can be switched off.

Terminal · open the newest recording as a copy
crumbtrail open

It prints the recording it picked, then an address and login for each database, and keeps running. Leave it open. For another recording, add --input PATH.

Point the unchanged app at those addresses and restart its connection pool. Or let Crumbtrail start the app already pointed at the copy:

Terminal · start the app against the copy
crumbtrail app run --setup default --to copy

--to also accepts original and recorder.

Signing in. Database copies (Beta) replace recognised stored password fields so you can use a test password. Check the replacement limits. Choose a test password with --login-password-env, and limit it to one user with --login-user. With no choice, a built-in development password is used for every user.

Terminal · set a test password for one user
export COPY_LOGIN_PASSWORD="Testuser123!"
crumbtrail open --login-password-env COPY_LOGIN_PASSWORD --login-user [email protected]

Where the copy lives: on this computer by default. Crumbtrail finds Docker through DOCKER_HOST, your active Docker context, then the usual sockets of Docker Desktop, OrbStack, Colima and Rancher Desktop (the named pipe on Windows). Use --place-ssh SERVER to keep it on a server you log in to, or --place-aws REGION to make it a new database in your own cloud account.

If a recording is Incomplete, open loads it as a diagnostic copy and says so. Add --strict to refuse instead.

04

Respond to the app from the recording (mock)

A mock responds to the app's calls from a recording, for supported calls without contacting their original destination. Calls with no recorded response are not forwarded.

Terminal · mock a database from a recording
crumbtrail replies serve --input ./task --route 0=postgres://db.internal:5432

Port 0 picks a free port. Point the app at the address the command prints, or put the app's start command after --.

Useful options: --answer-delay recorded makes responses take as long as they did in the recording. --save-results no skips saving what the mock saw. --output DIR sets where it is saved. Stop with Ctrl+C.

05

Replay the task against your app

Replay sends the recorded requests to your running app and compares its responses and errors with the recording. Run the app on a copy (step 3) first, then:

Terminal · replay the recorded requests
crumbtrail trials run --input ./task --target http://127.0.0.1:8080 --output ./trial

Replace the address with the one your app listens on. Cookies and issued values carry into later requests, and recorded sign-ins use the test password if you pass --login-password-env.

OptionWhat it does
--repeat NSends the whole recording this many times.
--check-errorsReplays the recorded errors and reports whether each one still happens.
--new-differences failLabels each difference as new. On Team and Enterprise a replay already fails the build by default: exit 3 when a response changed, 4 when one needs review. --new-differences allow always exits 0. Free shows every changed response, exits 0 and does not have this option.
--baseline DIRCompares with an earlier replay. Only differences not in it count as new.
--learn-noiseRun once on the unchanged app. Sets aside response fields that change on every call, such as a short random code, and saves them in .crumbtrail/replay-noise.txt for later replays.
--mock-status-port PORTPort of the mock's status page (replies serve --status-port). After the last request the replay asks which outside calls the app made. Without it, outside calls after the last request read as needs review (exit 4).
--wait-for-follow-on TIMEHow long to keep the app running after the last request so its background outside calls can happen. The default is the time the recording shows; off stops at once.
--reject-when RULEFails the run (exit 1) when a measured value breaks a rule, such as latency.max>1000.
trials planShows where requests would go, without sending any.

Replay shows whether the responses and errors came back the same. Whether a fix worked is your call.

06

Reset and try again

Stop the app's database connections, then put the copy back to its starting rows.

Terminal · reset the copy
crumbtrail reset

The copy keeps its addresses. Restart the app's connection pool and repeat the task. If connections are still open, reset refuses. Add --disconnect to end them. Their uncommitted work is lost.

To finish, press Ctrl+C in the window running open.

07

Read the results

Start with the copy. When it is Incomplete, one sentence says which tables may differ and whether the bug will probably still show. The codes are under Details.

Terminal · what a recording saved
crumbtrail copies show --input ./task
crumbtrail show YOUR-RECORDING.crumb

Then check the responses. This runs the recorded database calls on throwaway copies:

Terminal · check the recorded responses
crumbtrail copies check --input ./task
CountHow to read it
MatchedThe copy gave the recorded response.
DifferentThe copy responded differently. Read the difference before trusting the copy.
Not comparableThe recording lacked what was needed to compare. This is unchecked, not passed.

A matched count proves only the calls that were checked. Running the task in your app is what shows the bug.

For a replay, score the saved evidence:

Terminal · score a replay
crumbtrail reports quality ./trial

Browse recordings in a window with crumbtrail desk serve, or in the terminal with crumbtrail desk browse --input ./task. Other reports: reports traffic, reports queries, reports changes and reports answers.

No database, replays and load tests

A database is optional. In the console, open Settings, then Apps, then Add an app and press My app has no database. Give the address your app listens on, for example http://127.0.0.1:4000, and say whether Crumbtrail starts the app or you do. Recording, mocking, replaying and load tests all work without one.

Add a recording. On the Recordings page, press Add recording. Choose a session.crumb file, a recording folder, or a file a teammate sent. Recordings made on the command line appear in the list on their own.

Replay. Open Replay, pick a recording, give the address of the new build of your app and press Start replay. The results list every response that changed, Before beside Now.

Load test. Open Load tests, pick a recording, give the address, and set how many virtual users, for how long and what counts as good enough. Press Start load test. The results show requests a second, response times and errors, and each goal as Met or Missed. Settings are saved under a name for the next run.

If something goes wrong

What you seeWhat to do
A message to run init firstSave a setup (step 1), or pass the options yourself and add --no-setup.
The command lists setup names and stopsYou have several saved setups. Pick one with --setup NAME.
Copy method says rows may differ slightlyOnly the app's own login (or a read-only login) was available. Ask whoever runs the database for change-history access to get exact rows, or accept the note.
The recording is IncompleteRead each reason and its next step. Record again if a table you need was not read.
Reset refusesThe app still holds connections. Stop the app, or add --disconnect.
Sign-in fails on the copyUse the copy's test password and a user who is in the recording.

Command reference

CommandWhat it does
initSave a setup. Also --list and --show NAME.
recordRecord with a saved setup.
openOpen the newest recording as a copy.
resetPut the copy back to its starting rows.
show FILERead a recording as plain text.
app runStart the app against the original, the recorder or a copy.
copies preflightCheck database access. Changes nothing.
copies buildBuild a copy from a recording without starting it.
copies openStart a copy, building it first when given a recording.
copies showRead what a recording saved.
copies checkCheck recorded responses on throwaway copies.
copies resetReset a copy.
replies serveMock: respond to the app from recordings.
trials runReplay recorded requests against your app.
trials planShow where a replay would send requests.
trials noiseList the fields replays set aside.
reports qualityScore saved replay evidence.
reports coverageShow which endpoints the recording and replays tested. --fail-on-gaps exits 3 on a gap.
desk serveBrowse recordings in a local web page.
desk browseBrowse recordings in the terminal.
tryRecord and replay a built-in sample shop, and see a changed response get caught.
supportFree only: list the systems and databases Free supports.

Test changes and local checks

CommandWhat it does
check bootstrapMake your first check on this computer: crumbtrail check bootstrap --from-app ./my-app. Copy fixtures and CI pipelines are in Team and Enterprise.
check addSave a recording as a local check: crumbtrail check add ./task. Free saves any number of checks on this machine. The first three by name never expire, and the check exits 0; check pipeline writes the file that runs and fails pull requests in Team and Enterprise.
start and stopRecord your app with one command, then save the task as a check, replay it once and see PASS or DIFFERENT: crumbtrail start, then crumbtrail stop. Paid builds.
sessions suggest-firstFind the service and routes to record first, without reading secret files. Add --path ./my-app.
watchCapture requests while you develop: crumbtrail watch -- npm run dev. watch list shows them and watch promote turns them into checks.
guardRun a coding assistant with your protected checks sealed, then verify its scope, checks, tests and diff coverage: crumbtrail guard -- ASSISTANT-COMMAND.
journeys recordRecord clicks in Chrome or Edge as a test: crumbtrail journeys record --target-port 3000 --output ./journey. Beta
journeys runRun the clicks again and see which step responds differently: crumbtrail journeys run --input ./journey --target http://127.0.0.1:3000. Beta
reports specCheck recorded responses against an OpenAPI description, a .proto file or a GraphQL schema: crumbtrail reports spec --spec api.proto -i ./task.
show --piecesRead each streamed response piece by piece, with the time each piece arrived: crumbtrail show --pieces ./task.
record --routeRecord RabbitMQ over an unencrypted connection with --route 0=amqp://HOST:PORT. Use nats:// for NATS.

Catch errors and privacy

CommandWhat it does
record --save-on-errorSave a request that ends in a server error. First set CRUMBTRAIL_ERROR_ORIGINAL to a read-only database connection, then run crumbtrail record --save-on-error --target-port 8080 --route 0=postgres://HOST:PORT and start your app yourself. Team and Enterprise.
sessions errors listList the saved errors. Team and Enterprise.
repro makePut a saved error in one file: crumbtrail repro make --error ID --output error.crumbrepro. Enterprise. Beta
repro openSee whether the error comes back: crumbtrail repro open error.crumbrepro. Opening a file can run commands and write files on your computer, so open only files from people you trust. A file from another computer also needs --trust-this-file. Enterprise. Beta
copies find-privatePropose rules for private data your rules miss, from your PostgreSQL database. Add --original-env SHOP_DB, the variable that holds its address. Team and Enterprise.
copies personList the rows linked to one person: crumbtrail copies person --database-env SHOP_DB --start public.users.id=42. copies person-plan plans the delete. PostgreSQL, Enterprise. Beta
copies audit-packWrite one file that says what a copy replaced: crumbtrail copies audit-pack --input ./task. Enterprise. Beta

Copies, rollouts and team tools

CommandWhat it does
copies resetPut a copy back to its starting point. Add --copy-dir DIR. Team and Enterprise. Beta
copies shrinkShrink a PostgreSQL copy to the rows its recorded responses need: crumbtrail copies shrink --copy-dir DIR --output SMALL --by-answers. Enterprise. Beta
outbound addAdd a place for replay results: crumbtrail outbound add --kind chat --name TEAM --address-env CHAT_ADDRESS. Kinds are chat, ticket, otlp and metrics. Then run outbound test ID and outbound on ID. Sign in with cloud sign-in as an administrator. Team and Enterprise. Preview
cluster rollout gateHold a Kubernetes rollout unless 95% of recorded calls respond the same: crumbtrail cluster rollout gate --namespace shop --name orders --result out --same-answers-goal 95 -- crumbtrail trials run --input ./task --target http://canary --output out. Team and Enterprise. Preview

Free usage and error reports

Free always sends usage and error reports to Crumbtrail; they cannot be switched off. Reports never include your recordings, addresses, queries, headers, names, passwords or tokens. See the Privacy Policy.

Paid no-reports builds send nothing out by default; connecting your own AI service for the assistant is a separate choice.

Reports use a fixed field list: report kind, command category, product version, edition, operating system, architecture, duration and call-count ranges, error category, licence check result, a random installation ID, report format version and event hour. The list excludes recording contents, query text, passwords and error text.

The installation ID connects reports from the same installation across upgrades. Use crumbtrail reports preview to inspect pending reports in the current run. Reports can be lost when the network is unavailable or the tool exits; your command still runs.