Now inviting automation leaders: publish your playbook as a skill, under your own name. Publish yours →
Automation Skills
All skills/Sf ai agentforce grid/Windows-and-auth
Reference · Sf ai agentforce grid

Windows-and-auth

Part of Sf ai agentforce grid. Install the skill and your agent reads this page when it needs the depth.

Windows And Auth

Auth Checklist

Use this sequence before any serious Grid work:

  1. sf org list --json
  2. If that fails with NoDefaultEnvError, run sf org list --json
  3. Pick the correct alias and run sf config set target-org <alias>
  4. Re-run sf org list --json

Common Windows Problems

curl ... | bash fails

Typical cause:

Correct response:

sf api request rest --body ... fails with JSON_PARSER_ERROR

This is a practical Windows/PowerShell quoting problem.

Do not waste time trying many quote variants.

Preferred fallback:

Direct REST Fallback

The bundled helper script delegates authentication to Salesforce CLI and sends JSON through a safe request spec rather than shell-built command strings. This avoids PowerShell quoting issues without pulling access tokens into Node directly.

Example:

node scripts/grid_api_request.mjs GET /workbooks
node scripts/grid_api_request.mjs POST /workbooks "{""name"":""My Grid Workbook""}"

Target a specific org alias:

node scripts/grid_api_request.mjs GET /llm-models --target-org sdo5

MCP Config Notes

Per-project .mcp.json is a good place to wire the Grid MCP for Codex.

Typical shape:

{
  "mcpServers": {
    "grid-connect": {
      "command": "node",
      "args": ["C:\\Users\\<user>\\.agentforce-grid\\agentforce-grid-mcp\\dist\\index.js"]
    }
  }
}

If Salesforce CLI has no default org, the MCP may exist but still fail at runtime.

Verification Commands

Use one of these to prove the org and Grid API are alive:

sf org list --json
node scripts/grid_api_request.mjs GET /workbooks
node scripts/grid_api_request.mjs GET /llm-models
node scripts/grid_api_request.mjs GET /agents

Publish your skill

Copy this prompt into Claude Code, Codex or any agent. It walks you through your first skill in about 20 minutes, with you as the author.

Click to copy.