|
|
@@ -170,20 +170,51 @@ The client is called directly from `commands.json` for issue and issue_comment e
|
|
|
|
|
|
### Environment Variables
|
|
|
|
|
|
-The client reads configuration from the repository's `.env` file:
|
|
|
+The client loads environment variables from **two locations** (in priority order):
|
|
|
|
|
|
-```env
|
|
|
-# Required: Path to gogs-mcp server
|
|
|
-GOGS_MCP_PATH=/data/gogs-mcp/dist/index.js
|
|
|
+1. **Global configuration**: `~/.config/agent-manager/.env` (shared across all repositories)
|
|
|
+2. **Repository-specific configuration**: `.env` in repository root (overrides global)
|
|
|
+
|
|
|
+This allows you to set common values (like `GOGS_ACCESS_TOKEN`) once in the global file, eliminating the need to duplicate them in every cloned repository.
|
|
|
+
|
|
|
+#### Global Configuration (`~/.config/agent-manager/.env`)
|
|
|
+
|
|
|
+Create this file to set global defaults for all repositories:
|
|
|
|
|
|
-# Required: Gogs API authentication
|
|
|
+```env
|
|
|
+# Required: Gogs API authentication (applies to all repositories)
|
|
|
GOGS_ACCESS_TOKEN=your-token-here
|
|
|
GOGS_BASE_URL=https://git.smartbotics.ai
|
|
|
|
|
|
-# Optional: Home directory override
|
|
|
-HOME=/home/claude
|
|
|
+# Optional: Path to gogs-mcp server
|
|
|
+GOGS_MCP_PATH=/data/gogs-mcp/dist/index.js
|
|
|
```
|
|
|
|
|
|
+**Setup**:
|
|
|
+```bash
|
|
|
+mkdir -p ~/.config/agent-manager
|
|
|
+cp /path/to/agent-manager/examples/global-env.example ~/.config/agent-manager/.env
|
|
|
+chmod 600 ~/.config/agent-manager/.env
|
|
|
+# Edit the file and add your values
|
|
|
+```
|
|
|
+
|
|
|
+#### Repository-Specific Configuration (`.env` in repository)
|
|
|
+
|
|
|
+Optional. Use this to override global values for specific repositories:
|
|
|
+
|
|
|
+```env
|
|
|
+# Example: Use a different Gogs token for this specific repository
|
|
|
+GOGS_ACCESS_TOKEN=repo-specific-token
|
|
|
+
|
|
|
+# Example: Custom home directory for this repository
|
|
|
+HOME=/custom/home/path
|
|
|
+```
|
|
|
+
|
|
|
+**Notes**:
|
|
|
+- Repository-specific values **override** global values
|
|
|
+- If a repository doesn't have a `.env` file, it uses only global values
|
|
|
+- You no longer need to manually create `.env` files in every cloned repository
|
|
|
+
|
|
|
### Webhook Variables
|
|
|
|
|
|
When called from `commands.json`, the client receives these variables from webhooks:
|