Set up Lemon
For a prebuilt Lemon install, the shortest path is one command followed by the interactive setup handoff:
curl -fsSL https://raw.githubusercontent.com/z80dev/lemon/main/install.sh | shThe installer verifies and installs the release, then starts lemon setup for full and min profiles when it can read /dev/tty. Complete the provider, authentication, and default-model prompts, then start the TUI:
$HOME/.lemon/bin/lemonThe installer prints the PATH entry; after adding ~/.lemon/bin, use lemon. That is your first chat. The TUI starts the daemon when needed. To use a local browser instead, run lemon web; it starts the full runtime when needed, checks the same readiness state, and opens the page only after Web health is confirmed. Full installer behavior, including platform support and updates, is in the Install guide.
What setup does—and does not do
lemon setup is an idempotent first-time configuration wizard. On each run it re-checks the state and performs only pending work:
- creates a minimal config scaffold if no config exists;
- initializes encrypted secrets if they are not configured, without replacing an existing key;
- onboards a provider, auth credential, and default provider/model;
- checks the resulting configuration and credential, including a live provider check when supported; and
- offers optional runtime-profile configuration.
It does not install source dependencies, configure Telegram or Discord, start a gateway, or run lemon doctor automatically. Rerun it whenever setup is incomplete:
lemon setupIf the first interactive lemon launch detects that a usable provider is not ready, it opens this setup flow before starting the daemon. If no controlling terminal is available, it does not start an unconfigured daemon; run lemon setup later from an interactive terminal.
The browser is also fail-closed. lemon web may start before setup is complete so the page can explain what is missing, but the page disables prompts and uploads until config, secure secrets, and a usable provider/model are all ready. After setup changes, choose Check again; a running Web client also refreshes on config and secret change events. See the browser guide.
Provider, auth, and model
The wizard presents the supported providers and their available authentication flows. It stores credentials in encrypted secrets and writes secret references, not a plaintext provider key, to configuration. Select a default provider and model during the flow so Lemon has a model for your first chat.
To configure or change a provider directly:
lemon model --provider anthropicFor a provider setup that includes the live credential check, use:
lemon setup providerThe live check is deferred with --skip-verify, which is useful when you are deliberately offline. Local checks of the config, selected provider/model, and stored credential still run:
lemon setup provider --skip-verifyIf a provider verification fails, setup remains incomplete. Correct the credential or model and rerun lemon setup provider; do not expect a failed verification to be treated as a working setup.
Automated or headless configuration
The installer does not run setup when there is no TTY. It succeeds and prints $HOME/.lemon/bin/lemon setup for a later interactive handoff. To suppress the wizard even with a TTY, use:
curl -fsSL https://raw.githubusercontent.com/z80dev/lemon/main/install.sh | sh -s -- --skip-setupThe sim profile does not offer a provider setup wizard. For a non-interactive provider setup, use explicit values:
lemon setup --non-interactive
lemon model --provider anthropic --token "$ANTHROPIC_API_KEY" \
--model anthropic:claude-sonnet-4-20250514 --set-default
lemon doctorlemon model uses the local configuration checks and does not make a provider network request. When network access is available and you need the live check, use the corresponding provider setup command instead:
lemon setup provider --provider anthropic --token "$ANTHROPIC_API_KEY" \
--model anthropic:claude-sonnet-4-20250514 --set-defaultAppend --skip-verify to that command to defer only the live check.
Verify and recover
After setup, inspect the persisted configuration and secret state, then run local diagnostics:
lemon config validate
lemon secrets status
lemon doctorlemon doctor reports diagnostics; it is not a replacement for provider onboarding. To retry first-time state, use lemon setup. To correct a provider or model, use lemon setup provider or lemon model.
Optional Telegram or Discord
A messaging channel is optional. Add one only after the provider path is ready:
lemon gateway setupThe picker includes Telegram and Discord. You can choose either directly:
lemon gateway setup telegram
lemon gateway setup discordEach adapter guides its required bot token and allowed conversation scope, stores the token in encrypted secrets, and verifies the adapter configuration. See the configured channel state with:
lemon channelsSource development
A source checkout is for development, unsupported platforms, and release work. Only this path needs the development toolchain:
- Elixir 1.19.5+
- Erlang/OTP 28.5+
- Bun 1.3.14+ for TUI client development
- Node.js 24 LTS+ for web client development
git clone https://github.com/z80dev/lemon.git
cd lemon
mix local.hex --force
mix deps.get
mix compile
./bin/lemon setup
./bin/lemon doctor
./bin/lemon-tuiUse the source wrapper for Lemon commands, rather than installed lemon commands:
./bin/lemon model --provider anthropic
./bin/lemon gateway setup telegram
./bin/lemon gateway setup discord
./bin/lemon config validate
./bin/lemon secrets status
./bin/lemon channels
./bin/lemon doctorFor non-interactive source configuration, use the same wrapper forms:
./bin/lemon setup --non-interactive
./bin/lemon model --provider anthropic --token "$ANTHROPIC_API_KEY" \
--model anthropic:claude-sonnet-4-20250514 --set-default./bin/lemon-tui is the source-development TUI entry point once the source runtime is configured. A fresh launcher-owned runtime receives a generated, process-scoped operator token and is stopped when the TUI exits. Attaching to an existing or persistent runtime requires exporting its matching LEMON_CONTROL_PLANE_OPERATOR_TOKEN; the launcher does not read or persist the daemon's credential.
Supplying a token does not make a runtime started by ./bin/lemon-tui persistent: the launcher still stops it when the client exits. Start ./bin/lemon --daemon separately, then attach with the same token, when the runtime should outlive the TUI.