Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
saya discovers the schema, writes the SQL, shows it to you, and runs it read-only and bounded against PostgreSQL, MySQL, SQLite, DuckDB, or Snowflake.
Install
Prebuilt binaries for macOS (Apple Silicon + Intel), Linux, and Windows are on
every release, with
SHA256SUMS to verify them.
Quick start
# the profile references it; never commit it
config init writes to your user config directory, which saya trusts. Pass
--project to write a .saya/ pair for a repository instead — that layer is
untrusted, so security-critical settings in it are ignored unless you pass
--trust-project-config. config doctor names what is missing and exits
non-zero when the setup cannot run a query, so a script can tell.
The starter config points at a local Ollama; edit [ai]
in config.toml for OpenAI, Anthropic, Gemini, or any OpenAI-compatible
gateway.
One-shot, no TUI:
What you get
- 🖥️ A real terminal UI — bottom-pinned input, streaming answers, a
/command popup with fuzzy matching,@tableschema autocomplete, and copy-out withCtrl+O/Ctrl+Y/Ctrl+B. (demo) - 🛡️ You see the SQL before it runs — the exact statement appears in the
approval prompt and the transcript.
--approval-modepicksask,read-only, ornever. - 🧠 Memory — tell saya what a table means once and later questions carry it. Facts are typed, bound to the schema shape they depend on, and go stale when a column they rest on changes. saya never confirms a fact by itself and never picks between contradictions. Off by default. → memory
- 🔌 Databases — PostgreSQL, MySQL, SQLite, DuckDB, Snowflake — and one question can span several connected databases at once, with results side by side. (demo)
- 🤖 Providers — Ollama, OpenAI, OpenAI-compatible gateways, Anthropic, Gemini.
- ⚙️ Scriptable — piped or non-TTY input runs headless with text, JSON, or NDJSON output, and typed exit codes.
Safety
saya is read-only in two layers. Every statement is parsed and rejected if it
writes, and the database session itself is opened read-only — Postgres
default_transaction_read_only, MySQL transaction_read_only, SQLite
PRAGMA query_only, a read-only DuckDB open. Results are bounded by a row cap
and byte budgets, and marked when truncated.
Secrets live in your environment or on disk as references, never inline in committed config. Resolved secrets, provider headers, and raw result rows are structurally excluded from saved sessions.
Neither layer can prove that an arbitrary database function is side-effect free, and Snowflake has no session read-only switch — so connect with a least-privilege, read-only database role. → SECURITY.md
Documentation
saya --help and /help in the TUI are generated from the code, so they are
always current — start there for flags and commands. The guides cover the rest:
| Guide | Covers |
|---|---|
| Installation | binaries, Homebrew, cargo, building from source |
| Configuration | config layers, environment variables, state paths |
| Connections | every database type, TLS modes, secret references |
| Providers | every supported provider and its settings |
| Commands | the CLI surface and output formats |
| Querying databases | worked examples, cross-database queries |
| Memory | what saya remembers, and the trust model behind it |
Development
The demo GIFs are generated with vhs
from the docs/*.tape scripts; the live ones need SAYA_API_KEY and a
reachable database.
See CONTRIBUTING.md. Apache-2.0 licensed.