AI-powered coding agent with loop technique for safe AI coding environments.
TFGrid AI Agent is a standalone application that provides an isolated, safe environment for AI-assisted coding. It uses the "loop technique" to enable AI agents to iteratively work on projects without risking your local development environment.
- 🤖 AI-Powered Coding - Uses qwen-cli for AI assistance
- 🔄 Loop Technique - Iterative AI coding with safety
- 🏝️ Isolated Environment - Runs on dedicated VM
- 📦 Project Management - Create, edit, and manage projects
- 🔒 Safe - No access to your local files
- ⚡ Concurrent Projects - Run multiple AI agents simultaneously
For the full experience with automatic Git hosting, use tfgrid-ai-stack:
# Deploy complete AI + Git environment
tfgrid-compose up tfgrid-ai-stack
# Authenticate with Qwen
tfgrid-compose login
# Create project (AI generates code + creates Git repo automatically)
tfgrid-compose create "modern web application"
# Monitor progress
tfgrid-compose monitor web-application
# View results in web interface
tfgrid-compose projectsFor standalone usage without Git integration:
# Deploy just the AI agent
tfgrid-compose up tfgrid-ai-agent
# Connect to the agent
tfgrid-compose ssh tfgrid-ai-agent
# Use agent scripts directly
/opt/ai-agent/scripts/create-project.sh my-project
/opt/ai-agent/scripts/agent-loop.shtfgrid-ai-agent/
├── tfgrid-compose.yaml # Deployment manifest
├── src/ # Application source
│ ├── scripts/ # Agent scripts
│ └── templates/ # Project templates
├── deployment/ # Deployment hooks
│ ├── setup.sh # Install dependencies
│ ├── configure.sh # Configure service
│ └── healthcheck.sh # Verify deployment
├── patterns/ # Pattern-specific configs
└── docs/ # Documentation
Minimum:
- 2 CPU cores
- 4 GB RAM
- 50 GB disk
Recommended:
- 4 CPU cores
- 8 GB RAM
- 100 GB disk
The deployment automatically installs:
- Node.js (>=18.0.0)
- npm (>=9.0.0)
- qwen-cli (@qwen-code/qwen-code)
- git, curl, wget
QWEN_API_KEY (optional)
- Qwen API key for AI access
- Can be set after deployment
PROJECT_WORKSPACE (default: /opt/ai-agent)
- Agent workspace directory
- All projects stored here
single-vm (Recommended)
- Single VM deployment
- Private access via Wireguard/Mycelium
- Best for development
k3s (Future)
- Kubernetes deployment
- For team environments
# Create from template
/opt/ai-agent/scripts/create-project.sh my-web-app
# Edit existing project
/opt/ai-agent/scripts/edit-project.sh my-web-app
# List all projects
/opt/ai-agent/scripts/list-projects.sh
# Delete project
/opt/ai-agent/scripts/delete-project.sh my-web-app# Start the agent loop (interactive)
/opt/ai-agent/scripts/agent-loop.sh
# Advanced loop with more options
/opt/ai-agent/scripts/agent-loop-advanced.shAll projects are stored in /opt/ai-agent/projects/:
/opt/ai-agent/
├── projects/
│ ├── my-web-app/
│ ├── my-api/
│ └── my-tool/
├── logs/
└── scripts/
Logs are available via:
# Systemd logs
journalctl -u tfgrid-ai-agent -f
# Application logs
tail -f /var/log/ai-agent/output.log
tail -f /var/log/ai-agent/error.logThe agent runs as a systemd service:
# Check status
systemctl status tfgrid-ai-agent
# Start/stop
systemctl start tfgrid-ai-agent
systemctl stop tfgrid-ai-agent
# Restart
systemctl restart tfgrid-ai-agent
# View logs
journalctl -u tfgrid-ai-agent -f# Check status
systemctl status tfgrid-ai-agent
# View logs
journalctl -u tfgrid-ai-agent -n 50
# Restart
systemctl restart tfgrid-ai-agent# Check installation
qwen --version
# Reinstall
npm install -g @qwen-code/qwen-code# Fix workspace permissions
chown -R root:root /opt/ai-agent
chmod -R 755 /opt/ai-agent/scriptsYou can run the agent locally without TFGrid:
# Clone the repo
git clone https://github.com/tfgrid-studio/tfgrid-ai-agent
cd tfgrid-ai-agent
# Run setup manually
sudo ./deployment/setup.sh
sudo ./deployment/configure.sh
./deployment/healthcheck.shContributions welcome! Please:
- Fork the repo
- Create a feature branch
- Make your changes
- Submit a pull request
- Agent runs in isolated VM
- No access to local files
- All code execution in safe environment
- Review all AI-generated code before use
Apache 2.0
- 📚 Documentation: docs.tfgrid.studio
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 📧 Contact: tfgrid.studio/contact
- TFGrid Studio: github.com/tfgrid-studio
Part of: TFGrid Studio
Status: ✅ Production Ready
Version: 0.3.0
Concurrent Projects: ✅ Multiple projects supported
Compatible with: tfgrid-compose v0.11.0+ (all patterns)