Zed Documentation

repository·main·Indexed 19 days ago

https://github.com/zed-industries/zed

Documentation for Zed, a high-performance, multiplayer code editor with deep AI integration. Includes technical guides on implementing Agent Skills via the Agent Client Protocol (ACP), configuring SKILL.md frontmatter, managing skill discovery (global and project-local), and setting up the Zed collaboration server for local development and deployment.

Tokens
158.5K
Snippets
397
Records
846
Agent score
99%

What's inside zed-industries/zed

  1. Overview of AI in Zed

    main

    Zed's AI capabilities are categorized into three main areas to help you choose the right workflow:

    1. Agents: Defines how agentic work is executed. This includes the native Zed Agent, External Agents (via ACP), and Terminal Threads.
    2. Model Access: Defines how Zed connects to language models. Options include Zed-hosted models, direct API access, subscriptions, gateways, and local models.
    3. Features: The specific AI workflows available, such as Agentic editing, Inline Assistant, Edit Prediction, and Git assistance.

    To get started quickly, use the AI Quick Start guide.

  2. Overview of Zed Business features

    main

    Zed Business is a subscription tier designed for teams requiring hosted AI access with centralized administrative controls and enforced data privacy.

    Key features include:

    • Hosted AI Access: Members with a paid Business seat get access to all Zed-hosted AI models and unlimited Edit Predictions.
    • Enforced Data Controls: Administrators can manage settings for the entire organization via the Data & Privacy dashboard. These controls include:
      • Zed Model Provider settings
      • Edit Predictions settings
      • Edit Prediction Feedback settings
      • Agent Thread Feedback settings
    • Privacy Protections: Zed does not store prompts or train on them without explicit opt-in. While Data sharing for AI improvement is opt-in for members, administrators can enforce this org-wide to block members from opting in entirely.
    • Role-Based Access Control: Includes specific roles for Owners, Admins, Billing Managers, and Members. Billing Managers can manage billing without consuming a paid Business seat.
    • Consolidated Billing: All licenses and AI usage are managed on a single organization invoice.
  3. Untitled record

    main

    Ruby support in Zed is provided via the Ruby extension. It includes support for tree-sitter (ruby, embedded-template), various language servers, and the rdbg debug adapter. It also provides support for ERB files (HTML, JS, and YAML ERB).

    Supported Language Servers

    Zed supports several language servers for Ruby. Note that you cannot use solargraph and ruby-lsp at the same time.

    • Primary LSPs: solargraph (enabled by default) and ruby-lsp.
    • Linters/Analyzers: rubocop (for offense detection and autocorrection).
    • Type Checkers: sorbet (gradual type system) and steep (uses RBS).
    • Specialized LSPs: Herb (for ERB files), kanayago, fuzzy-ruby-server, and tailwindcss-language-server (for Tailwind CSS integration).
  4. Understand Sandboxed Terminal Tool Behavior

    main

    When Zed Agent runs a command within a sandbox, the following restrictions and permissions apply:

    • Filesystem Read: Can read the filesystem, including protected Git metadata.
    • Filesystem Write: Can write inside open project directories (except protected Git metadata) and to /tmp.
      • Note: /tmp is a fresh, temporary filesystem cleared between calls unless you approve unrestricted filesystem writes, in which case it uses your host's /tmp.
    • Git Metadata: Cannot write to protected Git metadata.
    • Network: Cannot reach the network unless network access is approved.
      • Linux Note: When host-specific network access is approved, Zed uses an HTTP/HTTPS proxy. Tools that do not honor proxy environment variables (e.g., SSH, FTP, raw socket clients) may fail.
    • Windows/WSL Note: On Windows, sandboxing only works when the agent action runs inside WSL. In WSL, network access is all-or-nothing (host-specific requests are rejected). If running natively on Windows, the command runs in your standard shell (bash, PowerShell, or cmd.exe) without OS-level sandboxing.
  5. Manage AI Data Sharing on Zed Business

    main

    On Zed Business, data sharing is disabled by default. Organization administrators control data sharing and can prevent members from:

    • Submitting agent thread feedback.
    • Opting into Edit Prediction training data collection.

    Refer to the Business Privacy and Admin Controls documentation for specific management instructions.

  6. Understand Intellectual Property and Feedback rights

    main

    Under the Zed Terms of Service:

    • Customer Rights: You retain all intellectual property rights and other rights in and to your Customer Data and Output.
    • Zed Rights: Zed and its licensors retain all intellectual property rights in the Service and Software.
    • Feedback: If you provide suggestions, comments, or feedback regarding Zed's products, services, or technology (Feedback), Zed has the unrestricted right to use or incorporate that feedback to improve its products without attribution to you.
  7. Review Edit Prediction Training Data Collection

    main

    For open source projects where training data collection is opted in, Zed may collect:

    • Code excerpts around your cursor.
    • Recent edit diffs.
    • The generated prediction.
    • Repository URL and git revision.
    • Buffer outline and diagnostics.

    This data is anonymized and used to fine-tune models like Qwen2.5-Coder-7B. The resulting training dataset is publicly available at huggingface.co/datasets/zed-industries/zeta.

  8. Explore Zed extension capabilities

    main

    Zed's extension system allows users to add new functionality to the editor. Extensions can provide various capabilities, including:

    • Themes: Customizing the visual appearance of the editor.
    • Language Support: Adding syntax highlighting, language servers (LSP), and other language-specific features.
    • Icon Themes: Customizing file and folder icons.
    • AI Tools: Extending the editor's AI capabilities.
    • Snippets: Adding reusable code fragments.
    • MCP Servers: Integrating Model Context Protocol (MCP) servers to enhance AI agent capabilities.
    • Debugger Extensions: Adding support for new debugging workflows.
  9. Manage Zed Business Organizations

    main

    A Zed organization centralizes a team's Zed Business subscription, members, billing, and admin controls.

    Key Concepts

    • Personal Organizations: Every Zed account includes a personal organization created at sign-up. This is separate from any team organizations you join and remains active regardless of other memberships.
    • Multiple Organizations: A single Zed account can belong to multiple organizations simultaneously. Each organization maintains its own independent subscription, billing, and admin settings.

    Switching Organizations

    • In the Zed Editor: Click the organization name in the title bar to view all organizations you belong to and switch between them.
    • In the Dashboard: Use the organization switcher located in the top-left corner of the dashboard interface.
  10. Understand GPUI Contexts

    main

    GPUI uses context parameters (conventionally named cx) to provide access to application state, services, and entities. These contexts act as references that allow functions to interact with global state, windows, and specific entities.

    Core Context Types

    • App: The root context. It provides access to the application's global state and owns all entity data. It is used to read or update data referenced by an Entity<T>.
    • Context<T>: A context specific to an Entity<T>. It includes methods for interacting with that entity, such as notifying observers or emitting events. A Context<T> can be dereferenced into an App reference, so any function accepting &App can also accept &Context<T>.
    • AsyncApp and AsyncWindowContext: Created by calling .to_async() on a context reference. These have a 'static lifetime, allowing them to be held across .await points in asynchronous code. Note that interactions using these contexts are fallible, as the context might outlive the window or the application itself.
    • TestAppContext: Specialized async contexts used for testing. They include test-specific features and will panic if you attempt to access a non-existent app or window.
  11. Understand AI Privacy and Data Retention in Zed

    main

    Zed's AI features (Zed Agent, Edit Prediction, Inline Assistant, and Git commit generation) follow specific privacy boundaries depending on the request path. By default, Zed does not retain your prompts or code context.

    AI Request Paths

    PathWho handles requestsPrivacy Note
    Zed-hosted modelsZed routes to providersProviders are prohibited from training on your data and require zero data retention (except for designated safety-retention models)
    Provider API keysThe configured providerRequests are handled under the provider's terms. Keys are stored in the system keychain, not settings.json
    Existing subscriptionsThe subscription providerRequests are handled under the subscription terms
    GatewaysThe gateway and upstream providersHandled under gateway/upstream terms
    Local modelsLocal server or self-hosted endpointHandled according to your local server configuration
    External AgentsThe External Agent and its providersHandled under the agent's own terms
    Terminal ThreadsThe CLI or TUI in the terminalThe CLI/TUI owns its auth, routing, and data handling
    Edit PredictionThe selected providerKeystrokes send local context to the provider. Zeta requests are transient unless training opt-in is enabled
    Agent tools/MCPZed, MCP servers, and external systemsPermissions depend on profile, MCP server, and tool settings
    Project trustZed and the trusted worktreeInstructions are loaded from trusted worktrees

    Zed-Hosted Model Commitments

    For models hosted by Zed, providers like Anthropic, Google, and OpenAI have agreements that prohibit training on your prompts or code context and require zero data retention for inference requests.