Repository navigation
Releases
Releases · Performant-Labs/ddev-cli-relay
v1.2.0
Runs every CLI tool in its own empty, private working directory.
What's new
- Each
POST /executerequest gets a new temporary directory (mode 700). The tool runs there instead of in your home directory, and the directory is removed when the tool exits, including after a timeout or an error. Before, a tool with file tools (such as Claude Code's Read) started in~and could be prompted into reading your files. - Attachments are written into that same directory, so
{{files_dir}}is now the tool's working directory. GET /healthreportsisolated_cwdinfeatures(["files", "isolated_cwd"]), so clients can check that the relay no longer runs tools in~.- Refused requests (400 and 500) remove the directory before replying.
Requests are otherwise unchanged from v1.1.0.
Upgrade
ddev add-on get Performant-Labs/ddev-cli-relay && ddev restartThe Drupal ai_provider_cli module's status report warns when the relay is older than this version.
v1.1.0
Adds file attachments.
What's new
POST /executeaccepts an optionalfilesfield: up to 20 entries of{"name", "base64"}. The relay writes them to a new private temporary directory (mode 700, files 600), replaces{{file:N}}and{{files_dir}}inargsandpromptwith their host paths, runs the tool, and removes the directory when the tool exits, including after a timeout or an error. File names are reduced to safe characters so they cannot leave the directory.GET /healthnow also reportsversion,features(["files"]) andbinaries(the allowlisted tools found onPATH). Clients can check for file support before sending, and list only installed tools.- The request body limit rises from 1 MiB to 32 MiB, so images and PDFs fit.
- Invalid files return 400; a failure writing them returns 500.
Requests without files behave exactly as in v1.0.0. Closes #3.
Upgrade
ddev add-on get Performant-Labs/ddev-cli-relay && ddev restartThe Drupal ai_provider_cli module needs this version to pass attachments in DDEV.
v1.0.0
First release.
A DDEV add-on that runs a small HTTP relay on the host, so code inside the DDEV web container (for example the Drupal ai_provider_cli module) can run AI CLI tools installed on the host: claude, codex, gemini, opencode, ollama, lms, llm.
Security
- Listens on
127.0.0.1on macOS, or on the local address containers use to reach the host elsewhere. Never0.0.0.0by default. - Every request needs
Authorization: Bearer <token>. Each project gets a random token at.ddev/cli-relay/token(mode 600, git-ignored), created onddev start. - Requests from browsers (an
Originheader, or a non-JSON content type) are refused. - Only allowlisted tools run, resolved once at startup. Extend the list with
AI_RELAY_ALLOWED_BINARIESor.ddev/cli-relay/allowed-binaries.txt. - Treat the token as equivalent to a shell on the host: allowed tools accept arguments that can run commands. See the README's Security section and ADR 0001.
Requirements
- DDEV v1.24.0 or newer.
- Python 3.12 or newer as
python3on the hostPATH. macOS's/usr/bin/python3(3.9) is too old:brew install python. - Tested on macOS (OrbStack). Linux and WSL2 bind detection is untested.
Install
ddev add-on get Performant-Labs/ddev-cli-relay && ddev restartClients must send the token: use ai_provider_cli 1.0.0-alpha1 or newer.