---
title: "Build with a coding agent"
description: "The steps a coding agent follows to build an agent on Guuey: install the CLI, scaffold a project, create the app, deploy, test and share it."
---

Give your coding agent this page's link with your task, or copy the prompt on the [home page](/). The steps below are written for the agent.

## Before you write anything

Read these as raw markdown before you change anything:

- [llms.txt](https://docs.guuey.com/llms.txt) and the pages it lists under "Start here".
- [The CLI guide](https://docs.guuey.com/cli.md), for every `guuey` command.
- [The HTTP API](https://docs.guuey.com/api.md), for any HTTP call.

Follow those pages exactly. Don't invent commands, flags, routes or fields they don't contain. If the task needs something they don't cover, tell the person you're working for and ask before you go further.

## The build loop

1. If `guuey` isn't found, install it:

   ```bash
   npm install -g @guuey/cli
   ```

2. If there's no project yet, scaffold one. Pass the framework so it doesn't stop to ask (`openai-agents-sdk` and `google-adk` work too):

   ```bash
   npx @guuey/create-agentic-app <name> --framework claude-agent-sdk
   ```

3. Run `guuey whoami`. If it prints `Not logged in` or `EXPIRED`, stop and ask the person to run `guuey login` themselves.

4. `guuey deploy` creates the app only from an interactive terminal, and yours most likely isn't one. So ask whether the agent is for them or for their customers, and create the app:

   ```bash
   guuey apps create --name "<name>" --for personal   # or --for customers
   ```

   `apps create` prints the App ID but doesn't write it into the project. Set it in `guuey.json` as `appId` yourself, or `guuey deploy` stops with `No app linked`.

5. Deploy, then check it:

   ```bash
   guuey deploy
   guuey test "hello"
   guuey logs
   ```

   Deploy and test again after each change.

## Distribute it

When `guuey test` answers, ask the person how people will reach the agent, then follow one path:

- **They want people using it quickly, with nothing else to build:** share it through Portal.
- **They're building their own product or site around it:** build it into their own app, and run it locally first.
- **They aren't sure:** start with Portal. The same agent can go into their own app later.

### Share it through Portal

Portal (`app.guuey.com`) is Guuey's app where people find agents and chat with them, so there's no frontend to build or host.

1. `guuey deploy` ends with a Portal link, `https://app.guuey.com/agent/<appId>`. Anyone with the link can open the agent. It isn't listed in Portal until you publish it.
2. For a readable link, claim a slug (3 to 50 lowercase letters, digits and hyphens). The agent then also opens at `https://app.guuey.com/agent/<slug>`, and the command prints the address of the agent's own page:

   ```bash
   guuey slug claim <slug>
   ```

3. Ask whether people can chat without signing in, and set it:

   ```bash
   guuey apps access --guests on   # or --guests off
   ```

4. To list the agent in Portal's Explore tab, ask the person first, then publish:

   ```bash
   guuey apps publish --name "<name>" --description "<one line>"
   ```

   The listing goes live right away, with no review step. It needs a plan on the app. Without one, the command is refused and the listing is saved without being published. List only an agent that can't change anyone's data, and share an agent that uses connected accounts by its link instead. Guuey doesn't check this for you. `guuey apps unpublish` takes the agent out of Explore, and its link keeps working.

### Build it into their own app

Run it locally first, then deploy it and connect the frontend. These steps are for a project scaffolded from the default template.

1. Install and set up the project:

   ```bash
   pnpm install
   pnpm bootstrap -- --yes
   ```

2. Locally, the agent calls the model with the person's own key. Ask them to fill in the key `.env.local` names for their framework: `ANTHROPIC_API_KEY`, `OPENAI_API_KEY` or `GEMINI_API_KEY`. Don't write a key yourself.
3. Start the local stack:

   ```bash
   pnpm dev
   ```

   The web app runs at `http://localhost:6890` and the agent at `http://localhost:6790`. Locally, the agent runs as a plain process with the person's shell environment, without the isolation it has on Guuey. A project without the web app runs the agent alone with `guuey dev --serve`. Plain `guuey dev` doesn't start a server.

4. When it works locally, deploy and connect the frontend to the deployed agent. Pass the origins the frontend will be served from:

   ```bash
   guuey deploy
   pnpm bootstrap -- --link --domains https://<their-site>
   ```

   Guuey hosts the agent, not the web app. The person hosts the built frontend wherever they host their sites.

To put the agent on a site they already have, add the [widget](/install-widget/) (one script tag) or [`@guuey/chat`](/chat/), and allow the site's origin with `guuey apps update --domains https://<their-site>`.

## Keep in mind

- Keep secrets out of `guuey.json`. Set them with `guuey env set KEY=VALUE`.
- You don't need a model key: Guuey supplies the model by default. To use their own provider key, the person adds it in the console under **Behavior → Model**.
- New projects start with Generative UI off. To turn it on, delete `"ggui": false` from `agent.mcpServers` in `guuey.json` (see [Generative UI](/protocol/)).