bots-garden/mini-mepublic Fork
⑂ v1.1.0
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/mini-me.git
git clone ssh://git@rickub.com/bots-garden/mini-me.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP
create-an-agent-from-an-editor.md · 73 lines · 6.6 KBmarkdown
Blame HistoryOpen raw

How to create an agent from your editor (mm acp-create)

This guide shows how to create an agent.yaml without a terminal, from any editor or tool that speaks the Agent Client Protocol (Zed, a JetBrains IDE, a Neovim plugin…). mm acp-create serves the questions of mm init over ACP and writes the same file. It assumes mm is installed on your PATH and that a model server is running (the wizard lists its models).

Steps

  1. Register mm acp-create as an agent server in your client. In Zed, add to settings.json:

    {
      "agent_servers": {
        "mm-create": {
          "type": "custom",
          "command": "mm",
          "args": ["acp-create"]
        }
      }
    }
    

    Other clients take the same two things: the command mm and the argument acp-create. No configuration file is needed: this mode reads none.

  2. Open the project the agent will work in, start a new thread with mm-create, and send /start (or any message). The wizard starts. The file will be written in the project's directory — the session's working directory — not where the client started mm.

  3. Answer the questions. How they are asked depends on what your client can show:

    • A client that shows forms (it advertises the elicitation.form capability): the questions come in a few forms, the defaults already filled in. A question whose choices depend on an earlier answer — the model list on the server you chose — comes in the next form.
    • Any other client: each question is a message, with numbered choices. Reply with a number or a value; . takes the default.
  4. Read the closing message. It shows ✅ wrote agent.yaml and ✅ mm loads it, then the command that starts the agent, mm acp /absolute/path/to/agent.yaml. Zed gets a ready agent_servers entry; for another client, use that command line.

  5. To run the agent in a container or a Docker Sandbox rather than on your machine, send /dockerinit (writes Dockerfile and compose.yaml) or /sbxinit (writes sbxenv.yaml) in the same thread. See run mini-me in a container and run mini-me in a Docker Sandbox.

  6. Send /zedconfig. It shows the agent_servers entries for every way the project can now start its agent — on your machine, in its container, in its sandbox — and what to start first for each. Copy the ones you want into your client's settings, and start a thread with one of them: this one is your agent.

Commands during the wizard

Command What it does
/start Starts the wizard; once started, asks the current question again.
/preview Shows the agent.yaml as it would be written now.
/back Takes back the last answer and asks it again.
/write Takes the default for every question left and writes the file (replacing an existing file is still asked).
/restart Forgets every answer and starts again.
/dockerinit Writes a Dockerfile and a compose.yaml in the project to run the agent in a container — mm dockerinit for this project. Takes its flags (--name, --agent); existing files are kept unless you add --overwrite.
/zedconfig Shows Zed's agent_servers entries for this project's agent, from what the project holds: mm acp <agent file> always; with a compose.yaml, docker exec -i <container> mm -acp -config <agent file>; with a sbxenv.yaml, sbx exec -i <sandbox> mm -acp -config <agent file> — each with what to start first.
/sbxinit Writes a sbxenv.yaml in the project to run the agent in a Docker Sandbox — mm sbxinit for this project. Takes its flags (--name, --workspace, --agent); an existing sbxenv.yaml is kept unless you add --overwrite. Works at any time; after the agent is written, the sandbox is named after it.
/skillcreate Creates a skill for the project's agent — mm skillcreate for this project: see Create a skill from the same thread.
/cancel Gives up the skill being created; the agent's questions come back.
/help Lists these commands.

Create a skill from the same thread

