feat: rename to ddev-claude-cli, drop Codex CLI, add opt-in headless browser
This commit is contained in:
1 parent
b6d88ce4dc
commit
d8076fa5a0
8 files changed
+322
-64
No files matched your search
Executable
+55
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env bash
|
||||
#ddev-generated
|
||||
## Description: Turn the headless browser (Playwright MCP) for Claude Code on or off
|
||||
## Usage: claude-browser [enable|disable|status]
|
||||
## Example: "ddev claude-browser enable"
|
||||
set -euo pipefail
|
||||
|
||||
TEMPLATE="${DDEV_APPROOT}/.ddev/claude-code/browser/docker-compose.claude-browser.yaml"
|
||||
TARGET="${DDEV_APPROOT}/.ddev/docker-compose.claude-browser.yaml"
|
||||
CONTAINER="ddev-${DDEV_SITENAME}-claude-browser"
|
||||
|
||||
case "${1:-status}" in
|
||||
enable|on)
|
||||
if [ ! -f "${TEMPLATE}" ]; then
|
||||
echo "Missing ${TEMPLATE}; reinstall the add-on with 'ddev add-on get'." >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ -f "${TARGET}" ]; then
|
||||
echo "The headless browser is already enabled (.ddev/docker-compose.claude-browser.yaml)."
|
||||
exit 0
|
||||
fi
|
||||
cp "${TEMPLATE}" "${TARGET}"
|
||||
echo "Enabled the headless browser; restarting so the claude-browser service starts ..."
|
||||
ddev restart
|
||||
;;
|
||||
disable|off)
|
||||
if [ ! -f "${TARGET}" ]; then
|
||||
echo "The headless browser is not enabled."
|
||||
exit 0
|
||||
fi
|
||||
if ! grep -q '#ddev-generated' "${TARGET}"; then
|
||||
echo "${TARGET} has been customised (no #ddev-generated line); delete it yourself and run 'ddev restart'." >&2
|
||||
exit 1
|
||||
fi
|
||||
rm -f "${TARGET}"
|
||||
echo "Disabled the headless browser; restarting so the claude-browser service stops ..."
|
||||
ddev restart
|
||||
;;
|
||||
status)
|
||||
if [ -f "${TARGET}" ]; then
|
||||
state="enabled"
|
||||
else
|
||||
state="disabled"
|
||||
fi
|
||||
running="unknown"
|
||||
if command -v docker >/dev/null 2>&1; then
|
||||
running="$(docker inspect -f '{{.State.Status}}' "${CONTAINER}" 2>/dev/null || echo "not running")"
|
||||
fi
|
||||
echo "Headless browser: ${state} (container ${CONTAINER}: ${running})"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: ddev claude-browser [enable|disable|status]" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
Reference in new issue
Block a user