Installation
Prerequisites
- Node.js 18+ and npm — nodejs.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:.claude/skills/ so your coding assistant understands Guild agent development patterns.
Create an agent
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.
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.
READY after initialization.
Write your agent
Editagent.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).
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, useguild 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
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.tsin the project root. - Don’t add
@guildai/agents-sdk,zod, or@guildai-services/*topackage.json— the runtime provides them. - Call tools through
task.tools.<name>(args). Never access services directly. - Use
guild agent saveto commit andguild agent pullto 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
Runguild doctor to check your setup:
Troubleshooting
"Connection refused" or "Cannot connect to server"
"Connection refused" or "Cannot connect to server"
- Check your internet connection.
- Run
guild doctorto identify which check is failing.
"Workspace not found" or wrong workspace
"Workspace not found" or wrong workspace
Your default workspace may not match the target. Override with an environment variable:Or set a new default:
"Not authenticated" from Guild CLI
"Not authenticated" from Guild CLI
Re-authenticate:
"No agent ID provided and not in an agent directory"
"No agent ID provided and not in an agent directory"
Run from inside an agent directory (one with a
guild.json file), or pass the agent ID explicitly:"No changes to commit" after a failed save
"No changes to commit" after a failed save
If a previous save committed locally but failed to push, run save again — it detects unpushed commits and resumes:
New file missing from a saved version
New file missing from a saved version
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:Validation failures
Validation failures
Check the latest version for errors and save again:
Agent test not responding
Agent test not responding
- Check for TypeScript errors in
agent.ts. - Make sure you’ve saved at least once:
guild agent save --message "initial". - Try a single message:
guild agent chat "hello".