Install the get-dotenv host (optional peer) and wire the DynamoDB plugin.
npm i -D @karmaniverous/get-dotenv@^8.0.0
Create a host CLI
// mycli.ts
import { createCli } from '@karmaniverous/get-dotenv/cli';
import { awsPlugin } from '@karmaniverous/get-dotenv/plugins';
import { dynamodbPlugin } from '@karmaniverous/entity-client-dynamodb/get-dotenv';
const run = createCli({
alias: 'mycli',
importMetaUrl: import.meta.url,
compose: (p) => p.use(awsPlugin().use(dynamodbPlugin())),
});
await run(process.argv.slice(2));
Notes
importMetaUrl is required by get-dotenv 8 so host identity and packaged config resolve from the host package, not from get-dotenv itself.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