# Orizon deployment

This project deploys to **Orizon** (https://orzn.io) — a platform that
builds your code and runs it on a dedicated server with a live URL and automatic
TLS. Use the `orizon` CLI (or the MCP server) to deploy and manage it.

## Install the CLI

```sh
curl -fsSL https://cdn.orzn.space/cli/install.sh | sh
```

Windows binaries: https://cdn.orzn.space/cli/latest

## Authenticate

Create a platform API key at https://dashboard.orizon.ng/api-keys (it looks like
`orz_pk_...`), then either:

```sh
orizon login --key orz_pk_xxx
# or, for CI / agents — takes precedence over the saved config:
export ORIZON_API_KEY=orz_pk_xxx
```

A `read` key can inspect projects and logs; a `full` key can deploy and change
things. The secret is shown only once.

## Deploy

```sh
orizon link --project <proj_id>   # once: links this directory to a project
orizon deploy                     # zip the cwd, upload, deploy, stream logs
```

`orizon deploy` zips the working directory (skipping node_modules, .git, and
build output), uploads it, creates a deployment, and tails the build logs until
the app is healthy.

## Useful commands

```sh
orizon projects           # list your projects (alias: orizon ls)
orizon logs --follow      # stream the latest deployment's logs
orizon env pull           # print this project's env vars (NAME=VALUE)
orizon env push .env      # set env vars from a file (triggers a redeploy)
orizon open               # open the live URL in a browser
```

## MCP (optional)

The CLI ships an MCP server so an agent can manage Orizon directly:

```sh
# Claude Code
claude mcp add orizon --env ORIZON_API_KEY=orz_pk_xxx -- orizon mcp
```

Generic MCP config (Cursor, Windsurf, others):

```json
{
  "mcpServers": {
    "orizon": {
      "command": "orizon",
      "args": ["mcp"],
      "env": { "ORIZON_API_KEY": "orz_pk_xxx" }
    }
  }
}
```

MCP tools: list_projects, get_project, create_project, deploy_project,
list_deployments, get_deployment, get_deployment_logs, list_env, set_env,
list_databases, get_database, list_domains, list_emails.

## Important notes

- **Server apps must listen on `PORT`.** Orizon runs the container with
  `PORT=3000` and routes public traffic to it. Bind to `0.0.0.0:$PORT`, not
  `localhost`.
- **Static sites and PHP apps** are served directly — no PORT needed.
- **Stack detection is automatic** (Next.js, Node, Bun, Go, Rust, Python, PHP,
  Docker, Compose, static). Add a `Dockerfile` for full control over any stack.
- **Don't hardcode secrets** — put them in env vars via `orizon env push`.

## Reference

- Docs: https://orzn.io/docs
- Machine-readable index: https://orzn.io/llms.txt
- Full docs in one file: https://orzn.io/llms-full.txt
- API base: https://api.orizon.ng/api/v1
