ArchLex Documentation
ArchLex turns text architecture definitions into accessible SVG diagrams. One language covers AWS, Google Cloud, Kubernetes, and Cloudflare. Agents write it. Humans can still read it.
Start here
- Use with AI agents — install the skill, connect MCP, ask for a diagram.
- Open the playground to edit the source yourself.
- Getting Started walks through the TypeScript API when you want to embed ArchLex.
Supported Providers
| Provider | Directive | Package | Example resources |
|---|---|---|---|
| AWS | provider aws | @archlex/aws | Lambda, ECS, RDS, S3 |
| Cloudflare | provider cloudflare | @archlex/cloudflare | Workers, R2, DNS, Tunnel |
| Google Cloud | provider gcp | @archlex/gcp | Cloud Run, GKE, Cloud SQL, BigQuery |
| Kubernetes | provider k8s | @archlex/k8s | Deployment, Service, Ingress, StatefulSet |
Cloudflare includes 92 resources with bundled artwork and root/account containment validation. See the Cloudflare pack guide for aliases, connectors and mixed-provider examples. Validation does not establish runtime connectivity, security-policy effectiveness or failover health.
First Render
Install the core and provider packages:
npm install @archlex/core @archlex/aws @archlex/cloudflare @archlex/gcp @archlex/k8sRegister one shared provider set. Each source selects a default with the provider directive; qualified kinds can combine registered providers.
import {
awsProvider,
cloudflareProvider,
createArchLex,
gcpProvider,
k8sProvider,
} from "@archlex/core";
const archlex = createArchLex({
providers: [awsProvider(), cloudflareProvider(), gcpProvider(), k8sProvider()],
});
const result = await archlex.render(`
direction LR
provider aws
validation normal
alb -[routes]-> ecs
ecs -[writes]-> rds
`);
console.log(result.svg);Choose Your Next Page
- Use with AI agents: skill, MCP, and a first prompt for Claude, Cursor, and Codex.
- Getting Started walks through setup, provider examples, rendering, and diagnostics.
- Language Specification defines directives, scopes, resources, containment, and relationships.
- Public API covers parsing, analysis, icon preparation, rendering, and catalog access.
- AWS, Google Cloud, and Kubernetes pages list provider contracts and rules.
- Cloudflare Pack covers Cloudflare usage, aliases, containment, artwork and four complete examples.
- Error Reference explains diagnostic families, severity, validation modes, and remediation.
Use the interactive playground when you want to edit an example and inspect the SVG beside its diagnostics.