Agents

LILY for agents

Let a coding agent deploy and operate apps on LILY with the lly CLI.

A coding agent such as Claude Code, Codex or Cursor works with LILY through the lly command line. lly never asks a question when no terminal is attached, reports results as JSON and uses fixed exit codes, so an agent can run it without help. This page gives the agent what it needs.

Give your agent the docs

  • Every page of these docs is available as Markdown at https://docs.lilylabs.io/llms.mdx/<path>. Example: https://docs.lilylabs.io/llms.mdx/cli/deploy.
  • https://docs.lilylabs.io/llms.txt lists all pages.
  • https://docs.lilylabs.io/llms-full.txt holds all pages in one file.
  • Every page has a Copy Markdown button.

Deploy with an agent

Copy this prompt into your agent, in the repository you want to deploy:

Deploy this project to LILY (lilylabs.io) with the lly CLI.

Before you start
- Read the CLI docs as Markdown and trust them over what you remember:
  https://docs.lilylabs.io/llms.mdx/cli and https://docs.lilylabs.io/llms.mdx/cli/deploy
- Check that the project fits. LILY runs C and C++ (built with CMake or Make), Rust, Next.js and most JavaScript. If it needs Python, Go, a Docker image, a GPU or a database, stop and tell me: those don't run on LILY yet.

Steps
1. Install: curl -fsSL https://get.lilylabs.io/install.sh | sh, then check with lly --version. If lly isn't found, add the PATH line the installer prints.
2. Sign in: run lly whoami. If it exits with code 3, run lly login --no-browser, show me the link and code, and wait while I confirm in my browser.
3. LILY builds from GitHub, not from local files. Check that this repository has a GitHub origin and that the branch is pushed. Ask me before you commit or push anything.
4. Deploy from the repository root: lly deploy -y --json. It never prompts. If it exits with code 2, set the flag its hint names and run it again.
5. If it exits with code 7, either GitHub isn't connected (lly says where to connect it: send me there and wait) or the build failed (show me the build log with lly attach <slug> --build and suggest a fix).

Rules
- Never print, log or commit secrets. Variables without a value are skipped: list them for me to set with lly env <slug> set KEY=VALUE, then lly redeploy <slug>.
- Don't delete projects, apps or repositories without asking me.

When it's live, tell me the URL (https://<slug>.lilylabs.app), the app slug and any skipped variables.

Each guide ends with a shorter prompt for its own task.

How lly behaves for an agent

SituationWhat lly does
A choice is open and no terminal is attachedExits with code 2 and names the flag to set
-y is givenAccepts defaults: all supported apps, proposed connections, a suggested project name. Empty variables are skipped
--json is givenPrints results and errors as JSON on stdout, progress on stderr. Errors have the form {"error", "hint", "exit_code"}
Sign-in is neededlly login --no-browser prints a link and a code for a person to confirm

Exit codes

CodeMeaningWhat the agent should do
0SuccessContinue
2Usage error or open choiceSet the flag the hint names
3Not signed inAsk the person to sign in
4Workspace, project or app not foundCheck names with lly ls
5Conflict, for example a build is already runningWait and retry
6Temporarily unavailable or timed outRetry
7Build or deployment failed, or GitHub is not connectedRead the build log with lly attach <slug> --build

What an agent cannot do yet

  • Run unattended in CI. Credentials for pipelines are not available yet. See CI/CD.
  • Deploy on push. LILY does not watch repositories.
  • Deploy Python, Go or Docker images.

Next steps

On this page