Command Reference
This is a comprehensive reference for all SQLsaber commands and their options.
The main SQLsaber command for running queries.
Usage:
# Interactive mode (default)saber
# Single querysaber "How many users do we have?"
# With specific databasesaber -d my-database "Show me recent orders"
# With connection stringsaber -d "postgresql://user:pass@host:5432/db" "User statistics for 2024"Parameters:
QUERY-TEXT- SQL query in natural language (optional, starts interactive mode if not provided)-d, --database- Database connection name, file path (CSV/SQLite/DuckDB), or connection string (postgresql://, mysql://, duckdb://)--thinking/--no-thinking- Enable/disable extended thinking/reasoning mode
Global Options:
--help, -h- Display help message--version- Show version information
saber auth
Section titled “saber auth”Manage authentication configuration for AI providers.
saber auth setup
Section titled “saber auth setup”Configure authentication for SQLsaber (API keys and OAuth).
Usage:
saber auth setupsaber auth status
Section titled “saber auth status”Check current authentication configuration.
Usage:
saber auth statusOutput shows:
- Configured providers
- Authentication methods (API key vs OAuth)
saber auth reset
Section titled “saber auth reset”Remove stored credentials for a provider.
Usage:
saber auth resetsaber db
Section titled “saber db”Manage database connections.
saber db add
Section titled “saber db add”Add a new database connection.
Usage:
saber db add my-database [OPTIONS]Parameters:
NAME- Name for the database connection (required)
Options:
-t, --type- Database type:postgresql,mysql,sqlite,duckdb(default: postgresql)-h, --host- Database host-p, --port- Database port--database, --db- Database name-u, --username- Username--exclude-schemas- Comma-separated list of schemas to skip during introspection--ssl-mode- SSL mode (see SSL options below)--ssl-ca- SSL CA certificate file path--ssl-cert- SSL client certificate file path--ssl-key- SSL client private key file path--interactive/--no-interactive- Use interactive mode (default: true)
SSL Modes:
PostgreSQL:
disable- No SSLallow- Try SSL, fallback to non-SSLprefer- Try SSL first (default)require- Require SSLverify-ca- Require SSL and verify certificateverify-full- Require SSL, verify certificate and hostname
MySQL:
DISABLED- No SSLPREFERRED- Try SSL first (default)REQUIRED- Require SSLVERIFY_CA- Require SSL and verify certificateVERIFY_IDENTITY- Require SSL, verify certificate and hostname
saber db list
Section titled “saber db list”List all configured database connections.
Usage:
saber db listOutput shows:
- Database names
- Connection details (host, port, database)
- Any excluded schemas configured for the connection
- Default database indicator
saber db exclude NAME
Section titled “saber db exclude NAME”Update or inspect schema exclusions for an existing database connection.
Usage:
saber db exclude my-database [--set SCHEMAS | --add SCHEMAS | --remove SCHEMAS | --clear]Options:
--set— Replace the exclusion list entirely with the provided comma-separated schemas--add— Append schemas to the current exclusion list (duplicates are ignored)--remove— Remove the provided schemas from the exclusion list--clear— Remove all exclusions
Run without flags to interactively edit the exclusion list.
saber db set-default NAME
Section titled “saber db set-default NAME”Set a database as the default connection.
Usage:
saber db set-default my-databasesaber db test NAME
Section titled “saber db test NAME”Test a database connection.
Usage:
saber db test my-databaseOutput:
- Connection success/failure
- Error details if connection fails
saber db remove
Section titled “saber db remove”Remove a database connection.
Usage:
saber db remove my-databaseConfirmation required - Will prompt before deletion.
saber memory
Section titled “saber memory”Manage database-specific memories and context.
saber memory add
Section titled “saber memory add”Add a new memory entry.
Usage:
saber memory add "Memory content here" [OPTIONS]Parameters:
CONTENT- Memory content to add (required)
Options:
-d, --database- Database connection name (uses default if not specified)
Examples:
# Add memory to default databasesaber memory add "Active customers are those who made a purchase in the last 90 days"
# Add memory to specific databasesaber memory add -d prod-db "Revenue is recognized when orders are shipped"
# Business rulessaber memory add "VIP customers have lifetime_value > 10000"
# Formatting preferencessaber memory add "Always format dates as YYYY-MM-DD for reports"saber memory list
Section titled “saber memory list”List all memory entries for a database.
Usage:
saber memory list [OPTIONS]Options:
-d, --database- Database connection name (uses default if not specified)
Output shows:
- Memory ID
- Memory content
- Creation timestamp
saber memory remove
Section titled “saber memory remove”Remove a specific memory entry.
Usage:
saber memory remove a1b2c3d4Parameters:
ID- Memory ID fromsaber memory listoutput
saber memory clear
Section titled “saber memory clear”Remove all memory entries for a database.
Usage:
saber memory clear [OPTIONS]Options:
-d, --database- Database connection name (uses default if not specified)
Confirmation required - Will prompt before deletion.
saber models
Section titled “saber models”Manage LLM models from different providers.
saber models list
Section titled “saber models list”List all available models for configured providers.
Usage:
saber models listsaber models set
Section titled “saber models set”Set the default model.
Usage:
saber models setsaber models reset
Section titled “saber models reset”Reset to the default model (Claude Sonnet 4).
Usage:
saber models resetsaber theme
Section titled “saber theme”Manage syntax highlighting theme settings.
saber theme set
Section titled “saber theme set”Interactively select a syntax highlighting theme from all available Pygments themes.
Usage:
saber theme setYou can also set themes via environment variable:
export SQLSABER_THEME=draculasabersaber theme reset
Section titled “saber theme reset”Reset to the default theme (nord).
Usage:
saber theme resetsaber threads
Section titled “saber threads”Manage conversation threads.
saber threads list
Section titled “saber threads list”List conversation threads.
Usage:
saber threads list [OPTIONS]Options:
-d, --database- Filter by database name-n, --limit- Maximum threads to return (default: 50)
saber threads show
Section titled “saber threads show”Show complete thread transcript.
Usage:
saber threads show a1b2c3d4Parameters:
THREAD_ID- Thread ID fromsaber threads list
Output shows:
- Thread metadata (database, model, timestamps)
- Complete conversation history
- SQL queries and results
- Tool calls and responses
saber threads resume
Section titled “saber threads resume”Resume an existing conversation thread.
Usage:
saber threads resume a1b2c3d4 [OPTIONS]Parameters:
THREAD_ID- Thread ID to resume
Options:
-d, --database- Use different database than original thread
Features:
- Loads full conversation context
- Uses same model as original thread
- Connects to original database
- Continues where conversation left off in interactive mode
saber threads prune
Section titled “saber threads prune”Clean up old conversation threads.
Usage:
saber threads pruneInteractive Mode
Section titled “Interactive Mode”When in interactive mode (saber with no arguments), you have access to a few additional features:
Slash Commands
Section titled “Slash Commands”/clear- Clear conversation history/exit- Exit SQLsaber/quit- Exit SQLsaber (alias for/exit)/thinking on- Enable extended thinking/reasoning mode/thinking off- Disable extended thinking/reasoning mode
Autocomplete
Section titled “Autocomplete”- Table names - Type
@table_name[TAB]for completions - Slash commands - Type
/[TAB]for command completions
Environment Variables
Section titled “Environment Variables”These environment variables adjust runtime behavior:
SQLSABER_THEME— Override the configured theme for the session.SQLSABER_PG_EXCLUDE_SCHEMAS— Comma-separated list of PostgreSQL schemas to exclude from schema discovery and introspection. Defaults already excludepg_catalog,information_schema,_timescaledb_internal,_timescaledb_cache,_timescaledb_config,_timescaledb_catalog.SQLSABER_MYSQL_EXCLUDE_SCHEMAS— Comma-separated list of MySQL databases to omit from discovery. Defaults excludeinformation_schema,performance_schema,mysql, andsys.SQLSABER_DUCKDB_EXCLUDE_SCHEMAS— Comma-separated list of DuckDB schemas to skip during introspection. Defaults excludeinformation_schema,pg_catalog, andduckdb_catalog.