Skip to main content
The Guild CLI is your primary tool for creating, testing, and publishing agents locally.

Installation

Prerequisites

  • Node.js 18+ and npmnodejs.org
  • A Guild account — your Guild contact provides access

Install and authenticate

guild auth login opens your browser to sign in at app.guild.ai and configures your local npm registry for Guild packages.

Coding assistant skills

If you use Claude Code, install Guild CLI skills into your project:
This adds SDK reference and CLI workflow docs to .claude/skills/ so your coding assistant understands Guild agent development patterns.

Create an agent

The CLI prompts for a name, template, and category. Every agent requires a category, and any tags you provide are validated against that category’s allowed tags. Skip prompts with flags:

Templates

Project structure

Guild Native agents

When you initialize a Guild Native agent, the scaffold includes:
  • PROMPT.md — defines the agent’s role, behavior, and instructions.
  • DESCRIPTION.md — provides a brief description of what the agent does.
Guild Native agents skip the build validation step and immediately transition to READY after initialization.

Goose agents

When you initialize a Goose agent, the scaffold includes:
  • recipe.yaml — defines the agent’s parameters, instructions, and response JSON schema.
Goose agents skip the build validation step and immediately transition to READY after initialization.

Write your agent

Edit agent.ts. The template gives you a working starting point.

LLM agent

Define a system prompt and tools. No procedural code needed.
mode: "multi-turn" keeps the conversation going after each response. Use "one-shot" (default) when the agent should respond once and finish.
llmAgent wires ui_notify internally so progress notifications (task.ui.notify()) work, but hides it from the model unless you explicitly add ui_notify to your agent’s tools. Add userInterfaceTools if your agent needs ui_prompt or ui_ping.

Code-first agent

Write TypeScript that calls tools directly. Requires the "use agent" directive at the top of the file so the runtime can manage state between tool calls.

Tools overview

Agents have access to three categories of tools:
  • Service tools (gitHubTools, etc.) — call third-party APIs. When a user first triggers a service tool, Guild prompts them to connect their account via OAuth.
  • guildTools — query the Guild platform (agents, workspaces, sessions, triggers).
  • userInterfaceTools — interact with the user during a session (questions, progress updates).
All tool calls go through task.tools:

Available services

The runtime provides 7 service integrations (GitHub, Slack, Azure DevOps, Confluence, and more). Import them from their @guildai-services/* packages — don’t add them to package.json. See Service integrations for the full list with import paths.
Credentials for each service are configured at the organization level in Settings > Credentials at app.guild.ai. When an agent first uses a service tool, Guild prompts the user to connect if credentials aren’t already configured.

Development loop

The typical workflow: pull, edit, test, save.

Pull latest changes

If others are working on the same agent:

Test locally

guild agent test opens an interactive session. Ephemeral versions are created automatically when testing from a local agent directory. Changes to agent.ts take effect on the next save — no restart needed.
guild agent test includes only files tracked by Git. Files that are already committed or staged with git add are uploaded to the ephemeral version. New untracked files are ignored until you stage them with git add. Modified tracked files still upload their working-tree content, so you can test uncommitted changes to existing files without committing them first.

Chat with a published agent

To chat with a published agent by name, use guild workspace chat --agent from any directory:
guild chat opens The Smith, Guild’s built-in support agent. To chat with the generic workspace assistant or a specific agent, use guild workspace chat.

Save your work

This commits your code and creates a new version in the Guild backend. Versions start as drafts.
guild agent save -A/--all commits only modified tracked files. New files are untracked, so stage them with git add <file> (or git add .) before you run save -A.

Publish

--wait blocks until validation passes. --publish makes the agent available to your organization. Publish separately if needed:

Check status

Key rules

  • Agent code lives at agent.ts in the project root.
  • Don’t add @guildai/agents-sdk, zod, or @guildai-services/* to package.json — the runtime provides them.
  • Call tools through task.tools.<name>(args). Never access services directly.
  • Use guild agent save to commit and guild agent pull to sync. Don’t use raw git commands.
  • Don’t edit guild.json — it’s managed by the CLI.

Commands

Agent commands

Chat

Other commands

Diagnostics

Run guild doctor to check your setup:

Troubleshooting

  1. Check your internet connection.
  2. Run guild doctor to identify which check is failing.
Your default workspace may not match the target. Override with an environment variable:
Or set a new default:
Re-authenticate:
Run from inside an agent directory (one with a guild.json file), or pass the agent ID explicitly:
If a previous save committed locally but failed to push, run save again — it detects unpushed commits and resumes:
guild agent save -A/--all commits only modified tracked files, so a newly created file is untracked and is skipped. Stage it first, then save:
Check the latest version for errors and save again:
  1. Check for TypeScript errors in agent.ts.
  2. Make sure you’ve saved at least once: guild agent save --message "initial".
  3. Try a single message: guild agent chat "hello".