Developer hub

From git push to global in seconds.

Everything you need to build on Lyrcloud: a CLI, local dev runtime, framework adapters, and APIs for every product.

Quickstart

Deploy your first edge function

  1. Install the CLI

    npm install -g lyrcloud
  2. Create a project

    lyrcloud init hello-edge
    cd hello-edge
  3. Write your handler

    export default {
      fetch(request, env) {
        const url = new URL(request.url);
        return new Response(env.GREETING + ' from ' + url.hostname);
      },
    };

    Try it locally with lyrcloud dev. env holds the vars in lyrcloud.json.

  4. Deploy

    lyrcloud login
    lyrcloud deploy
    βœ“ Deployed hello-edge in 4.2s
      https://hello-edge.dev.lyr

    .dev.lyr addresses open on devices set up for Lyr DNS.

Storage

Keys and files in your functions

Name a KV namespace or a bucket in lyrcloud.json, and it appears on env. lyrcloud dev keeps the data in .lyrcloud/ while you work.

{
  "name": "hello-edge",
  "main": "index.js",
  "kv": { "CACHE": "cache" },
  "buckets": { "FILES": "uploads" }
}
const n = Number(await env.CACHE.get('visits') ?? 0) + 1;
await env.CACHE.put('visits', String(n), { expirationTtl: 86400 });

await env.FILES.put('notes/a.txt', 'hello');
const file = await env.FILES.get('notes/a.txt');
return new Response(file.body, {
  headers: { 'content-type': file.httpMetadata.contentType },
});
AI

AI models in your functions

Add "ai": "AI" to lyrcloud.json. Run lyrcloud ai models to see what your plan includes.

const answer = await env.AI.run('claude-sonnet-4.6', {
  system: 'You are a helpful support agent.',
  messages: [{ role: 'user', content: 'Where is my order?' }],
  max_tokens: 300,
}, { cache: 600, fallback: ['claude-haiku-4.5', 'nova-lite'] });
// { response, usage: { input_tokens, output_tokens }, model, cached }

const { data } = await env.AI.embed(['first text', 'second text']);
Access

Protect a function with sign-in

Add access to lyrcloud.json. Visitors sign in with Lyrcloud, and only the emails and domains you list get through. Your code reads who they are from lyr-access-email.

"access": {
  "allow": ["ada@example.com", "@yourcompany.com"],
  "paths": ["/admin"]
}
const email = request.headers.get('lyr-access-email');
// "ada@example.com" on /admin, null on public paths

// Send people to /__lyrcloud/logout to sign out.
Security

Rate limits, firewall and bot checks

Add security to lyrcloud.json. Rules run before your code, and lyrcloud security log shows what they stopped.

"security": {
  "rateLimits": [{ "path": "/api", "requests": 100, "per": "1m" }],
  "waf": "block",
  "bots": { "mode": "challenge", "paths": ["/login"] },
  "blockIps": ["203.0.113.0/24"],
  "headers": true
}
CDN

Caching and static sites

Return Cache-Control: public, max-age=… and Lyrcloud serves repeats from cache. Add "assets": "public" to serve a folder of files, or start a static site with lyrcloud init my-site --static.

"assets": { "dir": "public", "spa": true }
lyrcloud cache purge                  # everything
lyrcloud cache purge --path /pricing
lyrcloud cache purge --prefix /blog
Reference

CLI commands

CommandDescription
lyrcloud loginSign in with your Lyrcloud account in the browser (--email for email and password).
lyrcloud init <name> [--static]Create a new edge function project, or a static site, in ./<name>.
lyrcloud devRun the project on localhost:8787 with the same runtime as production, reloading on every edit.
lyrcloud deployUpload the project and make it live at https://<name>.dev.lyr.
lyrcloud listList your functions, their status and addresses.
lyrcloud logs [name] [-f]Show recent logs; -f keeps following, --since 2h looks further back.
lyrcloud delete [name]Take a function offline and free its name.
lyrcloud whoami / logoutShow who you’re signed in as, or sign out on this computer.
lyrcloud kv list|get|put|delete <ns>Read and write a KV namespace your functions use.
lyrcloud bucket list|put|get|delete <bucket>Upload, download and list files in a bucket.
lyrcloud storageList the namespaces and buckets your functions bind.
lyrcloud ai models | run | usageSee the models on your plan, ask one from the terminal, and check this month’s tokens.
lyrcloud access log [name]See who signed in to a protected function, allowed or refused.
lyrcloud security log [name]See which requests your security rules blocked or logged.
lyrcloud cache purge [--path | --prefix]Clear cached responses for a function: everything, one path or a prefix.

Product guides

🌐

Domains

Register or transfer a domain with free WHOIS privacy and Lyrcloud DNS, paid by card or with Lyrpay.

Learn more
⚑

Global CDN

Response caching, static files and whole static sites for your edge functions, with cache headers you control and purges from the CLI.

Learn more
πŸ”’

Application Security

Rate limits, IP rules, a firewall for common attacks, bot checks and secure headers for your edge functions, set in lyrcloud.json and enforced before your code runs.

Learn more
{}

Edge Functions

Deploy JavaScript fetch handlers from the lyrcloud CLI. Each function runs in its own isolated sandbox and goes live at https://<name>.dev.lyr.

Learn more
πŸ›‘

Zero Trust Access

Put any edge function, or just some of its paths, behind Lyrcloud sign-in with an allow-list of emails and domains. Every decision is logged.

Learn more
πŸ€–

AI Gateway & Inference

env.AI gives your edge functions chat models and embeddings, with fallbacks, response caching, per-plan limits and usage by model. Models run on Amazon Bedrock.

Learn more
β–£

Storage & Databases

Key-value namespaces and file buckets your edge functions use through env, managed from the lyrcloud CLI. Each account’s data is kept apart.

Learn more

Ready to ship?

Create a free account and deploy your first function in under five minutes.