Skip to content

Getting Started

Welcome to SQLsaber! This guide will walk you through setting up SQLsaber and running your first query.

Before you begin, make sure you have:

  1. Installed SQLsaber
  2. Access to a database (PostgreSQL, MySQL, SQLite, or DuckDB)
  3. An API key from a supported AI provider (Anthropic, OpenAI, Google, etc.)

Run SQLsaber with no arguments to start the guided setup:

Terminal window
saber

On your first run, SQLsaber walks you through two guided steps:

  1. Database connection: Choose the database type and provide connection details.

  2. Authentication: Sign in to your preferred AI provider and pick a model. We recommend Sonnet 4.5, 4 or GPT-5.

    sqlsaber will store your API key securely using your OS credential store.

When both steps succeed you’ll see a confirmation screen, and SQLsaber immediately opens an interactive session.

Once onboarding completes, you’re already in interactive mode. Try asking a question:

> How many VPs have become presidents via election in 20th century?

SQLsaber will:

  1. Analyze your database schema
  2. Generate appropriate SQL
  3. Execute the query
  4. Present the results and analysis

In interactive mode, you have access to several helpful features:

  • Slash Commands

    • /clear - Clear the conversation history
    • /exit or /quit - Exit SQLsaber
  • Table Name Autocomplete

    • Type @ followed by a table name to get autocomplete suggestions:

You can also run single queries without entering interactive mode:

Terminal window
# Direct query
saber "How many users are there?"
# Using a specific database
saber -d my-database "Show me the latest orders"
# Reading from stdin
echo "Count all products by category" | saber
# Send output to a file
saber "Show me the latest orders" > latest_orders.md

Now that you have SQLsaber running, explore these features:

“No database connections configured”

Terminal window
saber db list # Check configured databases
saber db add my-db # Add a new database

“Authentication not configured”

Terminal window
saber auth status # Check auth status
saber auth setup # Set up authentication

“Database connection failed”

Terminal window
saber db test my-database # Test the connection

For more troubleshooting help, see our installation guide.