workspace
This commit is contained in:
55
CLAUDE.md
55
CLAUDE.md
@@ -1,39 +1,52 @@
|
||||
# CLAUDE.md
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
Ghid pentru Claude Code în acest workspace.
|
||||
|
||||
## Mediu
|
||||
|
||||
Acesta este un workspace pentru Claude Code pe un LXC container (claude-agent). Proiectele se clonează din Gitea și se lucrează aici.
|
||||
Container LXC **claude-agent** pentru dezvoltare cu Claude Code.
|
||||
|
||||
- **Git remote:** gitea.romfast.ro
|
||||
- **Proiecte:** /workspace/<project>/
|
||||
- **Logs:** /workspace/.claude-logs/
|
||||
| Resursă | Locație |
|
||||
|---------|---------|
|
||||
| Git remote | gitea.romfast.ro |
|
||||
| Proiecte | `/workspace/<project>/` |
|
||||
| Logs | `/workspace/.claude-logs/` |
|
||||
| Work dir (non-interactiv) | `/workspace/.claude-work/` |
|
||||
|
||||
## Reguli pentru Mod Non-Interactiv (claude -p)
|
||||
## Reguli pentru Mod Non-Interactiv
|
||||
|
||||
Când ești lansat cu `claude -p` sau prin `claudep.sh`:
|
||||
Când ești lansat cu `claude -p` sau `claudep.sh`:
|
||||
|
||||
1. **Director de lucru separat** - Creează fișierele în:
|
||||
```
|
||||
/workspace/.claude-work/<timestamp>_<task-name>/
|
||||
```
|
||||
1. **Director separat** - Creează fișierele în `/workspace/.claude-work/<timestamp>_<task>/`
|
||||
2. **NU crea fișiere în /workspace** - Doar în directorul de lucru separat
|
||||
3. **Excepție** - Modificările la fișiere existente se fac în locația originală
|
||||
|
||||
2. **NU crea fișiere direct în /workspace** - Toate fișierele temporare, note, output trebuie să fie în directorul de lucru separat.
|
||||
Structura directorului de lucru:
|
||||
```
|
||||
/workspace/.claude-work/<task>/
|
||||
├── output/ # Rezultate finale
|
||||
├── temp/ # Fișiere temporare
|
||||
└── notes.md # Note și concluzii
|
||||
```
|
||||
|
||||
3. **Structura:**
|
||||
```
|
||||
/workspace/.claude-work/<task>/
|
||||
├── output/ # Rezultate finale
|
||||
├── temp/ # Fișiere temporare
|
||||
└── notes.md # Note și concluzii
|
||||
```
|
||||
## Documentație
|
||||
|
||||
4. **Excepție:** Modificările la fișiere existente din proiecte se fac în locația lor originală.
|
||||
| Subiect | Fișier |
|
||||
|---------|--------|
|
||||
| Playwright MCP | [docs/playwright-mcp.md](docs/playwright-mcp.md) |
|
||||
| ttyd Web Terminal | [docs/ttyd.md](docs/ttyd.md) |
|
||||
|
||||
## Comenzi Git
|
||||
## Quick Reference
|
||||
|
||||
```bash
|
||||
# Git
|
||||
git clone git@gitea.romfast.ro:romfast/<repo>.git
|
||||
git push origin main
|
||||
|
||||
# ttyd
|
||||
sudo systemctl status ttyd
|
||||
sudo systemctl restart ttyd
|
||||
|
||||
# Playwright
|
||||
npx playwright install chromium
|
||||
```
|
||||
|
||||
1
autonomous-coding
Submodule
1
autonomous-coding
Submodule
Submodule autonomous-coding added at 1690a61a22
1
claude-plugins
Submodule
1
claude-plugins
Submodule
Submodule claude-plugins added at 45e28e7e94
54
docs/playwright-mcp.md
Normal file
54
docs/playwright-mcp.md
Normal file
@@ -0,0 +1,54 @@
|
||||
# Playwright MCP în LXC Container
|
||||
|
||||
Plugin-ul Playwright MCP permite automatizarea browser-ului în Claude Code. Necesită configurație specială pentru a rula în container LXC unprivileged.
|
||||
|
||||
## Configurație Claude Code
|
||||
|
||||
Adaugă în `~/.claude/settings.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"playwright": {
|
||||
"command": "npx",
|
||||
"args": ["@playwright/mcp@latest", "--headless", "--no-sandbox", "--browser", "chromium"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Configurație LXC (Proxmox)
|
||||
|
||||
În `/etc/pve/lxc/<CTID>.conf` adaugă:
|
||||
|
||||
```
|
||||
lxc.apparmor.profile: unconfined
|
||||
lxc.cap.drop:
|
||||
lxc.mount.entry: /dev/shm dev/shm none bind,optional,create=dir 0 0
|
||||
```
|
||||
|
||||
**Important:** După modificare, restartează containerul:
|
||||
```bash
|
||||
pct stop <CTID> && pct start <CTID>
|
||||
```
|
||||
|
||||
## Instalare Chromium
|
||||
|
||||
```bash
|
||||
npx playwright install chromium
|
||||
```
|
||||
|
||||
## Verificare
|
||||
|
||||
Pentru a testa că Playwright funcționează:
|
||||
```bash
|
||||
npx playwright open --headless about:blank
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Eroare: "No usable sandbox"
|
||||
Asigură-te că `--no-sandbox` este în args și configurația LXC este aplicată.
|
||||
|
||||
### Eroare: "Browser not found"
|
||||
Rulează `npx playwright install chromium` pentru a instala browser-ul.
|
||||
86
docs/ttyd.md
Normal file
86
docs/ttyd.md
Normal file
@@ -0,0 +1,86 @@
|
||||
# ttyd - Web Terminal
|
||||
|
||||
ttyd permite accesul la terminalul tmux prin browser web.
|
||||
|
||||
## Instalare
|
||||
|
||||
```bash
|
||||
sudo apt install ttyd
|
||||
```
|
||||
|
||||
## Configurație serviciu systemd
|
||||
|
||||
Creează `/etc/systemd/system/ttyd.service`:
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=ttyd - Web Terminal for Claude Agent
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=claude
|
||||
Group=claude
|
||||
WorkingDirectory=/workspace
|
||||
Environment="HOME=/home/claude"
|
||||
Environment="NVM_DIR=/home/claude/.nvm"
|
||||
Environment="PATH=/home/claude/.nvm/versions/node/v22.16.0/bin:/usr/local/bin:/usr/bin:/bin"
|
||||
ExecStart=/usr/bin/ttyd -p 7681 -c claude:claude2025 -W /workspace/start-agent.sh
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
## Activare serviciu
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable --now ttyd
|
||||
```
|
||||
|
||||
## Acces
|
||||
|
||||
- **URL:** `http://<IP>:7681`
|
||||
- **Credențiale:** claude / claude2025
|
||||
|
||||
## Comenzi utile
|
||||
|
||||
```bash
|
||||
# Status serviciu
|
||||
sudo systemctl status ttyd
|
||||
|
||||
# Restart serviciu
|
||||
sudo systemctl restart ttyd
|
||||
|
||||
# Logs în timp real
|
||||
sudo journalctl -u ttyd -f
|
||||
|
||||
# Oprire serviciu
|
||||
sudo systemctl stop ttyd
|
||||
```
|
||||
|
||||
## Opțiuni ttyd
|
||||
|
||||
| Flag | Descriere |
|
||||
|------|-----------|
|
||||
| `-p PORT` | Portul web (default: 7681) |
|
||||
| `-c user:pass` | Autentificare basic |
|
||||
| `-W` | Permite write (client poate tasta) |
|
||||
| `-t fontSize=N` | Dimensiune font |
|
||||
| `-i INTERFACE` | Interfața de ascultare |
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Serviciul nu pornește
|
||||
Verifică logs: `sudo journalctl -u ttyd -e`
|
||||
|
||||
### Eroare autentificare
|
||||
Verifică că user/parola sunt corecte în ExecStart.
|
||||
|
||||
### tmux session nu se creează
|
||||
Verifică că `/workspace/start-agent.sh` este executabil:
|
||||
```bash
|
||||
chmod +x /workspace/start-agent.sh
|
||||
```
|
||||
1
roa2web
Submodule
1
roa2web
Submodule
Submodule roa2web added at 1366dbc11c
@@ -1,17 +1,54 @@
|
||||
#!/bin/bash
|
||||
# Start or attach to Claude agent tmux session
|
||||
#!/usr/bin/env bash
|
||||
# Start or attach to tmux agent session (Claude on-demand)
|
||||
|
||||
SESSION_NAME="agent"
|
||||
WORKDIR="/workspace"
|
||||
|
||||
# Load nvm
|
||||
# ---- NVM bootstrap (available, not forced) ----
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||
|
||||
# Check if session exists
|
||||
if tmux has-session -t $SESSION_NAME 2>/dev/null; then
|
||||
NVM_LOAD='
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
||||
'
|
||||
|
||||
# ---- Attach if exists ----
|
||||
if tmux has-session -t "$SESSION_NAME" 2>/dev/null; then
|
||||
echo "Attaching to existing session: $SESSION_NAME"
|
||||
tmux attach-session -t $SESSION_NAME
|
||||
else
|
||||
echo "Creating new session: $SESSION_NAME"
|
||||
tmux new-session -s $SESSION_NAME -c /workspace
|
||||
tmux attach-session -t "$SESSION_NAME"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Creating new session: $SESSION_NAME"
|
||||
|
||||
# ---- Create session ----
|
||||
tmux new-session -d -s "$SESSION_NAME" -c "$WORKDIR"
|
||||
|
||||
# Pane 0: Main shell (editor / ssh / control)
|
||||
tmux send-keys -t "$SESSION_NAME:0.0" "cd $WORKDIR && clear" C-m
|
||||
tmux send-keys -t "$SESSION_NAME:0.0" "$NVM_LOAD" C-m
|
||||
|
||||
# Pane 1: Right (AI / ssh / tools)
|
||||
tmux split-window -h -t "$SESSION_NAME:0" -c "$WORKDIR"
|
||||
tmux send-keys -t "$SESSION_NAME:0.1" "$NVM_LOAD" C-m
|
||||
tmux send-keys -t "$SESSION_NAME:0.1" "echo 'AI / tools pane (run claude manually)'" C-m
|
||||
|
||||
# Pane 2: Bottom-left (review / second shell)
|
||||
tmux select-pane -t "$SESSION_NAME:0.0"
|
||||
tmux split-window -v -c "$WORKDIR"
|
||||
tmux send-keys -t "$SESSION_NAME:0.2" "$NVM_LOAD" C-m
|
||||
tmux send-keys -t "$SESSION_NAME:0.2" "echo 'Review / ssh pane'" C-m
|
||||
|
||||
# Pane 3: Bottom (tests / logs)
|
||||
tmux select-pane -t "$SESSION_NAME:0.0"
|
||||
tmux split-window -v -c "$WORKDIR"
|
||||
tmux send-keys -t "$SESSION_NAME:0.3" "$NVM_LOAD" C-m
|
||||
tmux send-keys -t "$SESSION_NAME:0.3" "echo 'Tests / logs pane'" C-m
|
||||
|
||||
# ---- Layout & focus ----
|
||||
tmux select-layout -t "$SESSION_NAME" tiled
|
||||
tmux select-pane -t "$SESSION_NAME:0.0"
|
||||
|
||||
# ---- Attach ----
|
||||
tmux attach-session -t "$SESSION_NAME"
|
||||
|
||||
8
workspace.code-workspace
Normal file
8
workspace.code-workspace
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
}
|
||||
],
|
||||
"settings": {}
|
||||
}
|
||||
Reference in New Issue
Block a user