Caddyfile for VS Code
Catch what caddy adapt would tell you—a global option inside a site, tls inside a handle block, a matcher you never defined, an unknown subdirective, an unclosed brace—while editing, without the Caddy binary.
Open source and maintained by Juan Torchia.
- Current release
- v0.1.0
- Marketplace downloads
- 0 Observed Dec 3, 2026
- Compatibility
- VS Code 1.110+ and Open VSX editors
- License
- MIT
See it in the editor






A focused tool for a specific workflow
Caddyfile validation, hover documentation from caddyserver.com, completion with placeholders, import navigation, a formatter consistent with caddy fmt, and TLS, security, and certificate checks inside VS Code.
- A language server with a catalog of Caddy v2.11.9 generated from the caddyserver.com docs and the Caddy source: 45 directives with their subdirectives, 41 global options, 17 request matchers, and 139 placeholders
- Diagnostics for global options in sites, directives in the global options block, site-only directives inside handle and route, undefined or duplicate matchers, snippets and named routes, and unbalanced braces
- Zero diagnostics on 400+ Caddyfiles that caddy adapt accepts: Caddy's own adapter tests, every docs example, and real projects
- Context-aware completion of directives, subdirectives, matchers, and placeholders, hover documentation from caddyserver.com, an outline of sites and snippets, and import navigation
- A formatter that writes what caddy fmt writes, checked against caddy fmt itself, without ever joining, splitting, adding, or removing lines
- TLS lint against the Mozilla Server Side TLS guidelines, a conservative security lint, certificate details for tls <cert> <key>, and an Open in CertView CodeLens
From install to a safer decision
- Install the extension and open a Caddyfile, Caddyfile.*, *.caddyfile, or *.caddy file, or a snippet file a Caddyfile imports.
- Review inline diagnostics and use context-aware completion, hover documentation, and Go to Definition for imports, snippets, named routes, and matchers while editing.
- Check TLS, security, and certificate findings, and open referenced certificates in CertView when it is installed.
- Run caddy adapt --validate (or the Check with caddy adapt command) before reloading the server.
How the pieces fit together
This is a textual architecture map grounded in the public implementation. Follow the source link to inspect the exact modules, tests, and release history.
The VS Code client activates for Caddyfiles, switches files that a workspace Caddyfile imports to the Caddyfile language, and owns editor commands, settings, and the Open in CertView CodeLens.
The client exchanges Language Server Protocol messages with a bundled language server whose tokenizer follows Caddy's lexer: quotes, backticks, heredocs, and line continuations.
The server checks statements against a catalog generated from pinned Caddy docs and source, a Mozilla TLS catalog pinned to guideline 6.0, and reads referenced certificate and key files with Node's built-in crypto.
Supported scope
- Caddyfile, Caddyfile.*, Caddyfile-*, *.caddyfile, *.Caddyfile, and *.caddy
- Snippet and site files imported by a workspace Caddyfile, whatever their name
- Global options, sites, snippets, named routes, single-site files without braces, and imported fragments
- Certificates and keys referenced by tls <cert> <key> and ca_root
Explicit boundaries
- Diagnostics are editor feedback, not a substitute for running caddy adapt or caddy validate against the target build and its plugins before reload or deployment.
- The extension has no telemetry and no network access. The caddy binary runs only when you invoke one of its optional commands, certificate and key files outside the workspace are read only after opting in, and private key content is never shown or sent anywhere.
- When filing public issues, use a minimal sanitized Caddyfile and remove hosts, addresses, credentials, certificates, and other production details.
Get help, verify changes, or contribute
Issues and release history stay with the source repository so the evidence remains public.
Need this kind of workflow inside your team?
Start with a bounded workflow review. Product support stays in public issues; organization-specific discovery and implementation follow a private path.