| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 2 | 9 | 11 | 9% |
| Commands | 3 | 2 | 3 | 38% |
| Section tags | 5 | 0 | 0 | 100% |
What each file covers
Sections
2 shared · 9 only in A · 11 only in B- − Agent-PC — Cline Rules
- − Architecture Rules
- − File Locations
- − Key Constraints
- − When Adding Features
- − When Modifying Docker
- − Testing
- − Local testing (no Docker)
- − Test endpoints
- + Agent-PC — Cursor Rules
- + Architecture (CRITICAL)
- + Python
- + Files You'll Edit Most
- + What NOT to Do
- + Adding a New Tool
- + Environment Variables
- + Commands
- + Dev (no Docker)
- + Docker
- + Test
- Project Identity
- Code Conventions
Commands
3 shared · 2 only in A · 3 only in B- − pip install -r requirements.txt && python main.py
- − docker compose up -d --build
- + docker compose up -d
- + docker compose --profile ollama up -d
- + docker compose logs -f agent-pc
- docker-compose.yml
- docker/agent-pc/Dockerfile
- docker compose build agent-pc && docker compose up -d
Section tags
5 shared · 0 only in A · 0 only in B- setup
- test
- code-style
- do-not
- agent-behaviour
Line diff
electricpants01/agent-pc · .clinerules/project.md
@@ −1 @@
1# Agent-PC — Cline Rules
2
3## Project Identity
4
5- **Name:** Agent-PC
6- **Type:** AI-powered remote Linux control system
7- **Language:** Python 3.11 (server), Docker Compose (orchestration)
8- **Framework:** FastAPI (tool engine), Open WebUI (LLM brain)
9
10## Architecture Rules
11
121. Agent-PC server is a **TOOL EXECUTION ENGINE ONLY** — no LLM client, no chat endpoints
132. Open WebUI handles ALL LLM logic (chat, streaming, multi-model, tool calling)
143. Communication: Open WebUI → HTTP POST → Agent-PC `/tool` endpoint
154. Authentication between services: `AUTH_SECRET` shared secret via query param
165. SSH from container to host for command execution (with local fallback)
17
18## Code Conventions
19
20- **All code and comments:** English
21- **PEP 8** with 4-space indentation
22- Type hints where they add clarity
23- Tool functions return `{"ok": bool, ...}` dict
24- Errors return `{"ok": false, "error": "message"}`
25
26## File Locations
27
28- `server/main.py` — FastAPI app (3 endpoints: health, tools, tool)
29- `server/tools.py` — Tool definitions + implementations
30- `server/config.py` — Environment variable configuration
31- `docker-compose.yml` — Service orchestration
32- `docker/agent-pc/Dockerfile` — Container image
33- `open-webui/tools/` — Open WebUI function definitions
34- `AI/` — Project documentation for AI agents
35- `ios/` — Legacy SwiftUI app (not actively maintained)
36
37## Key Constraints
38
39- **NO** `openai` library in server — removed in v2.0
40- **NO** WebSocket or chat endpoints in Agent-PC server
41- **NO** hardcoded API keys — use env vars or Open WebUI admin panel
42- **NO** direct `subprocess` from container to host without SSH as option
43- Docker volumes MUST use named volumes (not bind mounts for data)
44
45## When Adding Features
46
471. New tools: add to `TOOL_DEFINITIONS` + `TOOL_MAP` in `tools.py`
482. Update `open-webui/tools/agent-pc-tools.json`
493. Rebuild: `docker compose build agent-pc && docker compose up -d`
504. Re-import tools in Open WebUI admin panel
51
52## When Modifying Docker
53
541. Update `docker-compose.yml` for service changes
552. Update `docker/agent-pc/Dockerfile` for dependencies
563. Update `.env.docker` for new variables
574. Test: `docker compose up -d --build`
585. Verify health: `curl http://localhost:8765/health`
59
60## Testing
61
62```bash
63# Local testing (no Docker)
64cd server && python -m venv venv && source venv/bin/activate
65pip install -r requirements.txt && python main.py
66
67# Test endpoints
68curl http://localhost:8765/health
69curl "http://localhost:8765/tools?secret=agent-pc-local-secret-change-me"
70curl -X POST "http://localhost:8765/tool?secret=agent-pc-local-secret-change-me" \
71 -H "Content-Type: application/json" \
72 -d '{"name":"execute_command","args":{"command":"echo test"}}'
73```
74
electricpants01/agent-pc · .cursor/rules/project.mdc
@@ +1 @@
1---
2description: Agent-PC project rules and conventions
3globs: **/*.py,**/*.yml,**/*.yaml,**/*.md,**/*.sh,**/*.json,**/Dockerfile
4version: 1.0.0
5alwaysApply: true
6---
7
8# Agent-PC — Cursor Rules
9
10## Project Identity
11
12Agent-PC is an AI-powered remote Linux control system. Users control their Linux machine from any device (iPhone PWA, browser) via natural language. The system uses Open WebUI as the multi-model LLM brain and a Python FastAPI server as the tool execution engine, all orchestrated with Docker Compose behind a Tailscale VPN.
13
14## Architecture (CRITICAL)
15
16```
17User Device (PWA) → Tailscale VPN → Open WebUI (port 3000) → Agent-PC (port 8765) → SSH → Host Machine
18```
19
201. **Agent-PC server is a TOOL EXECUTION ENGINE ONLY** — no LLM, no chat, no WebSocket
212. **Open WebUI handles ALL LLM logic** — multi-model, streaming, tool calling, admin panel
223. Communication between services is HTTP (REST)
234. Auth between Open WebUI and Agent-PC uses `AUTH_SECRET` query parameter
24
25## Code Conventions
26
27### Python
28- **Language:** English for all code, comments, and docstrings
29- **Style:** PEP 8, 4 spaces, snake_case, PascalCase for classes
30- **Type hints:** Use where they improve clarity
31- **Tool return format:** `{"ok": bool, "error"?: str, ...}`
32
33### Files You'll Edit Most
34- `server/main.py` — FastAPI app (3 endpoints only: GET /health, GET /tools, POST /tool)
35- `server/tools.py` — Tool definitions (TOOL_DEFINITIONS + TOOL_MAP + implementations)
36- `server/config.py` — Environment configuration (SSH_HOST, AUTH_SECRET, etc.)
37- `docker-compose.yml` — Service orchestration
38- `docker/agent-pc/Dockerfile` — Container image definition
39
40### What NOT to Do
41- ❌ Do NOT add chat/streaming/WebSocket endpoints to Agent-PC server
42- ❌ Do NOT add LLM client libraries (openai, anthropic, etc.) to server
43- ❌ Do NOT hardcode API keys — use env vars or Open WebUI admin panel
44- ❌ Do NOT bypass the tool format — always return `{"ok": bool, ...}`
45- ❌ Do NOT modify `ios/` Swift code (legacy, not maintained)
46- ❌ Do NOT use `server/agent.py` (legacy LLM client, no longer imported)
47
48## Adding a New Tool
49
501. Add definition to `TOOL_DEFINITIONS` in `server/tools.py`
512. Implement `tool_<name>()` function
523. Register in `TOOL_MAP` dict
534. Add to `open-webui/tools/agent-pc-tools.json`
545. Rebuild Docker: `docker compose build agent-pc && docker compose up -d`
55
56## Environment Variables
57
58Key env vars (set in `.env` for Docker Compose):
59- `AUTH_SECRET` — Shared secret between Open WebUI and Agent-PC
60- `SSH_HOST` — Host for SSH (default: `host.docker.internal`)
61- `SSH_USER` — SSH username
62- `WORKSPACE_ROOT` — Root directory agent can access
63- `OPENWEBUI_PORT` — External port for Open WebUI (default: 3000)
64- `AGENTPC_PORT` — External port for Agent-PC (default: 8765)
65
66## Commands
67
68```bash
69# Dev (no Docker)
70cd server && pip install -r requirements.txt && python main.py
71
72# Docker
73docker compose up -d # Base services
74docker compose --profile ollama up -d # With local LLMs
75docker compose logs -f agent-pc # Agent-PC logs
76docker compose build agent-pc && docker compose up -d # Rebuild
77
78# Test
79curl http://localhost:8765/health
80curl "http://localhost:8765/tools?secret=agent-pc-local-secret-change-me"
81```
82
@@ −1 +1 @@
1−# Agent-PC — Cline Rules
1+---
2+description: Agent-PC project rules and conventions
3+globs: **/*.py,**/*.yml,**/*.yaml,**/*.md,**/*.sh,**/*.json,**/Dockerfile
4+version: 1.0.0
5+alwaysApply: true
6+---
27
8+# Agent-PC — Cursor Rules
9+
310 ## Project Identity
411
5−- **Name:** Agent-PC
6−- **Type:** AI-powered remote Linux control system
7−- **Language:** Python 3.11 (server), Docker Compose (orchestration)
8−- **Framework:** FastAPI (tool engine), Open WebUI (LLM brain)
12+Agent-PC is an AI-powered remote Linux control system. Users control their Linux machine from any device (iPhone PWA, browser) via natural language. The system uses Open WebUI as the multi-model LLM brain and a Python FastAPI server as the tool execution engine, all orchestrated with Docker Compose behind a Tailscale VPN.
913
10−## Architecture Rules
14+## Architecture (CRITICAL)
1115
12−1. Agent-PC server is a **TOOL EXECUTION ENGINE ONLY** — no LLM client, no chat endpoints
13−2. Open WebUI handles ALL LLM logic (chat, streaming, multi-model, tool calling)
14−3. Communication: Open WebUI → HTTP POST → Agent-PC `/tool` endpoint
15−4. Authentication between services: `AUTH_SECRET` shared secret via query param
16−5. SSH from container to host for command execution (with local fallback)
16+```
17+User Device (PWA) → Tailscale VPN → Open WebUI (port 3000) → Agent-PC (port 8765) → SSH → Host Machine
18+```
1719
20+1. **Agent-PC server is a TOOL EXECUTION ENGINE ONLY** — no LLM, no chat, no WebSocket
21+2. **Open WebUI handles ALL LLM logic** — multi-model, streaming, tool calling, admin panel
22+3. Communication between services is HTTP (REST)
23+4. Auth between Open WebUI and Agent-PC uses `AUTH_SECRET` query parameter
24+
1825 ## Code Conventions
1926
20−- **All code and comments:** English
21−- **PEP 8** with 4-space indentation
22−- Type hints where they add clarity
23−- Tool functions return `{"ok": bool, ...}` dict
24−- Errors return `{"ok": false, "error": "message"}`
27+### Python
28+- **Language:** English for all code, comments, and docstrings
29+- **Style:** PEP 8, 4 spaces, snake_case, PascalCase for classes
30+- **Type hints:** Use where they improve clarity
31+- **Tool return format:** `{"ok": bool, "error"?: str, ...}`
2532
26−## File Locations
27−
28−- `server/main.py` — FastAPI app (3 endpoints: health, tools, tool)
29−- `server/tools.py` — Tool definitions + implementations
30−- `server/config.py` — Environment variable configuration
33+### Files You'll Edit Most
34+- `server/main.py` — FastAPI app (3 endpoints only: GET /health, GET /tools, POST /tool)
35+- `server/tools.py` — Tool definitions (TOOL_DEFINITIONS + TOOL_MAP + implementations)
36+- `server/config.py` — Environment configuration (SSH_HOST, AUTH_SECRET, etc.)
3137 - `docker-compose.yml` — Service orchestration
32−- `docker/agent-pc/Dockerfile` — Container image
33−- `open-webui/tools/` — Open WebUI function definitions
34−- `AI/` — Project documentation for AI agents
35−- `ios/` — Legacy SwiftUI app (not actively maintained)
38+- `docker/agent-pc/Dockerfile` — Container image definition
3639
37−## Key Constraints
40+### What NOT to Do
41+- ❌ Do NOT add chat/streaming/WebSocket endpoints to Agent-PC server
42+- ❌ Do NOT add LLM client libraries (openai, anthropic, etc.) to server
43+- ❌ Do NOT hardcode API keys — use env vars or Open WebUI admin panel
44+- ❌ Do NOT bypass the tool format — always return `{"ok": bool, ...}`
45+- ❌ Do NOT modify `ios/` Swift code (legacy, not maintained)
46+- ❌ Do NOT use `server/agent.py` (legacy LLM client, no longer imported)
3847
39−- **NO** `openai` library in server — removed in v2.0
40−- **NO** WebSocket or chat endpoints in Agent-PC server
41−- **NO** hardcoded API keys — use env vars or Open WebUI admin panel
42−- **NO** direct `subprocess` from container to host without SSH as option
43−- Docker volumes MUST use named volumes (not bind mounts for data)
48+## Adding a New Tool
4449
45−## When Adding Features
50+1. Add definition to `TOOL_DEFINITIONS` in `server/tools.py`
51+2. Implement `tool_<name>()` function
52+3. Register in `TOOL_MAP` dict
53+4. Add to `open-webui/tools/agent-pc-tools.json`
54+5. Rebuild Docker: `docker compose build agent-pc && docker compose up -d`
4655
47−1. New tools: add to `TOOL_DEFINITIONS` + `TOOL_MAP` in `tools.py`
48−2. Update `open-webui/tools/agent-pc-tools.json`
49−3. Rebuild: `docker compose build agent-pc && docker compose up -d`
50−4. Re-import tools in Open WebUI admin panel
56+## Environment Variables
5157
52−## When Modifying Docker
58+Key env vars (set in `.env` for Docker Compose):
59+- `AUTH_SECRET` — Shared secret between Open WebUI and Agent-PC
60+- `SSH_HOST` — Host for SSH (default: `host.docker.internal`)
61+- `SSH_USER` — SSH username
62+- `WORKSPACE_ROOT` — Root directory agent can access
63+- `OPENWEBUI_PORT` — External port for Open WebUI (default: 3000)
64+- `AGENTPC_PORT` — External port for Agent-PC (default: 8765)
5365
54−1. Update `docker-compose.yml` for service changes
55−2. Update `docker/agent-pc/Dockerfile` for dependencies
56−3. Update `.env.docker` for new variables
57−4. Test: `docker compose up -d --build`
58−5. Verify health: `curl http://localhost:8765/health`
66+## Commands
5967
60−## Testing
61−
6268 ```bash
63−# Local testing (no Docker)
64−cd server && python -m venv venv && source venv/bin/activate
65−pip install -r requirements.txt && python main.py
69+# Dev (no Docker)
70+cd server && pip install -r requirements.txt && python main.py
6671
67−# Test endpoints
72+# Docker
73+docker compose up -d # Base services
74+docker compose --profile ollama up -d # With local LLMs
75+docker compose logs -f agent-pc # Agent-PC logs
76+docker compose build agent-pc && docker compose up -d # Rebuild
77+
78+# Test
6879 curl http://localhost:8765/health
6980 curl "http://localhost:8765/tools?secret=agent-pc-local-secret-change-me"
70−curl -X POST "http://localhost:8765/tool?secret=agent-pc-local-secret-change-me" \
71− -H "Content-Type: application/json" \
72− -d '{"name":"execute_command","args":{"command":"echo test"}}'
7381 ```
7482
