# Headless Agentforce Examples

[Agentforce Examples](/docs/ai/agentforce/guide/agent-examples.md) includes headless development examples that show you how to build, deploy, and use Agentforce agents without the Salesforce UI. Look for examples in the table in End-to-End Agents with a Yes in the Headless Instructions column. The multi-surface examples show you how to complete the steps using Headless, Canvas (Salesforce UI), and sometimes Agent Script by choosing the tab for your preferred method.

## Prerequisites

The headless examples have similar prerequisites. Each headless example links to these prerequisites, as needed.

Let's set up your org for headless development and choose a headless development tool.

### Step 1: Set Up a Salesforce Developer Edition Org

To sign up, see [Salesforce Developer Edition](https://www.salesforce.com/products/free-trial/developer/). If you’d prefer to use a different Salesforce org, verify that Einstein and Agentforce are both enabled. Your user permissions and other org settings can affect your ability to complete all the steps in the examples.

:::note
Don’t run the examples on a production org because we are making changes in your org.
:::

### Step 2: Enable Einstein and Agentforce

1. Log in to the Salesforce Developer Edition org.
2. Provision and set up Data 360, and then enable Einstein Generative AI and Agentforce. See [Set Up Einstein Generative AI and Agentforce](/docs/ai/agentforce/guide/org-setup.md).

### Step 3: Install and Authorize Salesforce CLI

1. To see if Salesforce CLI is already installed, run the `sf version` command from the command line. If it's already installed, run `sf update` to update to the latest version.
2. If Salesforce CLI isn't installed, [install it](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm).
3. To [authorize your org](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth.htm), run this terminal command.

```bash
sf org login web --alias headless
```

4. When the login window appears, log in to your org and click **Allow**.
5. Ensure that you have the [required permissions](https://developer.salesforce.com/docs/ai/agentforce/guide/agent-dx-set-up-env.md#assign-system-permissions) to publish and preview an agent in your org.
6. In your terminal, run `sf org list`. If you see the `headless` org alias in the list, you’re successfully authenticated.

### Step 4: Choose a Headless Development Tool

Headless Agentforce development doesn't lock you into a single toolchain. The right choice for you depends on your preferences and the requirements for your development environment.

Two common starting points are Agentforce Vibes or third-party AI coding tools, such as Claude Code, grounded with the [Salesforce skills library](/docs/ai/agentforce/guide/skills-plugins.md). For more information, see [Headless Development Tools](/docs/ai/agentforce/guide/headless-tools.md).

#### Claude Code Plugin (Optional)

If you're using Claude Code, run this command in your terminal to install the [salesforce-development](https://claude.com/plugins/agentforce-adlc) plugin.

```bash
claude plugin install salesforce-development@claude-plugins-official
```

This plugin includes a broad set of skills for Salesforce headless development. The plugin includes the `agentforce-generate`, `agentforce-test`, and `agentforce-observe` skills, which are focused on working with Agentforce agents.

#### Agentforce Vibes (Optional)

Agentforce Vibes is an AI-powered coding companion that helps you build and modify Salesforce apps and agents using natural language. Instead of manually writing Agent Script code or running CLI commands, you describe what you want, and Agentforce Vibes does the work. Under the hood, Agentforce Vibes uses Agentforce DX, the pro-code toolset for building agents. Agentforce Vibes comes with specialized skills for developing agents. These skills activate automatically based on your prompts.

See [Get Started with Agentforce Vibes](https://developer.salesforce.com/docs/platform/agentforcevibes/guide/afv-get-started.md) in the Agentforce Vibes Developer Guide.

### Step 5: Start Building

**Before we start: A note on working with your AI assistant**

Throughout these headless examples, you use large language models (LLMs) to build agents in your org. Because LLMs are probabilistic, outputs can vary from run to run. If you encounter an error or an unexpected result, describe what happened to the LLM in plain language and your AI assistant will help you diagnose and fix the issue. With this conversational approach, you iterate quickly and reach a working solution.

## See Also

- [Headless Agentforce Development](/docs/ai/agentforce/guide/headless.md)
- [Headless Development Tools](/docs/ai/agentforce/guide/headless-tools.md)
- [Agentforce Plugins and Skills](/docs/ai/agentforce/guide/skills-plugins.md)
