- QUICKSTART.md: aggiornata sezione Chat Interattiva con EnhancedCLI - AGENT_ROADMAP.md: aggiornato stato a "Agente AI completo" - Aggiunto completamento fasi roadmap - Aggiornato commit log con tutti gli 8 commit
5.4 KiB
5.4 KiB
LangCode Agent - Guida Rapida
Installazione
# 1. Clona il repository
git clone http://192.168.0.183:8085/truetype/langcode_agent.git
cd langcode_agent
# 2. Crea e attiva virtual environment
python3 -m venv venv
source venv/bin/activate
# 3. Installa dipendenze
pip install -r requirements.txt
Configurazione Rapida
# Imposta variabili d'ambiente
export MODEL_PROVIDER=ollama
export MODEL_NAME=gemma2:9b
export OLLAMA_BASE_URL=http://192.168.0.50:11434
Oppure usa la CLI interattiva per salvare configurazioni persistenti:
langcode config add -n ollama -p ollama -m gemma2:9b -u http://192.168.0.50:11434 --set-active
langcode config test
Modalità di Utilizzo
1. Chat Interattiva (EnhancedCLI)
langcode chat
Chatta con l'agent AI in tempo reale con UI moderna:
- Colors: User (cyan), Agent (green), Error (red)
- History: Cronologia comandi persistente (↑↓)
- Autocomplete: Tab per completare comandi
- 4 Temi: default, dark, light, monokai
- Syntax Highlighting: Code blocks colorati
- Keyboard shortcuts: Ctrl+A/E, Ctrl+K/U, Ctrl+W
Comandi CLI interni:
/help - Mostra aiuto
/status - Stato sistema
/clear - Pulisci schermo (Ctrl+L)
/theme-* - Cambia tema
/timestamps - Toggle timestamps
/syntax - Toggle syntax highlighting
/history - Mostra cronologia
/exit - Esci
2. Server Web (API + Dashboard)
langcode server
langcode server --port 8080
langcode server --host 0.0.0.0 --port 3000
Accesso dopo l'avvio:
- 🌐 Web UI: http://localhost:8000
- 📊 Dashboard: http://localhost:8000/monitoring
- 🛒 Marketplace: http://localhost:8000/marketplace
- 📖 API Docs: http://localhost:8000/docs
3. CLI Configurazione
langcode config list # Lista configurazioni
langcode config add -n nome -p ollama -m gemma2:9b -u http://... # Aggiungi
langcode config use nome # Attiva configurazione
langcode config active # Mostra attiva
langcode config test # Testa connessione
langcode config search ollama # Cerca
langcode config export -f json # Esporta
langcode config import backup.json # Importa
4. TUI Interattiva
langcode tui
Interfaccia testuale per gestire configurazioni.
5. Analytics
langcode analytics # Riepilogo rapido
langcode analytics --report # Report completo
langcode dashboard # Dashboard performance
Comandi Interni (nella Chat)
Durante la chat interattiva (langcode chat):
/help # Aiuto
/status # Stato sistema
/config list # Lista configurazioni
/config use <nome> # Cambia configurazione
/models # Elenca modelli
/clear # Pulisci schermo
/exit # Esci
Memory (Memoria Persistente)
/memory remember <testo> # Salva un fatto
/memory recall <query> # Cerca fatti
/memory preference set <key> <value> # Imposta preferenza
/memory preference get <key> # Leggi preferenza
/memory stats # Statistiche
Planning (Pianificazione)
/plan create "<nome piano>" "<task1; task2; task3>" # Crea piano
/plan list # Elenca piani
/plan progress <plan_id> # Mostra progresso
/plan start <task_id> # Inizia task
/plan complete <task_id> # Completa task
Skills (Gestione Skills)
/skills list # Skills installate
/skills search <query> # Cerca skills
/skills install <nome> # Installa skill
/skills details <nome> # Dettagli skill
/skills uninstall <nome> # Disinstalla
Struttura
langcode_agent/
├── langcode.py # CLI unificato (langcode)
├── main.py # Agent principale
├── api_server.py # Server web + API
├── config_manager.py # Gestione configurazioni
├── config_cli.py # CLI configurazione
├── config_tui.py # TUI configurazione
├── skill_manager.py # Gestione skills
├── mcp_client.py # Client MCP
├── analytics.py # Analytics
├── dashboard.py # Dashboard performance
├── monitoring.py # Monitoraggio
├── enhancements/ # Memory e Planning
│ ├── simple_memory.py
│ └── planning_enhancement.py
├── web/ # Frontend web
├── plugins/ # Plugin sistema
└── venv/ # Virtual environment
Provider Supportati
| Provider | Variabili necessarie |
|---|---|
| Ollama | OLLAMA_BASE_URL |
| OpenAI | OPENAI_API_KEY |
| OpenRouter | OPENROUTER_API_KEY |
| Anthropic | ANTHROPIC_API_KEY |
GOOGLE_API_KEY |
Troubleshooting
Agent non si avvia:
source venv/bin/activate
pip install -r requirements.txt
Ollama non risponde:
curl http://192.168.0.50:11434/api/tags
Porta già in uso:
langcode server --port 8080
Tempo installazione: ~5 minuti