Browse documentation

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 .dnml files.
  • 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

CommandWhat 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.

dynomate-cli requests run ./orders/find-and-update-order.dnml
find-and-update-order: success
Find recent order: success
result: {"count":1,"items":[{"accountId":"account#42","orderId":"order#9812","status":"PENDING","total":42}],"lastEvaluatedKey":"eyJvcmRlcklkIjp7IlMiOiJvcmRlciM5ODEyIn0sImFjY291bnRJZCI6eyJTIjoiYWNjb3VudCM0MiJ9fQ==","pages":1,"requestId":"1f999a0f-0ec9-4dba-bd58-c012239a26db","scannedCount":1}
Mark reviewed: success
result: {"attributes":{"accountId":"account#42","orderId":"order#9812","status":"REVIEWED","total":42},"requestId":"38ea89c4-6e57-48d5-a038-66ab17034323"}
Read back: success
result: {"found":true,"item":{"accountId":"account#42","orderId":"order#9812","status":"REVIEWED","total":42},"requestId":"d2946fe3-e6b1-4ede-a4ce-aa4cd1365319"}
This run used DynamoDB Local through the saved endpoint of the commerce-dev profile.

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 typeWhat the CLI needs
SSOA 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 LoginA valid session in ~/.aws/login/cache. Sign in with the AWS CLI or the app first.
MFAMFA 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_processHandled by the AWS SDK.

Environment variables

  • AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN are read, and normally take precedence over profile credentials.
  • AWS_CONFIG_FILE and AWS_SHARED_CREDENTIALS_FILE are honored.
  • AWS_PROFILE does not select the profile. Use --profile or profileName.

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 NAME loads one. See Variables and environments.
  • Default exports. A dynamodb.export without a path writes to the exports folder.
  • Local SQL snapshots. An export with snapshot = true registers 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 the Name tag 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

PlatformDirectory
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:

Shell
DYNO_APP_DATA_DIR=/path/to/app-data dynomate-cli requests run ./orders/find-and-update-order.dnml
  • 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 run fails with APP_DATA_UNAVAILABLE. Set DYNO_APP_DATA_DIR.

Get help

Add --help to a command to see its subcommands and options:

Shell
dynomate-cli requests --help
Run DNML requests or migrate legacy collections
 
Usage: dynomate-cli requests <COMMAND>
 
Commands:
run Run one DNML request by FILE or by --collection and --request
migrate Convert a legacy collection to DNML while preserving the original files
help Print this message or the help of the given subcommand(s)
 
Options:
-h, --help Print help