Access Data, Connections, and Gateway Address
How TBT receives access data, how connection profiles map to environment variables, how the gateway address gets resolved, and the full list of commands and options.
Basic Principle
Secret data never goes in commands. Anyone can see a command's contents, since they land in terminal history and often get printed in automated system logs. That's why all secret data is provided through environment variables instead.
Variable Names
Every connection profile named in the mapping file gets its own variable prefix: the profile name in uppercase, with anything that isn't a letter or digit swapped for an underscore. So the profile prod-corebanking becomes the prefix TBT_PROD_COREBANKING_.
Platform access data (all three are required):
| Variable | Content |
|---|---|
TBT_<PROFILE>_ACCESS_TOKEN | Created in the platform, Access Token menu |
TBT_<PROFILE>_USER_KEY | Account user key |
TBT_<PROFILE>_TENANT | Tenant name, example default |
Database connection (used by the draft command and to connect to the source database):
| Variable | Content |
|---|---|
TBT_<PROFILE>_DB_TYPE | mysql, mariadb, postgresql, mssql, oracle, sqlite, or clickhouse |
TBT_<PROFILE>_DB_HOST | Database address |
TBT_<PROFILE>_DB_PORT | Database port |
TBT_<PROFILE>_DB_USER | Database user name |
TBT_<PROFILE>_DB_PASSWORD | Database password |
TBT_<PROFILE>_DB_NAME | Database name |
TBT_<PROFILE>_DB_SCHEMA | For Oracle and PostgreSQL; written separately from the database name |
TBT_<PROFILE>_DB_SSL | false by default; to enable, set to 1, yes, y, on, require, or required |
TBT_<PROFILE>_DB_CERT | Database CA certificate, if DB_SSL is enabled |
Gateway Address
Just type the gateway host name or IP address. The rest is completed automatically:
| What Is Typed | What TBT Uses |
|---|---|
Without http:// or https:// | https:// is added automatically |
| Without a path | /api is added automatically, unless the host name starts with gw- |
| Already has a path | Used as is |
- The
gw-prefix is only checked on the host name. Example:gw-dev.example.com:8082qualifies, whilemygw-dev.example.comdoes not. Development gateways with thegw-prefix are contacted directly, so/apimust not be added. - The address can be provided through the
--gatewayoption, theTBT_GATEWAYvariable, or typed on the menu screen when prompted. Commands without a screen (run,resume,retry,validate,preview) still require an address from one of these methods.
TBT tests the address before you type any access data. It calls the gateway's /health endpoint, which needs no access data and responds with {"status":"ok", ...}. A mistyped address usually gets answered by some other web page, which this check catches immediately, before your access token ever gets sent to the wrong place. Test it manually with:
curl -s https://<gateway-address>/api/health
Connection Profiles Saved From the Menu Screen
Profiles saved from the menu screen live in ~/.config/tbt/connections.yaml (fallback: ./.tbt/connections.yaml), readable only by their owner. This file never stores passwords or platform tokens, and it'll refuse to load if it somehow ends up containing either.
Commands and Menu Screen
| What You Want to Do | Command |
|---|---|
| Open the menu screen | ./run.sh (without additional commands) |
| Check the mapping without changing anything | ./run.sh validate --mapping m.yaml |
| View original values and their results without changing | ./run.sh preview --mapping m.yaml |
| Run the job | ./run.sh run --mapping m.yaml |
| Continue a stopped job | ./run.sh resume --run <folder> --mapping m.yaml |
| Reprocess only refused records | ./run.sh retry --run <folder> --mapping m.yaml |
| Create a mapping from a table | ./run.sh pick (screen) or ./run.sh draft --connection c --table t |
| Save the mapping as a review sheet (CSV) | ./run.sh export --mapping m.yaml |
| Apply an edited review sheet | ./run.sh import --mapping m.yaml --sheet s.csv |
| View all runs and their final results | ./run.sh history [--run <folder>] |
| View the version | ./run.sh version |
history only reads run folders. It needs no database, gateway, or access data, so its output can double as proof of execution.
Run TBT without extra commands and it opens the menu screen in this order: 1. Build a mapping from a table, 2. Open a mapping, 3. Continue a stopped run, 4. Retry refused records, 5. History. Menus 3 and 4 only show run folders that still need follow-up: ones with a checkpoint or a failures.jsonl file with content. Finished runs show up in History only.
Additional Options
All optional. The defaults work fine for most jobs.
| Option | Default | Function |
|---|---|---|
--mapping | — | Mapping file (YAML or JSON) |
--gateway | value of TBT_GATEWAY | Gateway address |
--results | results | Folder where run results are stored |
--run | — | Existing run folder, for resume or retry |
--batch | 250 | Number of rows per group (window) |
--concurrency | 10 | Number of requests to the gateway running at the same time |
--db-connections | 10 | Number of connections to each database (intentionally separate from --concurrency) |
--pacing | 0 | Pause between groups, for busy databases |
--rate-limit | 0 | Limit of requests to the gateway per second; 0 = unlimited |
--sample | 5 | Number of sample rows shown by preview |
--yes | off | Skip confirmation (for automated processes) |
--json | off | Results in JSON format for other programs to read |
For how to read run results and avoid data loss, see Run Results and Data Safety.