Skip to content

Releases

v1.2.0

Choose a tag to compare

@aangelinsf aangelinsf released this 15 Nov 17:29
675105b

Runs every CLI tool in its own empty, private working directory.

What's new

  • Each POST /execute request 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 /health reports isolated_cwd in features (["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 restart

The Drupal ai_provider_cli module's status report warns when the relay is older than this version.

v1.1.0

Choose a tag to compare

@aangelinsf aangelinsf released this 14 Nov 17:09
1d1b2fe

Adds file attachments.

What's new

  • POST /execute accepts an optional files field: 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}} in args and prompt with 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 /health now also reports version, features (["files"]) and binaries (the allowlisted tools found on PATH). 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 restart

The Drupal ai_provider_cli module needs this version to pass attachments in DDEV.

v1.0.0

Choose a tag to compare

@aangelinsf aangelinsf released this 14 Nov 15:56
a842943

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.1 on macOS, or on the local address containers use to reach the host elsewhere. Never 0.0.0.0 by default.
  • Every request needs Authorization: Bearer <token>. Each project gets a random token at .ddev/cli-relay/token (mode 600, git-ignored), created on ddev start.
  • Requests from browsers (an Origin header, or a non-JSON content type) are refused.
  • Only allowlisted tools run, resolved once at startup. Extend the list with AI_RELAY_ALLOWED_BINARIES or .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 python3 on the host PATH. 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 restart

Clients must send the token: use ai_provider_cli 1.0.0-alpha1 or newer.