# App quickstart

Ship your first app to Lizard in a few minutes. You'll need Node.js 18+ and npm — a Lizard account is created automatically the first time you `lizard login`. You'll install the CLI, log in, and deploy — either straight from a GitHub repo or from a local directory.

## 1. Install the CLI

Install the `lizard` binary globally from npm:

```bash
npm install -g @lizard-build/cli
```

Verify it's on your `PATH`:

```bash
lizard --version
```

> **Don't use `npx`.** Always use the globally installed `lizard` binary. Running `npx @lizard-build/cli` pulls a throwaway copy whose version may drift from the platform. Upgrade in place later with `lizard upgrade`.

> **Permission errors (EACCES)?** Don't use `sudo`. Point npm at a user-owned prefix instead:
> ```bash
> mkdir -p ~/.npm-global
> npm config set prefix ~/.npm-global
> echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrc && source ~/.zshrc
> npm install -g @lizard-build/cli
> ```

## 2. Log in

```bash
lizard login
```

This opens your browser to authenticate, then drops back to your terminal once you confirm. In CI or other non-interactive environments, authenticate with a token instead:

```bash
export LIZARD_TOKEN=lzd_xxx
# or
lizard login --token lzd_xxx
```

Check who you are at any time:

```bash
lizard whoami
```

## 3. Deploy

Pick the path that matches where your code lives.

### Option A — Deploy a GitHub repo (recommended)

If your code is on GitHub, create a service straight from the repo. Lizard clones it, auto-detects the stack, builds it, and returns a live URL:

```bash
lizard add -r your-org/your-app
```

Pushes to the tracked branch will auto-redeploy from then on. For private repos, connect the GitHub App first:

```bash
lizard git connect
```

### Option B — Deploy local code

From inside your project directory, upload and deploy the current folder (respects `.gitignore`):

```bash
lizard up
```

If the directory isn't linked to a project yet, `up` will create or select one interactively. In CI, link explicitly first with `lizard init --name my-project`.

Either way, when the build finishes you'll get a generated URL like `https://your-app-production.onlizard.com`.

## 4. Watch it build and run

```bash
lizard ps          # services in the project, with status + URL
lizard logs        # last runtime log lines
lizard logs --build  # the most recent build's logs
lizard open        # open the project in the dashboard
```

## 5. Add a database (optional)

Provision a managed Postgres and reference it from your service:

```bash
lizard add postgres
lizard secrets set DATABASE_URL='${{postgres.DATABASE_URL}}' --service your-app
lizard redeploy --service your-app
```

The `${{postgres.DATABASE_URL}}` reference is resolved at deploy time and rotates automatically with the addon. See [Managed Addons](https://lizard.build/docs/addons).

## Next steps

- **[Core Concepts](https://lizard.build/docs/concepts/architecture)** — understand projects, services, and the build pipeline.
- **[Deploying from GitHub](https://lizard.build/docs/deploy/github)** — branches, monorepos, and auto-redeploys.
- **[Variables & Secrets](https://lizard.build/docs/variables)** — scoping and precedence.
- **[Networking](https://lizard.build/docs/networking)** — attach your own hostname with automatic TLS.
- **[Deploying an app your AI IDE built](https://lizard.build/blog/google-antigravity-how-to-deploy-your-app-to-production)** — the same three steps handed to an agent instead, for an app written in Google Antigravity.

## Hosting costs

Lizard uses [pay as you go](https://lizard.build/docs/platform/billing) with no monthly subscription. Resource usage draws from your account balance. Purchased credits do not expire; trial credits do. Check [pricing](https://lizard.build/pricing) and your account limits before deploying.
