Skip to content

Setting up AI ​

Pick your AI. I'll try not to play favorites.

Lily has no AI service of its own and no API key to enter. It runs an AI command-line tool that is already installed and signed in on your Mac, and uses your account with that tool.

Supported tools ​

ToolCommandInstall
Claude Codeclaudenpm i -g @anthropic-ai/claude-code
OpenAI Codexcodexnpm i -g @openai/codex
OpenCodeopencodebrew install opencode

Install at least one and sign in to it in Terminal the way its docs describe. Then:

  1. Open Settings › AI.
  2. Turn on the tools you want under Providers. A tool Lily could not find shows Not found and its install command.
  3. Click the play button next to a provider to test it. Provider answered means it works. Installed is not the same as signed in, so test after installing.

If you installed a tool while Lily was open, click Re-detect installed CLIs.

How Lily finds the tools ​

Lily asks a login zsh where the command is, so anything on your shell's PATH works. If that fails, it looks in ~/.local/bin, /opt/homebrew/bin, /usr/local/bin, ~/.bun/bin, ~/.deno/bin, ~/.volta/bin, ~/.npm-global/bin, ~/n/bin and /usr/bin. There is no setting for a custom path, so if you use another shell, install the tool in one of those folders.

Several providers ​

The first enabled provider is the primary. Use the arrows to change the order.

  • Every request goes to the primary first. If it fails, Lily tries the next one.
  • Large jobs (understanding a big schema, the sensitive-data scan, query ideas) are split into batches and spread across all enabled providers at once. A faster provider takes more batches, and one that keeps failing is set aside.

The order applies to the whole app, not per connection.

Models and time limits ​

Lily does not choose models for Codex or OpenCode; they use their own configuration. With Claude Code, the heavier analysis jobs ask for Sonnet and everything else uses your default.

Each request stops after two minutes (The AI took too long and was stopped). Multi-batch jobs stop after five minutes and keep what they finished. Stop, or closing the sheet, ends the tool's process.

Focus on relevant tables ​

Settings › AI › Grounding › Focus AI on the tables relevant to each request is on by default. On very large schemas (more than 1,500 columns), Lily picks the tables related to your request instead of sending the whole schema. It finds them with Apple's on-device language model, which macOS downloads once, combined with name matching. Smaller schemas are always sent in full.

What you get ​

Without a provider, AI buttons are hidden and everything else works the same.

Lily DB is free for personal and commercial use.