Dynomate CLI
dynomate-cli runs DNML request files from a terminal, a script or a CI job.
To get the CLI, see Install the Dynomate CLI.
One runtime
The app and the CLI use one DNML runtime. They have:
- The same
.dnmlfiles. - The same validation before any AWS call, with the same error codes.
- The same operation order, statuses, skip reasons and results.
- The same safety rules. Table deletes, truncates and endpoints in the request need confirmation in the app and approval in the CLI. Amazon Aurora DSQL operations need no confirmation or approval.
Commands
| Command | What it does |
|---|---|
requests run | Runs one DNML request and prints the result. |
requests migrate | Converts a legacy TOML collection to DNML and keeps the original files. |
table import | Imports items into a DynamoDB table from a JSON or CSV file, S3, another table or standard input. |
For scripts and CI jobs, see Automation and CI.
Running example
The CLI tab shows a run with requests run.
orders/find-and-update-order.dnml version = "1.0"name = "find-and-update-order"description = "Find the most recent order for an account, mark it reviewed, and read it back."[variables]accountId = "account#42"pageSize = "1"[defaults]profileName = "commerce-dev"[[dynamodb.query]]name = "Find recent order"tableArn = "arn:aws:dynamodb:ap-southeast-2:111122223333:table/Orders"keyConditionExpression = "accountId = :accountId"limit = "${cast(pageSize, 'integer')}"scanIndexForward = false[dynamodb.query.expressionAttributeValues]":accountId" = "${accountId}"[[dynamodb.update]]name = "Mark reviewed"dependsOn = "Find recent order"tableArn = "arn:aws:dynamodb:ap-southeast-2:111122223333:table/Orders"updateExpression = "SET #status = :status"[dynamodb.update.keyValues]accountId = "${accountId}"orderId = "${find_recent_order.items[0].orderId}"[dynamodb.update.expressionAttributeNames]"#status" = "status"[dynamodb.update.expressionAttributeValues]":status" = "REVIEWED"[[dynamodb.get]]name = "Read back"dependsOn = "Mark reviewed"tableArn = "arn:aws:dynamodb:ap-southeast-2:111122223333:table/Orders"consistentRead = true[dynamodb.get.keyValues]accountId = "${accountId}"orderId = "${find_recent_order.items[0].orderId}" AWS credentials
The CLI uses your existing AWS sign-in. It does not sign in for you. It uses the AWS SDK credential chain with the profile from --profile in table import, or from profileName in a request. A request without a profile uses default. Profiles come from your AWS config and credentials files.
| Profile type | What the CLI needs |
|---|---|
| SSO | A valid session in ~/.aws/sso/cache. If it is missing or expired, run aws sso login --profile NAME or sign in with the app. |
| AWS Login | A valid session in ~/.aws/login/cache. Sign in with the AWS CLI or the app first. |
| MFA | MFA session credentials that the app cached in ~/.aws/cli/cache. The CLI does not ask for an MFA code, so complete MFA in the app first. Other AWS CLI cache entries may not work. |
Assume role and credential_process | Handled by the AWS SDK. |
Environment variables
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEYandAWS_SESSION_TOKENare read, and normally take precedence over profile credentials.AWS_CONFIG_FILEandAWS_SHARED_CREDENTIALS_FILEare honored.AWS_PROFILEdoes not select the profile. Use--profileorprofileName.
App data directory
requests run uses the app data directory of the app for:
- Saved profile endpoints. Custom endpoints saved on a profile in the app. See Endpoints.
- Global environments.
--global-env NAMEloads one. See Variables and environments. - Default exports. A
dynamodb.exportwithout a path writes to theexportsfolder. - Local SQL snapshots. An export with
snapshot = trueregisters its snapshot for the app. See Local SQL snapshots. - Aurora DSQL network settings. The route, TLS level and trusted certificates for each cluster ARN, and the imported CA bundles in
dsql-ca. Without them, the CLI uses the public endpoint and the system trust store. See Aurora DSQL network settings. - Cluster names. The
Connections:summary shows the name of each cluster that the app saved. The name comes from theNametag of the cluster.
--collection-env reads from the collection folder, not from app data. table import uses your AWS profile, not app data. See Profiles.
Default location
| Platform | Directory |
|---|---|
| macOS | ~/Library/Application Support/com.dynomate.app |
| Windows | %APPDATA%\com.dynomate.app |
| Linux | $XDG_DATA_HOME/com.dynomate.app, usually ~/.local/share/com.dynomate.app |
Choose another directory
Set DYNO_APP_DATA_DIR to use a different directory:
- The app reads the same variable, so both can share one directory.
- If a CI run must not use saved settings, set an empty directory or no directory. Aurora DSQL operations then use the public endpoint and the system trust store.
- If the CLI cannot find a directory,
requests runfails withAPP_DATA_UNAVAILABLE. SetDYNO_APP_DATA_DIR.
Get help
Add --help to a command to see its subcommands and options: