https://github.com/tursodatabase/turso-cli
Command line interface to the Turso Cloud.
https://github.com/tursodatabase/turso-cli
database edge serverless
Last synced: about 2 months ago
JSON representation
Command line interface to the Turso Cloud.
- Host: GitHub
- URL: https://github.com/tursodatabase/turso-cli
- Owner: tursodatabase
- License: mit
- Created: 2022-12-16T15:04:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2026-01-09T21:37:53.000Z (3 months ago)
- Last Synced: 2026-01-15T02:53:57.864Z (2 months ago)
- Topics: database, edge, serverless
- Language: Go
- Homepage: https://turso.tech
- Size: 8.2 MB
- Stars: 280
- Watchers: 6
- Forks: 44
- Open Issues: 109
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Turso CLI
[](https://github.com/tursodatabase/turso-cli/actions/workflows/go.yml)
[](https://github.com/tursodatabase/turso-cli/blob/main/LICENSE)
This is the command line interface (CLI) to Turso.
## Documentation
There is [reference documentation](https://docs.turso.tech/reference/turso-cli)
available.
For a guided walkthrough, follow the
[Turso Quickstart docs](https://docs.turso.tech/quickstart).
## Installation
### Package manager
#### [Homebrew](https://brew.sh) (macOS, Linux, WSL)
```bash
brew install tursodatabase/tap/turso
```
Also remember to configure `homebrew`
[shell completions](https://docs.brew.sh/Shell-Completion) if you haven't
already done so.
To upgrade an existing installation of the CLI, run:
```bash
brew upgrade turso
```
### Install script
```bash
curl -sSfL https://get.tur.so/install.sh | bash
```
### Go
```bash
go install github.com/tursodatabase/turso-cli/cmd/turso@latest
```
### Building from source
```bash
cd cmd/turso && go install
```
## Usage
### Authentication
If you are a new user, you can sign up with:
```bash
turso auth signup
```
If you already have an account, authenticate with:
```bash
turso auth login
```
You are taken to a web page in your default browser to authenticate via GitHub.
After successfully authenticated, `turso auth login` receives an access token
that is stored on your settings file.
### Create database
To create a database with a generated name, run:
```bash
turso db create
```
Or you can specify the name of the database with:
```bash
turso db create
```
### Start SQL shell
You can start an interactive SQL shell similar to `sqlite3` with:
```bash
turso db shell
```
### Run SQL command without interactive shell
You can also run a command without using the interactive SQL shell:
```bash
turso db shell
```
### Replicate database
First, list available locations and pick a location you want to replicate to:
```bash
turso db locations
```
Then, to replicate a database, run:
```bash
turso db replicate
```
### List databases
To list your databases, run:
```bash
turso db list
```
### Delete database
```bash
turso db destroy
```
## Settings
The `turso` program keeps settings in your local machine in the following base
directory in `turso/settings.json` file:
| OS | Config directory |
| ----- | ----------------------------------------- |
| Linux | `$XDG_CONFIG_HOME` or `$HOME/.config` |
| macOS | `$HOME/Library/Application Support/turso` |