| Crates.io | vibesql-cli |
| lib.rs | vibesql-cli |
| version | 0.1.3 |
| created_at | 2025-12-04 05:06:14.307747+00 |
| updated_at | 2025-12-09 08:04:19.052274+00 |
| description | Command-line interface for vibesql SQL database |
| homepage | |
| repository | https://github.com/rjwalters/vibesql |
| max_upload_size | |
| id | 1965909 |
| size | 224,010 |
Command-line interface for VibeSQL, providing interactive SQL querying and database management.
\help, \q, \d, \dt, \timingvibesql -f script.sqlcat queries.sql | vibesql or vibesql --stdinvibesql -c "SELECT * FROM users"vibesql -f script.sql -v\ds (schemas), \di (indexes), \du (roles/users)\f <format> or --format flag# Start interactive session
cargo run --bin vibesql
# Start with specific database
cargo run --bin vibesql -- --database mydb.vsql
# Execute single SQL command
cargo run --bin vibesql -- -c "SELECT 1"
# Execute single SQL command with verbose output
cargo run --bin vibesql -- -c "SELECT 1" -v
# Execute SQL from file
cargo run --bin vibesql -- -f script.sql
# Execute SQL from file with verbose output and summary
cargo run --bin vibesql -- -f script.sql --verbose
# Execute with specific output format
cargo run --bin vibesql -- -f script.sql --format json
cargo run --bin vibesql -- -f script.sql --format csv
# Execute from stdin (auto-detected when piped)
cat queries.sql | cargo run --bin vibesql
# Or explicitly request stdin
cargo run --bin vibesql -- --stdin < queries.sql
# Pipe from other commands with specific format
echo "SELECT 1; SELECT 2;" | cargo run --bin vibesql -- --format json
# Table format (default, ASCII tables)
cargo run --bin vibesql -- -c "SELECT * FROM users" --format table
# JSON format (array of objects)
cargo run --bin vibesql -- -c "SELECT * FROM users" --format json
# CSV format (comma-separated values)
cargo run --bin vibesql -- -c "SELECT * FROM users" --format csv
\d [table] - Describe table or list all tables
\dt - List tables
\ds - List schemas
\di - List indexes
\du - List roles/users
\f <format> - Set output format (table, json, csv)
\timing - Toggle query timing
\h, \help - Show help
\q, \quit - Exit
vibesql> \f json
Output format set to: json
vibesql> SELECT * FROM users;
[
{"id": "1", "name": "Alice"},
{"id": "2", "name": "Bob"}
]
vibesql> \f csv
Output format set to: csv
vibesql> SELECT * FROM users;
id,name
1,Alice
2,Bob
vibesql> \f table
Output format set to: table
$ vibesql
VibeSQL v0.1.0 - SQL:1999 FULL Compliance Database
Type \help for help, \quit to exit
vibesql> CREATE TABLE users (id INT PRIMARY KEY, name VARCHAR(100));
Table created successfully
vibesql> INSERT INTO users VALUES (1, 'Alice'), (2, 'Bob');
2 rows inserted
vibesql> SELECT * FROM users;
+----+-------+
| id | name |
+----+-------+
| 1 | Alice |
| 2 | Bob |
+----+-------+
2 rows
vibesql> \d users
Table: users
Columns:
id INT PRIMARY KEY
name VARCHAR(100)
vibesql> \quit
Goodbye!
The CLI is organized into modules:
main.rs - Entry point, CLI argument parsing, and mode selectionrepl.rs - Interactive REPL implementationexecutor.rs - SQL execution wrapper (SELECT, CREATE, INSERT, UPDATE, DELETE)formatter.rs - Result formatting (table, CSV, JSON)commands.rs - Meta-command parsing and handlingscript.rs - Batch SQL execution from files and stdindata_io.rs - Data import/export utilities (CSV, JSON)error.rs - CLI-specific error typesclap 4 - Command-line argument parsingrustyline 13 - Line editing and historyprettytable-rs 0.10 - Table formattingserde_json 1.0 - JSON formattingcsv 1.3 - CSV parsing and formattinganyhow 1.0 - Error handlingatty 0.2 - Terminal detection for stdin piping