lancedb command-line client to open an interactive SQL shell, run a
statement, or execute a SQL file. SQL requires a running deployment with an
Arrow Flight SQL endpoint.
This public client exposes auth, profile, and sql. Commands such as
lancedb admin ... and lancedb job ... require the Enterprise administrative
CLI from your deployment administrator; the public client archive and source
installation below do not include them. Use lancedb sql --command for SQL
statements supported by your deployment.
Install
On Apple Silicon macOS or Linux (x86-64 or ARM64), install the CLI with Homebrew, the hosted shell installer, or Python tools.Homebrew
brew upgrade lancedb/tap/lancedb.
Shell installer
The installer downloads the latest stable CLI for your platform, verifies the archive’s SHA-256 checksum, and installs the executable in$HOME/.local/bin.
$HOME/.local/bin to your PATH to run lancedb by name. To install a
specific release, pass the tag to sh, for example
curl -fsSL https://downloads.lancedb.com/cli/install.sh | LANCEDB_VERSION=v0.42.0 sh.
If you already use the Enterprise CLI, set LANCEDB_INSTALL_DIR to a separate
absolute directory and invoke the public CLI by its full path. To upgrade, move
the existing executable first.
Python (uvx or pipx)
Thelancedb-tools package on PyPI provides the lancedb command.
To run the CLI once with uv, use:
PATH, install it with pipx:
Manual download
Download a CLI archive andSHA256SUMS from the
LanceDB releases page. The CLI
shares the SDK release version.
Set the version and target to match your chosen release and platform:
PATH:
$HOME/.local/bin to your shell’s PATH configuration to use it in future
sessions. Each archive also contains the license and Rust third-party notices.
Build from source
With Rust and Git installed, build the CLI from the LanceDB repository. Check out a release tag to build that version:Connect to a deployment
Get the Flight SQL endpoint, HTTP API endpoint, database name, and credentials from your deployment administrator. Create a named profile to save the connection settings:grpcs:// or https:// for a TLS-protected SQL connection. A bare
host:port or a grpc:// address selects a plaintext connection.
Set the default profile
Running
lancedb opens the SQL shell when the default profile has a Flight SQL
endpoint. If no endpoint is configured, it prints usage and connection setup
guidance. Command and file execution also require a configured endpoint.10025 and HTTP on port 10024.
Run SQL
Execute a statement and exit:queries.sql:
--command and --file are mutually exclusive.
Choose an output format
For query results,--format accepts the following values:
Use the SQL shell
End SQL statements with a semicolon. Enter\? to see the shell’s commands.
Add
+ to \dt, \d, or \di for more detail. Use Ctrl+C to cancel the
current input or stop watching a query, and Ctrl+D to exit.
Large interactive results use a pager. Set NO_PAGER=1 to disable paging.
Inspect jobs with SQL
Manage profiles
Profiles are stored in~/.lancedb/config.toml. The CLI reuses existing
Enterprise profiles and cached OAuth sessions.
lancedb profile create NAME without connection flags for interactive
setup. For a single SQL invocation, flags such as --database and
--sql-server-url override the selected profile.
Put each command’s flags after that command. For example, use
lancedb auth login --profile production or lancedb profile edit production --database staging.
Authenticate with OAuth
To use OAuth, configure anoidc table in the selected profile with your
identity provider’s settings. For example, add the following to
~/.lancedb/config.toml for a device-code login:
api_key or oidc_access_token_file. Environment credentials override
the profile, so clear API-key overrides before connecting with OAuth:
auth login follows the profile’s OAuth flow. Browser and device-code sessions
cache refresh tokens for later commands. Use lancedb auth logout --profile production to clear the profile’s cached session.
See authentication for identity provider setup and
available authentication methods.