AI agents: machine-readable docs and automated org setup at /llms.txtAI agents: read setup instructions as HTML at /llms.html

Setting Up Codex for Agentforce

Getting Started with Codex

You need an org with Agentforce enabled. Get a LabBox if you need one.

1. Install Codex CLI

1
codex --version

2. Connect Salesforce

Install Salesforce CLI if needed:

1
sf --version

The output should start with @salesforce/cli/.

If the org is already authorized, skip sign-in and use its existing alias.

Use your chosen alias with --target-org in later commands. Include your chosen org alias when you paste the build prompt.

3. Install Agentforce skills

Run this in your project directory:

1
npx skills add forcedotcom/sf-skills

Select your coding tool and the agentforce-generate, agentforce-test, and agentforce-observe skills. Skip this step if they are already available. Restart your coding tool if it does not discover them.

Other installation options.

4. Build an agent

In your project directory, run codex and follow the sign-in prompts. Then paste this prompt.