-
Notifications
You must be signed in to change notification settings - Fork 26
Add Claude Code remote environment setup automation #3421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
eb47ad8
3f92b0d
3167c4c
f57cea2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "hooks": { | ||
| "SessionStart": [ | ||
| { | ||
| "matcher": "", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "\"$CLAUDE_PROJECT_DIR\"/scripts/claude-remote-setup.sh" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -77,4 +77,19 @@ Multi-language monorepo (Rust CLI + TypeScript/Python libraries) using PNPM work | |||||||
|
|
||||||||
| ## Key Technologies | ||||||||
|
|
||||||||
| Rust (CLI), TypeScript (libs/web), Python (lib), ClickHouse (OLAP), Redpanda/Kafka (streaming), Temporal (workflows), Redis (state) | ||||||||
| Rust (CLI), TypeScript (libs/web), Python (lib), ClickHouse (OLAP), Redpanda/Kafka (streaming), Temporal (workflows), Redis (state) | ||||||||
|
|
||||||||
| ## Claude Code Remote Environment | ||||||||
|
|
||||||||
| When running in Claude Code remote (web) environments, system dependencies are automatically installed via the SessionStart hook in `.claude/settings.json`. The setup script (`scripts/claude-remote-setup.sh`) installs: | ||||||||
|
|
||||||||
| - **Docker & Docker Compose**: Required for E2E tests (ClickHouse, Kafka, Temporal containers) | ||||||||
| - **protobuf-compiler**: Required for Rust build (prost/tonic protobuf compilation) | ||||||||
| - **librdkafka-dev**: Required for `@514labs/kafka-javascript` native module | ||||||||
| - **libcurl4-openssl-dev, libsasl2-dev**: Additional Kafka dependencies | ||||||||
| - **Python 3.12+**: Required for `moose-cli` pip package in Python E2E tests | ||||||||
|
|
||||||||
| **Limitations in Claude Code Remote:** | ||||||||
| - **Docker may not be available**: Docker requires privileged container access which may not be supported in all environments | ||||||||
| - Run unit tests (`cargo test`, `pnpm test` in ts-moose-lib) and linting in remote environments | ||||||||
| - Run full E2E tests (`cd apps/framework-cli-e2e && pnpm test`) in environments with Docker support | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add trailing newline at EOF Markdownlint MD047 expects a single trailing newline after Line 95. Proposed fix- - Run full E2E tests (`cd apps/framework-cli-e2e && pnpm test`) in environments with Docker support
+ - Run full E2E tests (`cd apps/framework-cli-e2e && pnpm test`) in environments with Docker support
+📝 Committable suggestion
Suggested change
🧰 Tools🪛 markdownlint-cli2 (0.20.0)[warning] 95-95: Files should end with a single newline character (MD047, single-trailing-newline) 🤖 Prompt for AI Agents |
||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,141 @@ | ||||||||||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||||||||||
| # Claude Code Remote Environment Setup Script | ||||||||||||||||||||||||||||||
| # This script installs dependencies required for building and developing MooseStack | ||||||||||||||||||||||||||||||
| # in Claude Code remote (web) environments. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| set -e | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # ============================================================================= | ||||||||||||||||||||||||||||||
| # VERSION CONSTANTS | ||||||||||||||||||||||||||||||
| # Update these versions as needed when upgrading dependencies | ||||||||||||||||||||||||||||||
| # ============================================================================= | ||||||||||||||||||||||||||||||
| PYTHON_VERSION_REQUIRED="3.12" | ||||||||||||||||||||||||||||||
| DOCKER_VERSION="5:27.5.1-1~ubuntu.24.04~noble" | ||||||||||||||||||||||||||||||
| DOCKER_COMPOSE_VERSION="2.32.4-1~ubuntu.24.04~noble" | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # ============================================================================= | ||||||||||||||||||||||||||||||
| # ENVIRONMENT CHECK | ||||||||||||||||||||||||||||||
| # ============================================================================= | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Only run in remote environments | ||||||||||||||||||||||||||||||
| if [ "$CLAUDE_CODE_REMOTE" != "true" ]; then | ||||||||||||||||||||||||||||||
| echo "Not running in Claude Code remote environment, skipping setup." | ||||||||||||||||||||||||||||||
| exit 0 | ||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| echo "==========================================" | ||||||||||||||||||||||||||||||
| echo "MooseStack Claude Code Environment Setup" | ||||||||||||||||||||||||||||||
| echo "==========================================" | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Check if we have apt-get available | ||||||||||||||||||||||||||||||
| if ! command -v apt-get &> /dev/null; then | ||||||||||||||||||||||||||||||
| echo "apt-get not found, skipping system package installation" | ||||||||||||||||||||||||||||||
| exit 0 | ||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||
|
Comment on lines
+35
to
+39
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guard against non-root execution before apt-get With Proposed fix if ! command -v apt-get &> /dev/null; then
echo "apt-get not found, skipping system package installation"
exit 0
fi
+if [ "$(id -u)" -ne 0 ]; then
+ echo "Insufficient privileges to install packages; skipping setup."
+ exit 0
+fi📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||
| echo "Installing system dependencies..." | ||||||||||||||||||||||||||||||
| echo "------------------------------------------" | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # ============================================================================= | ||||||||||||||||||||||||||||||
| # DOCKER INSTALLATION | ||||||||||||||||||||||||||||||
| # ============================================================================= | ||||||||||||||||||||||||||||||
| echo "Installing Docker..." | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Install Docker prerequisites | ||||||||||||||||||||||||||||||
| apt-get update -qq | ||||||||||||||||||||||||||||||
| apt-get install -y -qq \ | ||||||||||||||||||||||||||||||
| ca-certificates \ | ||||||||||||||||||||||||||||||
| curl \ | ||||||||||||||||||||||||||||||
| gnupg \ | ||||||||||||||||||||||||||||||
| lsb-release | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Add Docker's official GPG key | ||||||||||||||||||||||||||||||
| install -m 0755 -d /etc/apt/keyrings | ||||||||||||||||||||||||||||||
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc | ||||||||||||||||||||||||||||||
| chmod a+r /etc/apt/keyrings/docker.asc | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Add Docker repository | ||||||||||||||||||||||||||||||
| echo \ | ||||||||||||||||||||||||||||||
| "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ | ||||||||||||||||||||||||||||||
| $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \ | ||||||||||||||||||||||||||||||
| tee /etc/apt/sources.list.d/docker.list > /dev/null | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| apt-get update -qq | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Install Docker packages | ||||||||||||||||||||||||||||||
| apt-get install -y -qq \ | ||||||||||||||||||||||||||||||
| docker-ce="$DOCKER_VERSION" \ | ||||||||||||||||||||||||||||||
| docker-ce-cli="$DOCKER_VERSION" \ | ||||||||||||||||||||||||||||||
| containerd.io \ | ||||||||||||||||||||||||||||||
| docker-buildx-plugin \ | ||||||||||||||||||||||||||||||
| docker-compose-plugin="$DOCKER_COMPOSE_VERSION" || { | ||||||||||||||||||||||||||||||
| echo "Warning: Could not install specific Docker versions, trying latest..." | ||||||||||||||||||||||||||||||
| apt-get install -y -qq \ | ||||||||||||||||||||||||||||||
| docker-ce \ | ||||||||||||||||||||||||||||||
| docker-ce-cli \ | ||||||||||||||||||||||||||||||
| containerd.io \ | ||||||||||||||||||||||||||||||
| docker-buildx-plugin \ | ||||||||||||||||||||||||||||||
| docker-compose-plugin || echo "Warning: Docker installation failed (may not be supported in this environment)" | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Start Docker daemon if possible | ||||||||||||||||||||||||||||||
| service docker start 2>/dev/null || echo "Warning: Could not start Docker daemon (may require privileged container)" | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # ============================================================================= | ||||||||||||||||||||||||||||||
| # PROTOBUF COMPILER | ||||||||||||||||||||||||||||||
| # ============================================================================= | ||||||||||||||||||||||||||||||
| echo "Installing protobuf-compiler..." | ||||||||||||||||||||||||||||||
| apt-get install -y -qq protobuf-compiler | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # ============================================================================= | ||||||||||||||||||||||||||||||
| # KAFKA/LIBRDKAFKA DEPENDENCIES | ||||||||||||||||||||||||||||||
| # ============================================================================= | ||||||||||||||||||||||||||||||
| echo "Installing Kafka native library dependencies..." | ||||||||||||||||||||||||||||||
| apt-get install -y -qq \ | ||||||||||||||||||||||||||||||
| librdkafka-dev \ | ||||||||||||||||||||||||||||||
| libcurl4-openssl-dev \ | ||||||||||||||||||||||||||||||
| libsasl2-dev | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # ============================================================================= | ||||||||||||||||||||||||||||||
| # PYTHON 3.12+ | ||||||||||||||||||||||||||||||
| # ============================================================================= | ||||||||||||||||||||||||||||||
| CURRENT_PYTHON_VERSION=$(python3 --version 2>/dev/null | grep -oP '\d+\.\d+' | head -1) | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| if [ "$(printf '%s\n' "$PYTHON_VERSION_REQUIRED" "$CURRENT_PYTHON_VERSION" | sort -V | head -n1)" != "$PYTHON_VERSION_REQUIRED" ]; then | ||||||||||||||||||||||||||||||
| echo "Installing Python $PYTHON_VERSION_REQUIRED..." | ||||||||||||||||||||||||||||||
| apt-get install -y -qq software-properties-common | ||||||||||||||||||||||||||||||
| add-apt-repository -y ppa:deadsnakes/ppa | ||||||||||||||||||||||||||||||
| apt-get update -qq | ||||||||||||||||||||||||||||||
| apt-get install -y -qq \ | ||||||||||||||||||||||||||||||
| python${PYTHON_VERSION_REQUIRED} \ | ||||||||||||||||||||||||||||||
| python${PYTHON_VERSION_REQUIRED}-venv \ | ||||||||||||||||||||||||||||||
| python${PYTHON_VERSION_REQUIRED}-dev | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Set up alternatives to use Python 3.12 by default | ||||||||||||||||||||||||||||||
| update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION_REQUIRED} 1 2>/dev/null || true | ||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # ============================================================================= | ||||||||||||||||||||||||||||||
| # SUMMARY | ||||||||||||||||||||||||||||||
| # ============================================================================= | ||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||
| echo "==========================================" | ||||||||||||||||||||||||||||||
| echo "System dependencies installed successfully" | ||||||||||||||||||||||||||||||
| echo "==========================================" | ||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||
| echo "Installed packages:" | ||||||||||||||||||||||||||||||
| echo " - Docker: $(docker --version 2>/dev/null || echo 'not available')" | ||||||||||||||||||||||||||||||
| echo " - Docker Compose: $(docker compose version 2>/dev/null || echo 'not available')" | ||||||||||||||||||||||||||||||
| echo " - protobuf-compiler (protoc): $(protoc --version 2>/dev/null || echo 'installed')" | ||||||||||||||||||||||||||||||
| echo " - librdkafka-dev" | ||||||||||||||||||||||||||||||
| echo " - libcurl4-openssl-dev" | ||||||||||||||||||||||||||||||
| echo " - libsasl2-dev" | ||||||||||||||||||||||||||||||
| echo " - Python: $(python3 --version 2>/dev/null || echo 'not verified')" | ||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||
| echo "To install Node.js dependencies: pnpm install" | ||||||||||||||||||||||||||||||
| echo "To build Rust CLI: cargo build" | ||||||||||||||||||||||||||||||
| echo "To run E2E tests: cd apps/framework-cli-e2e && pnpm test" | ||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| exit 0 | ||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add agent architecture/design patterns section
This update doesn’t document agent architecture/design patterns as required; please add a short section or link to the authoritative doc.
As per coding guidelines: Document agent architecture and design patterns in AGENTS.md.
🧰 Tools
🪛 markdownlint-cli2 (0.20.0)
[warning] 95-95: Files should end with a single newline character
(MD047, single-trailing-newline)
🤖 Prompt for AI Agents