@nivincp/dcli
v1.0.8
Published
Simple CLI to query, get, delete, or truncate DynamoDB records using PK/SK.
Downloads
30
Readme
dcli - DynamoDB CLI Tool
A simple command-line tool to interact with DynamoDB tables.
You can use it to find, get, delete, or clear items from your tables. Useful for development and maintenance.
Features
- Find all items by partition key
- Get a single item by partition and sort key
- Delete a single item by partition and sort key
- Delete all items with a specific partition key (truncate model)
- Output results as JSON
Usage
Usage:
dcli <tableName> <mode> <pk> [sk]
dcli [--version | version]
dcli [--help | help]
Modes:
find Query all items by partition key (optionally filter by sort key prefix)
get Fetch a single item by partition key and sort key
delete Remove a single item by partition key and sort key
truncate Delete all items under a given partition key (optionally filter by sort key prefix)
Arguments:
tableName DynamoDB table name (e.g. my-table)
pk Partition key (e.g. "users")
sk Sort key (required for get/delete; optional prefix for find)
Examples:
dcli my-table find users
dcli my-table find users user:
dcli my-table get users user:01ABCD...
dcli my-table delete users user:01XYZ...
dcli my-table truncate users
dcli --versionSetup
This CLI uses your local AWS credentials. Make sure you have a valid AWS profile configured.
export AWS_PROFILE=your-profile-nameInstallation
npm install -g @nivincp/dcli
# or run directly without installing:
npx @nivincp/dcli