Developing Extensions
Zed extensions are Git repositories written in Rust and compiled to WebAssembly. This guide covers creating, testing, and publishing extensions.Prerequisites
Before developing extensions, install:- Rust via rustup: rust-lang.org/tools/install
- Must be installed via rustup (not Homebrew or other package managers)
- Git: For version control and publishing
Creating an Extension
Project Structure
Create a new directory for your extension:Manifest File
Createextension.toml with metadata:
-theme (e.g., my-theme-theme).
Rust Package (Optional)
For extensions with custom code, createCargo.toml:
zed_extension_api version from crates.io. Check compatibility with your target Zed versions.
Extension Code
Createsrc/lib.rs and implement the Extension trait:
Extension Capabilities
Language Servers
Define language servers inextension.toml:
Downloading Language Servers
Use the extension API to download and install binaries:Tree-sitter Grammars
Register Tree-sitter grammars inextension.toml:
file:// URL:
Slash Commands
Define slash commands inextension.toml:
Capabilities and Permissions
Some operations require explicit capabilities inextension.toml:
Testing Extensions Locally
Install as Dev Extension
- Open Zed
- Open the Extension Gallery
- Click Install Dev Extension
- Select your extension directory
- Override published extensions with the same ID
- Rebuild automatically when you change files
- Show “Overridden by dev extension” in the gallery
Debugging
View extension output:- Zed Log: Open with
zed: open logor Zed > View Logs - Console Output: Launch Zed from terminal with
zed --foregroundto seeprintln!anddbg!output
Troubleshooting
Common issues:- Extension won’t build: Ensure Rust is installed via rustup
- Language server won’t start: Check file permissions with
ls -lin extension’s work directory - Changes not reflected: Uninstall and reinstall the dev extension
- WASM build errors: Check
zed_extension_apiversion compatibility
Publishing Extensions
Extensions are published via pull request to zed-industries/extensions.License Requirements
As of October 1st, 2025, extensions must include one of these licenses:- Apache 2.0
- BSD 2-Clause
- BSD 3-Clause
- GNU GPLv3
- GNU LGPLv3
- MIT
- zlib
LICENSE file to your repository root. See license validation for details.
Publishing Steps
-
Fork the extensions repository
- Fork zed-industries/extensions to your personal GitHub account (not an organization)
-
Clone and prepare
-
Add your extension as a submodule
Important: Use HTTPS URLs, not SSH (
[email protected]). -
Update
extensions.tomlAdd an entry for your extension:If your extension is in a subdirectory, add apathfield: -
Sort extensions
-
Create a pull request
- Commit your changes
- Push to your fork
- Open a PR to
zed-industries/extensions
- Don’t include “zed” or “Zed” in the extension ID or name
- Theme extensions should end with
-theme
Updating Extensions
To publish an update:-
Update the submodule to the new version:
-
Update the version in
extensions.tomlto matchextension.toml -
Run
pnpm sort-extensions - Commit and create a pull request
API Reference
Thezed_extension_api crate provides:
Core Types
Extensiontrait: Main extension interfaceCommand: Command to executeWorktree: Project workspaceLanguageServerId: Language server identifier
Helper Functions
download_file: Download and extract fileslatest_github_release: Get latest GitHub releasenpm_install_package: Install npm packagescurrent_platform: Get OS and architectureset_language_server_installation_status: Update UI status
Resources
Examples
The Zed repository includes example extensions:- test-extension: Language server installation, GitHub releases
- html: npm package installation
- slash-commands-example: Custom slash commands
- glsl: Grammar-only extension
Next Steps
- Language Extensions: Add programming language support
- Theme Extensions: Create custom themes
- Extension Capabilities: Security and permissions
