Install the get-dotenv host (optional peer) and wire the DynamoDB plugin.
npm i -D @karmaniverous/get-dotenv
Create a host CLI
// mycli.ts
import { createCli } from '@karmaniverous/get-dotenv';
import { awsPlugin } from '@karmaniverous/get-dotenv/plugins';
import { dynamodbPlugin } from '@karmaniverous/entity-client-dynamodb/get-dotenv';
const run = createCli({
alias: 'mycli',
compose: (p) => p.use(awsPlugin().use(dynamodbPlugin())),
});
await run(process.argv.slice(2));
Notes
aws plugin, so commands live under the aws dynamodb path."aws/dynamodb" (not "dynamodb").Minimal config (getdotenv.config.json; aws parent)
{
"plugins": {
"aws/dynamodb": {
"tablesPath": "./tables",
"tokens": {
"table": "table",
"entityManager": "entityManager",
"transform": "transform"
}
}
}
}
Next