Skip to main content

Getting Started

The Turso CLI (tursodb) is an interactive SQL shell for working with Turso databases. It supports in-memory and file-based databases, multiple output modes, CSV import, database cloning, and built-in documentation.

Quick Start

In-Memory Database

Launch the shell with a transient in-memory database:

Open a Database File

Run a Query Directly

Pass SQL as a command-line argument to run it and exit:

Pipe SQL from stdin

Interactive Shell

When launched without a SQL argument, the shell provides an interactive REPL with command history and syntax highlighting.

Multi-line Input

Unfinished statements (missing semicolons, unbalanced parentheses) automatically continue on the next line. The prompt indicates nesting depth:

Command History

Command history is saved automatically to ~/.limbo_history and accessible with up/down arrow keys.

Exiting

Use .quit or .exit to leave the shell. Pressing Ctrl+C twice also exits.

Output Modes

Turso supports three output modes, selectable with the -m flag or the .mode dot command.

Pretty (Default)

Human-readable table with borders:

List

Pipe-delimited values suitable for scripting:

Line

One column per line, with column names:

Non-Interactive Mode

When input is piped (not a terminal), the shell runs in non-interactive mode:
  • Output defaults to list mode (override with -m)
  • No startup banner, history, or syntax highlighting
  • Exits with code 1 on query errors

Server Modes

The CLI can also run as a server instead of an interactive shell.

MCP Server

Start a Model Context Protocol server, allowing AI assistants to interact with the database:

Sync Server

Start a sync server for database replication: