Domains
Register or transfer a domain with free WHOIS privacy and Lyrcloud DNS, paid by card or with Lyrpay.
Learn moregit push to global in seconds.Everything you need to build on Lyrcloud: a CLI, local dev runtime, framework adapters, and APIs for every product.
npm install -g lyrcloud
lyrcloud init hello-edge
cd hello-edge
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.
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.
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 },
});
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']);
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.
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
}
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
| Command | Description |
|---|---|
lyrcloud login | Sign 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 dev | Run the project on localhost:8787 with the same runtime as production, reloading on every edit. |
lyrcloud deploy | Upload the project and make it live at https://<name>.dev.lyr. |
lyrcloud list | List 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 / logout | Show 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 storage | List the namespaces and buckets your functions bind. |
lyrcloud ai models | run | usage | See 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. |
Register or transfer a domain with free WHOIS privacy and Lyrcloud DNS, paid by card or with Lyrpay.
Learn moreResponse caching, static files and whole static sites for your edge functions, with cache headers you control and purges from the CLI.
Learn moreRate 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 moreDeploy JavaScript fetch handlers from the lyrcloud CLI. Each function runs in its own isolated sandbox and goes live at https://<name>.dev.lyr.
Learn morePut 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 moreenv.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 moreKey-value namespaces and file buckets your edge functions use through env, managed from the lyrcloud CLI. Each accountβs data is kept apart.
Learn moreCreate a free account and deploy your first function in under five minutes.