Installation
Prerequisites
- Node.js 18+ and npm — nodejs.org
- Google Cloud SDK (gcloud) — cloud.google.com/sdk/docs/install
- A Guild account — your Guild contact provides a Google account with access
- The Guild CLI tarball — available from the Guild CLI Google Drive shared with your team
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
| Template | Use when |
|---|---|
LLM | The LLM drives the logic. You write a prompt and pick tools. Start here. |
AUTO_MANAGED_STATE | You write procedural TypeScript that calls tools inline. |
BLANK | You want full control over the agent lifecycle. |
Project structure
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 automatically includes userInterfaceTools — no need to add them to your tools object.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,slackTools, 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).environmentTools— manage Docker containers for code execution.
task.tools:
Available services
The runtime provides 10 service integrations (GitHub, Slack, Jira, Bitbucket, Azure DevOps, Confluence, Figma, 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. Changes to agent.ts take effect on the next save — no restart needed.
--ephemeral creates a temporary version for testing without committing to version history. Useful for quick iteration before you’re ready to save.
Save your work
Publish
--wait blocks until validation passes. --publish makes the agent available in the catalog.
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
Other commands
Diagnostics
Runguild doctor to check your setup:
Troubleshooting
"gcloud CLI not found"
"gcloud CLI not found"
"Not authenticated to Google Cloud"
"Not authenticated to Google Cloud"
Run
gcloud auth login with the Google account your Guild contact provided. This is required before guild auth login will work."Connection refused" or "Cannot connect to server"
"Connection refused" or "Cannot connect to server"
- Check your internet connection.
- Verify you’ve run
gcloud auth login. - 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:
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".