# Layero > Layero is a deployment and hosting platform for any web project: static > sites and SPAs, SSR apps (Next.js, Nuxt, SvelteKit, Remix / React Router v7), > Node and Python backends (Express, NestJS, Hono, FastAPI, Django, Flask, > Streamlit, Gradio) and fullstack apps (frontend + API in one repo). The > framework is detected automatically among 35+ presets: Vite, Create React > App, Angular, Astro, Gatsby, Docusaurus, Storybook, VitePress, Eleventy, > Hugo, plain HTML and more. > A connected repository (GitHub, GitVerse, GitLab, GitFlic, SourceCraft) > deploys on push; a plain folder ships through the CLI — git is not required. > Servers are inside Russia — a Vercel/Netlify alternative for the > Russian market. Full expanded reference: https://layero.ru/llms-full.txt ## For AI agents: three paths, pick by situation Install the skill first — it carries this whole recipe plus the references: `npx skills add LayeroInfra/layero-agents` (Claude Code: `claude plugin marketplace add LayeroInfra/layero-agents && claude plugin install layero@layero`). - **(a) The project has a connected repository** (GitHub, GitVerse, GitLab, GitFlic, SourceCraft): push. A push to a branch creates a preview environment, a push to `main` goes to production. To connect one, use the dashboard: **New project → Import from repository**. - **(b) The user has a folder with code** and no repository (or does not want one): `npx layero@latest deploy --json` — the CLI packs the folder and the platform builds it. Prebuilt static output can also go through the MCP tool `publish_site`. - **(c) The site is already on Layero**: diagnose a failed build (`diagnose_deploy` over MCP or `npx layero@latest diagnose`), read logs, roll back, manage domains, env vars, analytics and the Data API — over MCP or the CLI. Rule of thumb: the user works in a repository → (a); "publish this folder" → (b); a question about a live site → (c). Do not turn (b) into (a): no `git init` for the sake of a deploy. ## Path (b): deploying a folder with the CLI ```bash npx layero@latest deploy --dry-run --json # the build plan; uploads nothing, no login npx layero@latest deploy --json ``` Behaviour: 1. Look at the plan first: `deploy --dry-run` prints how the platform will build the folder (framework, build command, output folder and where each value comes from). An ordinary single app (Vite, Next, Astro, plain HTML…) needs no setup: `deploy` links the folder by itself, and `npx layero@latest init` is optional (it writes an AGENTS.md block and records no settings). If the plan says `"confident": false`, the folder is one of the shapes detection cannot settle — do what its `next_action` says before the first deploy (see "When the folder is not recognised" below). With a token the whole deploy is one command: `LAYERO_TOKEN=… npx layero@latest deploy --name --yes --json`. **No account, no token, or the person is away:** `npx layero@latest deploy --claim --yes --json` — no sign-in at all, only with the explicit flag; the site lives 1 hour (static sites and SPAs only, random address, closed to search engines) and the `claimable` event carries `claim_url` for the person to keep it. 2. If the user is not logged in, the command emits `{"event":"auth_required","url":"...","user_code":"..."}` on stdout. Show that URL to the user as a clickable link. They sign in once (by an emailed code or with Yandex ID — Layero creates the account automatically on first sign-in), click "Разрешить доступ", and within 2 seconds the CLI's poll loop picks up the token. No localhost server: the browser can be on a different machine than the CLI (works from SSH, Docker, Cursor sandbox). 3. Watch stdout for JSON-lines events. The deploy is done when you see `{"event":"ready","url":"https://..."}` — show that URL to the user. ## Do NOT - Do not create a git repository (`git init`) just to deploy — the CLI ships a folder. If the repository is already connected to Layero, push instead of running the CLI: a push is the deploy. - Do not run `npm install -g layero` — global installs fail in sandboxed agent terminals. Use `npx layero@latest` or `npm install -D layero`. - Do not open the Layero dashboard to "finish setup" — the CLI does everything inline. There is no browser setup wizard since v0.5.0. - Do not pass `--provider` to `layero login` — the flag was removed in v0.5.x; provider is chosen in the browser. ## Re-deploying after edits After editing files, run `npx layero@latest deploy` again. Each run republishes to the same project address, printed as `url` in the `ready` event. The first deploy creates the project; subsequent deploys reuse it. Project addresses live in a dedicated zone — `.layero.app` (the older `-.layero.ru` addresses are gone since September 2026). Never build the address from a template: take `ready.url` as-is. A project created by `layero deploy` (a CLI project) **auto-promotes to its live address on every deploy** — the apex is the destination, and `--prod` is redundant there. Do not assume a plain `deploy` is a harmless preview: it replaces what visitors see. There is no way around this from the CLI: `--branch` on an archive upload is **rejected** with `branch_unsupported` (exit code 4) — the backend files every archive upload under the reserved `cli` environment. Deploying without an account: `npx layero@latest deploy --claim --yes --json` — the site lives for 1 hour (static sites and SPAs only; a server app is refused with `claim_static_only`); the `claimable` event carries `claim_url` for a person to keep it. A "just to look at it" publish that leaves the live address alone does not exist for a CLI project; it is done by connecting a repository and pushing to a branch. `--prod` matters for repository-linked projects, where it targets the production environment rather than a branch one. ## In CI (GitHub Actions and other pipelines) The browser sign-in above is interactive and cannot work in CI. Pipelines use a long-lived token instead — the user creates it at https://app.layero.ru/settings/cli and stores it as a repository secret: ```yaml - uses: LayeroInfra/deploy-action@v1 with: token: ${{ secrets.LAYERO_TOKEN }} prod: true ``` Any other CI system needs only the environment variable: ```bash LAYERO_TOKEN=... npx layero@latest deploy --prod --yes ``` `LAYERO_TOKEN` takes priority over a local login, and `--yes` skips the confirmation prompt that would otherwise wait forever on a runner. Note: if the repository is already linked to a Layero project, a push builds it automatically and no pipeline is needed. Reach for CI only when the build itself needs secrets or private dependencies the platform does not have. Guide: https://docs.layero.ru/en/cli/github-actions ## Event types in JSON mode ``` auth_required, authorized, project_created, project_linked, detected, plan, prebuilt, packing, uploading, uploaded, setup_applied, runtime_type_applied, deploy_started, stage, build_log, claimable, ready, error ``` On the free plan the platform appends a small "Made on Layero" footer script (`/_layero/footer-.js`) to every HTML page; it is cosmetic and never fails a deploy. `queued` events mean the build is waiting for a builder, not an error. `ready` carries `url` — the live public site, already answering: the CLI waits (up to 90 s) until the address serves the site instead of a platform page, so a container app is up by then. `edge_ready: false` means the app never came up — read `npx layero@latest logs --runtime`. `preview_url` is a legacy field. When the folder is not recognised. The `detected` event (and `deploy --dry-run`) is advice, never saved to the project: the platform detects again on the uploaded files. `"confident": false` comes with `hint` (what the CLI saw) and `next_action` (the fix): an app in a subfolder → `npx layero@latest deploy --root ` (a workspace app that imports a neighbour package → deploy from the workspace root with `"framework": "generic"`, `buildCommand` building the neighbour first, and `"outputDirectory": "apps/web/dist"`); a custom build script with no known framework → `layero.json` with `"framework": "generic"`, `buildCommand`, `outputDirectory` (`static` never runs a build); a server → `"runtime": "node_web"` / `"python_web"` + `startCommand`; `frontend/` + `backend/` in one repo → `layero.json` with both blocks: ```json { "frontend": { "root": "frontend", "output": "dist" }, "backend": { "root": "backend", "framework": "fastapi" }, "apiPrefix": "/api" } ``` `layero.json` is an answer to one specific failure — one symptom, one field — not a questionnaire; unknown keys are skipped silently. The complete key list and the symptom → field table: https://github.com/LayeroInfra/layero-agents/blob/main/skills/layero/references/layero-json.md Errors have a stable `code` and a `next_action` hint: ```json {"event":"error","code":"auth_required","next_action":"run `layero login` or set LAYERO_TOKEN","message":"not authenticated"} ``` Codes the CLI actually emits (checked against its sources — do not branch on anything outside this list): `auth_required`, `auth_expired`, `auth_timeout`, `oauth_unavailable`, `project_unknown`, `project_not_found`, `cli_deploys_disabled`, `invalid_type`, `invalid_choice`, `prebuilt_no_dir`, `prebuilt_no_index`, `deploy_not_started`, `deploy_watch_lost`, `deploy_failed`, `no_deploy`, `no_deploys`, `env_not_found`, `nothing_to_set`, `bad_format`, `domain_not_found`, `domain_rejected`, `forbidden`, `branch_without_env`, `analytics_not_connected`, `no_runs`, `branch_unsupported`, `claim_with_project`, `internal`. The failure code is assembled as `deploy_`, and a deploy has four statuses (`ready`, `building`, `failed`, `cancelled`), so only `deploy_failed` and `deploy_cancelled` occur. `deploy_error` and `deploy_timed_out` do not exist. `auth_required` with `next_action: set_layero_token` is the CI-only variant: it means the run has no credentials and no browser to get them from. Full schema with required/optional fields per event: https://docs.layero.ru/en/cli/json-events ## MCP server: the platform in the agent's hands Layero also runs a remote MCP server — the platform itself, not a page builder. An agent calls it directly instead of shelling out: ``` https://mcp.layero.ru/mcp transport: Streamable HTTP, server name: layero ``` Auth: OAuth — the client opens the browser itself, nothing to paste. CI and headless environments use a token instead: `Authorization: Bearer $LAYERO_TOKEN` (issued by `npx layero@latest token create` or at https://app.layero.ru/settings/cli). Tool groups: - **account** — `whoami`, `my_projects`, `project_create`, `list_environments` - **sources** — `list_sources`, `import_repo` (connect GitHub / GitVerse / GitLab / GitFlic / SourceCraft) - **deploys** — `list_deploys`, `deploy_logs`, `diagnose_deploy` (reads a failed build and says what to fix), `retry_deploy`, `cancel_deploy`, `rollback`, `publish_site` (uploads prebuilt static; `publish_landing` is a deprecated alias) - **site** — `site_status`, `read_site`, `site_screenshot`, `site_issues`, `refactor_site`, `check_copy`, `check_performance` - **configure** — `project_settings` (app folder, commands, project type), `env_vars`, `connect_domain`, `check_domain`, `list_domains` - **measure** — `connect_analytics`, `site_analytics` - **data API** — `data_api_status`, `data_api_methods`, `data_api_grant`, `data_api_keys`, `data_api_origins`, `data_api_probe` - **docs** — `search_docs` (no auth) Registered in the official MCP registry as `ru.layero/layero`. Connecting a client — every command comes from one file, https://layero.ru/agents-install.json: ```bash # any MCP client npx -y add-mcp https://mcp.layero.ru/mcp # Claude Code (plugin: MCP + skill) claude plugin marketplace add LayeroInfra/layero-agents && claude plugin install layero@layero # Cursor: the add-mcp command above # Codex CLI codex mcp add layero --url https://mcp.layero.ru/mcp ``` **Skill vs MCP.** The skill (`npx skills add LayeroInfra/layero-agents`) teaches the agent the procedure — the three paths, JSON events, `layero.json`, git providers. The MCP server gives it the platform's hands. Use both; a skill alone still works through the CLI. ## Pages on layero.ru Product pages in Russian; each has an English version at the same path under `/en/` (for example `https://layero.ru/en/pricing`). - [Pricing](https://layero.ru/pricing): Free — 0 ₽, up to 5 projects and 100 builds a month; Pro — 990 ₽/month or 9 480 ₽/year, first 14 days free; payment in rubles. - [Databases](https://layero.ru/databases): managed PostgreSQL in the dashboard — tables, SQL editor, roles and RLS policies, extensions, backups. - [Temporary site without sign-up](https://layero.ru/drop): upload a folder, ZIP or HTML file and get a link for one hour. - [Deploy from Claude Code](https://layero.ru/deploy-from-claude-code), [from Cursor](https://layero.ru/deploy-from-cursor), [from Codex](https://layero.ru/deploy-from-codex): connecting Layero to an AI agent, step by step. - Framework hosting: [Next.js](https://layero.ru/hosting-nextjs), [Vite](https://layero.ru/hosting-vite), [Astro](https://layero.ru/hosting-astro), [Nuxt](https://layero.ru/hosting-nuxt), [React](https://layero.ru/hosting-react) — what is supported and how it is built. - Comparisons (checked 2026-11-07, each page cites the competitor's own docs): [Layero vs Vercel](https://layero.ru/layero-vs-vercel) (servers in Russia, rubles; Vercel Hobby is non-commercial only), [vs Netlify](https://layero.ru/layero-vs-netlify) (Netlify pauses all projects when free credits run out), [vs Cloudflare Pages](https://layero.ru/layero-vs-cloudflare-pages) (since 2025-06-09 Russian ISPs throttle Cloudflare to the first 16 KB per file), [vs Timeweb App Platform](https://layero.ru/layero-vs-timeweb) (free plan, folder and agent deploys, previews on every branch push, PostgreSQL with Data API, flat 990 ₽/month Pro vs hourly servers and 4.95 ₽ per 10,000 requests), [vs Beget](https://layero.ru/layero-vs-beget) and [vs Reg.ru](https://layero.ru/layero-vs-regru) (classic FTP hosting vs builds from Git, Next.js with SSR and branch previews). - [Deploying a site in Russia](https://layero.ru/deploy-sajta-v-rossii): overview for teams whose audience is in Russia. - Beginner guides: [publish a website](https://layero.ru/guides/kak-opublikovat-sajt-v-internete), [publish a site made by a neural network](https://layero.ru/guides/kak-opublikovat-sajt-iz-chatgpt), [upload an HTML site](https://layero.ru/guides/kak-vylozhit-html-sajt-s-kompyutera), [what deployment is](https://layero.ru/guides/chto-takoe-deploy). - [Changelog](https://layero.ru/changelog): what shipped and when. ## Links - Every docs page is also plain Markdown: append `.md` to its path (`https://docs.layero.ru/en/deploys/layero-json.md`); the list of pages is https://docs.layero.ru/en/llms.txt. - [Documentation (English)](https://docs.layero.ru/en/): the full docs — CLI, deploys, environments, runtime apps, domains, plans. - [Documentation (Russian)](https://docs.layero.ru/): the same docs in Russian; both are indexed in their own llms.txt. - [Deploying from AI agents](https://docs.layero.ru/en/cli/agents): what an agent should run in the CLI path, and what it gets back. - [GitHub Actions guide](https://docs.layero.ru/en/cli/github-actions): using the CLI from a pipeline. - [JSON events and error codes](https://docs.layero.ru/en/cli/json-events): the full schema emitted by `--json`. - [Agents: how it works](https://docs.layero.ru/en/agents/): the three paths, the skill and the MCP server. - [Agents: install](https://docs.layero.ru/en/agents/install): commands for every client, generated from agents-install.json. - [Skill and plugins on GitHub](https://github.com/LayeroInfra/layero-agents): the `layero` skill, Claude Code marketplace, Cursor and Codex adapters. - [CLI on npm](https://www.npmjs.com/package/layero): the `layero` package. - [Cursor rules drop-in](https://layero.ru/cursorrules): rules file for Cursor projects. Endpoints, not pages: MCP server `https://mcp.layero.ru/mcp` (Streamable HTTP — answers POST, a GET returns 406), API base `https://api.layero.ru`.