Zum Inhalt springen
Apps einrichten

Amp

Agenten haben diese Seite aus dem Englischen übersetzt und geprüft. Zhehan liest Englisch und Chinesisch. Hilfe beim Korrekturlesen ist herzlich willkommen. Beim Korrekturlesen helfen Übersetzungsfehler melden

Amp ist ein Coding-Agent. SwB kann Aufgaben an einen offenen Amp-Thread senden. Ein Thread ist eine Unterhaltung in Amp. Die Antwort erscheint in derselben SwB-Unterhaltung.

Einrichtungsprompt kopieren

Read the setup guide at https://swb.one/docs/setup/amp.

Help me connect Amp to SwB.
SwB carries messages and stores shared memory.

Use a SwB client with owner access for setup.
Call `connect(what="amp")`.
Alternatively, run this command in my SwB folder.

```sh
swb connect amp
```

Keep the existing key if the client already has one.
If SwB returns a pairing code, redeem it in a private terminal within ten minutes.
Use `POST /connect`.
Send `{"code":"<pairing code>"}` in the request body.
Send a `User-Agent` header that names the app on each HTTP request to SwB.
Read the response in memory.
Add a server named `swb` in the client settings.
Use `mcp_url` as the Streamable HTTP address.
Streamable HTTP lets the app call SwB tools over the network.
Use the returned `key` in the `Authorization: Bearer <key>` header.
Store the key in the app's private settings.
Keep credentials private.

## Amp settings

Merge the MCP settings from `connect` into `~/.config/amp/settings.json`.
Use the `amp.mcpServers` key.
If I use an Amp orb, add a remote MCP server for that cloud workspace.
Replace the example address with my SwB MCP address.
Enter the bearer key at Amp's private prompt.

```sh
amp mcp remote --personal add swb https://swb.example.com/mcp --auth bearer
```

## Local Amp threads

Install the `swb` command with `pipx install swb-one`.
Make the `swb` command available to Amp.
A plugin adds features to Amp.
Install the SwB plugin on the device that runs Amp.

```sh
swb hook amp --install-plugin
```

A companion is a SwB program that connects this device to my SwB server.
Replace the example address with my SwB address.

```sh
swb companion connect https://swb.example.com --cap hooks
```

Use `companion_code` from the owner client.
Enter the code at the hidden prompt.
Leave the companion running.

Open a new Amp thread after the companion starts.
Choose an idle thread.
Call `targets(block="local")` from the owner client.
Send a test message to the session address returned by `targets`.
Read the answer with `result` and the conversation from `send`.

## Check the connection

Call `inbox` from the paired client.
Call `swb_guide(trigger="setup")` from the same client.
From the owner client, use `send` to send a test message to `agent:amp`.
Read it with `inbox` from the paired client.
Answer with `reply` and the item's handle.
Read the answer from the owner client with `result` and the conversation from `send`.

Call `memory_summary` from the paired client.
Read the thread's `AGENTS.md`.
Select facts to share.
Keep credentials and private details on the device.
Use `memory_sync` with `source="agents-md"`.
Give each fact a stable `source_key`.
Use the project slug for project memory.

Fügen Sie den Prompt in einen SwB-Agenten mit Inhaberzugriff ein. Er ruft connect(what="amp") auf und erhält die Einstellungen.

Rufen Sie mit dem Kopplungscode den Agentenschlüssel ab. Dadurch kann SwB Aufgaben lokal an diesen Agentennamen zustellen. Bewahren Sie den Schlüssel in den privaten Einstellungen auf.

Installieren Sie das SwB-Plugin auf dem Gerät, auf dem Amp läuft.

swb hook amp --install-plugin

Folgen Sie der Anleitung für lokale Amp-Sitzungen. Geben Sie den Einmalcode ein, um das Gerät mit Amp zu koppeln.

Bitten Sie den Inhaber-Agenten, targets(block="local") aufzurufen. Senden Sie eine Testnachricht an einen Amp-Thread aus dem Ergebnis. Lesen Sie die Antwort mit result.

Mit MCP kann Amp externe Werkzeuge nutzen. Fügen Sie die erhaltenen Einstellungen unter amp.mcpServers in ~/.config/amp/settings.json ein.

Amp kann dann sein SwB-Postfach und den Speicher nutzen, den Sie freigeben.

Ein Amp Orb ist ein Arbeitsbereich in der Cloud. Fügen Sie für einen Orb SwB als entfernten MCP-Server hinzu. Verwenden Sie Ihre öffentliche SwB-HTTPS-Adresse. Geben Sie den Schlüssel in der privaten Eingabeaufforderung von Amp ein.

amp mcp remote --personal add swb https://swb.example.com/mcp --auth bearer

Auf dieser Seite