Send /skillcreate. It asks what mm skillcreate asks in a terminal — the skill's name, a one-line description, keywords (. for none) and the text — and writes <skillsDir>/<name>/SKILL.md where the project's agent reads its skills: the skillsDir of its agent.yaml or .mm/agent.yaml. Without an agent file, or with skillsDir: no-skills, the skill goes to .mm/skills when the project has a .mm folder — or when the agent being created in this thread uses one —, else to skills, and mm says which skillsDir to set.

  • The flags answer in advance: /skillcreate --name "Vulcan Salute" --description "Greets the Vulcan way" --keywords "vulcan, greeting". Quote a value with spaces.
  • The text is one message: several lines are fine. With a client that shows forms, the other questions come in a form and the text is still asked as a message.
  • An existing skill is replaced only if you answer yes; no asks for another name.
  • In the middle of the agent's questions, the answers given so far are kept: once the skill is written — or given up with /cancel — the agent's current question comes back. Before its file is written, the skill goes where that agent will read its skills: .mm/skills once you answered yes to Keep everything in a .mm folder?, and mm reminds you to answer yes to Use skills?.
  • After writing, mm reads the skill back (✅ mm reads it: …). An agent already running sees it once it restarts (Reload Agent).

Variations

  • Fix answers in advance. The flags of mm init work here (--provider, --base-url, --model, --usage, --project yes…): a question whose flag is given is not asked. For example "args": ["acp-create", "--provider", "llmman", "--project", "yes"].
  • The .mm layout. Answer yes to Keep everything in a .mm folder?: the file is .mm/agent.yaml, see Keep a project's mini-me files in a .mm folder.
  • Declining a form writes nothing. Send another message to pick up where you stopped.
  • Reloading the agent (Zed's Reload Agent) restarts the wizard from the first question: the answers are not kept. A file already written stays as it is.

See also

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# How to create an agent from your editor (`mm acp-create`)

This guide shows how to create an agent.yaml without a terminal, from any editor or tool that speaks the Agent Client Protocol (Zed, a JetBrains IDE, a Neovim plugin…). `mm acp-create` serves the questions of [`mm init`](create-an-agent.md) over ACP and writes the same file. It assumes `mm` is installed on your `PATH` and that a model server is running (the wizard lists its models).

## Steps

1. Register `mm acp-create` as an agent server in your client. In Zed, add to `settings.json`:

   ```json
   {
     "agent_servers": {
       "mm-create": {
         "type": "custom",
         "command": "mm",
         "args": ["acp-create"]
       }
     }
   }
   ```

   Other clients take the same two things: the command `mm` and the argument `acp-create`. No configuration file is needed: this mode reads none.

2. Open the project the agent will work in, start a new thread with `mm-create`, and send `/start` (or any message). The wizard starts. The file will be written in the project's directory — the session's working directory — not where the client started `mm`.

3. Answer the questions. How they are asked depends on what your client can show:

   - **A client that shows forms** (it advertises the `elicitation.form` capability): the questions come in a few forms, the defaults already filled in. A question whose choices depend on an earlier answer — the model list on the server you chose — comes in the next form.
   - **Any other client**: each question is a message, with numbered choices. Reply with a number or a value; `.` takes the default.

4. Read the closing message. It shows `✅ wrote agent.yaml` and `✅ mm loads it`, then the command that starts the agent, `mm acp /absolute/path/to/agent.yaml`. Zed gets a ready `agent_servers` entry; for another client, use that command line.

5. To run the agent in a container or a Docker Sandbox rather than on your machine, send `/dockerinit` (writes `Dockerfile` and `compose.yaml`) or `/sbxinit` (writes `sbxenv.yaml`) in the same thread. See [run mini-me in a container](run-in-a-container.md) and [run mini-me in a Docker Sandbox](run-in-a-docker-sandbox.md).

6. Send `/zedconfig`. It shows the `agent_servers` entries for every way the project can now start its agent — on your machine, in its container, in its sandbox — and what to start first for each. Copy the ones you want into your client's settings, and start a thread with one of them: this one is your agent.

## Commands during the wizard

| Command | What it does |
|---------|--------------|
| `/start` | Starts the wizard; once started, asks the current question again. |
| `/preview` | Shows the agent.yaml as it would be written now. |
| `/back` | Takes back the last answer and asks it again. |
| `/write` | Takes the default for every question left and writes the file (replacing an existing file is still asked). |
| `/restart` | Forgets every answer and starts again. |
| `/dockerinit` | Writes a `Dockerfile` and a `compose.yaml` in the project to run the agent in a container — `mm dockerinit` for this project. Takes its flags (`--name`, `--agent`); existing files are kept unless you add `--overwrite`. |
| `/zedconfig` | Shows Zed's `agent_servers` entries for this project's agent, from what the project holds: `mm acp <agent file>` always; with a `compose.yaml`, `docker exec -i <container> mm -acp -config <agent file>`; with a `sbxenv.yaml`, `sbx exec -i <sandbox> mm -acp -config <agent file>` — each with what to start first. |
| `/sbxinit` | Writes a `sbxenv.yaml` in the project to run the agent in a Docker Sandbox — `mm sbxinit` for this project. Takes its flags (`--name`, `--workspace`, `--agent`); an existing `sbxenv.yaml` is kept unless you add `--overwrite`. Works at any time; after the agent is written, the sandbox is named after it. |
| `/skillcreate` | Creates a skill for the project's agent — `mm skillcreate` for this project: see [Create a skill from the same thread](#create-a-skill-from-the-same-thread). |
| `/cancel` | Gives up the skill being created; the agent's questions come back. |
| `/help` | Lists these commands. |

## Create a skill from the same thread

Send `/skillcreate`. It asks what `mm skillcreate` asks in a terminal — the skill's name, a one-line description, keywords (`.` for none) and the text — and writes `<skillsDir>/<name>/SKILL.md` where the project's agent reads its skills: the `skillsDir` of its `agent.yaml` or `.mm/agent.yaml`. Without an agent file, or with `skillsDir: no-skills`, the skill goes to `.mm/skills` when the project has a `.mm` folder — or when the agent being created in this thread uses one —, else to `skills`, and mm says which `skillsDir` to set.

- **The flags answer in advance:** `/skillcreate --name "Vulcan Salute" --description "Greets the Vulcan way" --keywords "vulcan, greeting"`. Quote a value with spaces.
- **The text** is one message: several lines are fine. With a client that shows forms, the other questions come in a form and the text is still asked as a message.
- **An existing skill** is replaced only if you answer `yes`; `no` asks for another name.
- **In the middle of the agent's questions,** the answers given so far are kept: once the skill is written — or given up with `/cancel` — the agent's current question comes back. Before its file is written, the skill goes where that agent will read its skills: `.mm/skills` once you answered `yes` to *Keep everything in a .mm folder?*, and mm reminds you to answer `yes` to *Use skills?*.
- After writing, mm reads the skill back (`✅ mm reads it: …`). An agent already running sees it once it restarts (*Reload Agent*).

## Variations

- **Fix answers in advance.** The flags of `mm init` work here (`--provider`, `--base-url`, `--model`, `--usage`, `--project yes`…): a question whose flag is given is not asked. For example `"args": ["acp-create", "--provider", "llmman", "--project", "yes"]`.
- **The `.mm` layout.** Answer `yes` to *Keep everything in a .mm folder?*: the file is `.mm/agent.yaml`, see [Keep a project's mini-me files in a `.mm` folder](keep-the-config-in-a-mm-folder.md).
- **Declining a form** writes nothing. Send another message to pick up where you stopped.
- **Reloading the agent** (Zed's *Reload Agent*) restarts the wizard from the first question: the answers are not kept. A file already written stays as it is.

## See also

- [Create an agent with `mm init`](create-an-agent.md) — the same wizard in a terminal.
- [Use mini-me from an editor (ACP)](use-from-an-editor.md) — running the agent you created.
- [Reference: command line — `mm acp-create`](../reference/cli.md#mm-acp-create--the-agentyaml-wizard-over-acp)