@tmpdb/cli
v0.1.6
Published
Zero-setup databases - spin up Postgres, MySQL, MongoDB, Redis instantly for testing and prototyping
Maintainers
Readme
tmpdb CLI
Zero-setup databases - spin up disposable databases instantly for testing, prototyping, and rapid iteration.
Installation
npm install -g @tmpdb/cliQuick Start
# Create a new Postgres database
tmpdb create postgres
# Get database info and connection string (secure: explicit token required)
tmpdb info <database-id> -t <secret-token>
# Delete a database (secure: explicit token required)
tmpdb delete <database-id> -t <secret-token>
# Export database data (secure: explicit token required)
tmpdb export <database-id> --format json -t <secret-token>Token Management
Secure Workflow (Recommended):
tmpdb create postgres
# Save the displayed secret token manually
tmpdb info <id> -t <your-secret-token> # Explicit & secure
tmpdb delete <id> -t <your-secret-token> # Explicit & secure
tmpdb export <id> -t <your-secret-token> # Explicit & secure
tmpdb extend <id> 48 -t <your-secret-token> # Explicit & secureConvenience Workflow:
tmpdb create postgres --save-token
tmpdb info <id> # Works automatically
tmpdb delete <id> # Works automatically
tmpdb export <id> # Works automatically
tmpdb extend <id> 48 # Works automaticallyNote: Manual token management is more secure for production use.
Commands
create [type]- Create a new database (postgres, mysql, mongodb, redis)info <id>- Get database information and connection details (requires secret token via -t or auto-save)delete <id>- Delete a database (requires secret token via -t or auto-save)extend <id> [hours]- Extend database expiration (requires secret token via -t or auto-save)export <id>- Export database data (requires secret token via -t or auto-save)
Global Options
--json- Output in JSON format--verbose- Verbose output
Examples
# Create a Redis database with 6-hour TTL
tmpdb create redis --ttl 6
# Get only the connection string (secure)
tmpdb info db123abc --connection-only -t YourSecretTokenHere
# Export as SQL file (secure)
tmpdb export db123abc --format sql --output backup.sql -t YourSecretTokenHere
# Delete a specific database (secure)
tmpdb delete db123abc -t YourSecretTokenHere --force
# Extend database expiration (secure)
tmpdb extend db123abc 48 -t YourSecretTokenHereDatabase Types
- postgres - PostgreSQL database
- mysql - MySQL database
- mongodb - MongoDB database
- redis - Redis cache/database
Features
- Secure by default - Explicit token management for all database operations
- Cross-platform - Works on Mac, Windows, and Linux
- Multiple output formats - Human-readable or JSON
- Smart error handling - Clear error messages and suggestions
- Multiple database types - Postgres, MySQL, MongoDB, Redis support
