CLI Overview
Command-line interface for Toolless
The Toolless CLI provides powerful commands to interact with your databases directly from the terminal.
Installation
Install globally for CLI access:
npm install -g toollessdbAvailable Commands
| Command | Alias | Description |
|---|---|---|
list | ls | List databases and collections |
query | q | Query documents |
insert | i | Insert a document |
update | u | Update documents |
delete | d | Delete documents |
export | - | Export collection to JSON |
import | - | Import JSON into collection |
compact | - | Compact collection files |
drop | - | Drop a collection |
index | - | Manage indexes |
stats | - | Show database statistics |
shell | sh | Interactive REPL |
studio | - | Launch web UI |
Global Options
All commands support these options:
| Option | Description | Default |
|---|---|---|
-p, --path | Path to database directory | ./data |
--help | Show command help | - |
Database Directory
The CLI uses ./data as the default database directory — always relative to your current working directory. This is a fixed convention with no configuration file needed.
# Run from your project root (where ./data lives)
toollessdb list # lists databases in ./data
toollessdb query mydb users # reads from ./data/mydb
# Override with --path for a custom location
toollessdb query mydb users -p /custom/pathAlways run CLI commands from the directory that contains your ./data folder. The CLI does
not walk up parent directories to find databases.
Quick Examples
# List all databases
toollessdb list
# Query users collection
toollessdb query myapp users -f '{"active": true}'
# Insert a document
toollessdb insert myapp users '{"name": "Alice", "email": "alice@example.com"}'
# Update documents
toollessdb update myapp users '{"name": "Alice"}' '{"$set": {"verified": true}}'
# Delete documents
toollessdb delete myapp users '{"inactive": true}' --many
# Launch studio
toollessdb studio ./data
# Interactive shell
toollessdb shell -d myappUse toollessdb <command> --help to see detailed options for any command.