Originally published on tamiz.pro.
Introduction
Autonomous AI coding agents promise to reduce developer friction by running continuously in the cloud, writing, testing, and refactoring code without human intervention. Commercial offerings like GitHub Copilot Workspace or Replit Agent cost $10–$20/month per seat. This guide shows how to build an equivalent autonomous coding agent for just $5.70/month, using open-source tools agent-deck and orca, running on a minimal cloud VM.
We'll cover:
- Deploying a lightweight Ubuntu VM on a budget cloud provider
- Installing
agent-deckto manage terminal-based AI agents - Configuring
orca, a minimal CLI agent runtime - Wiring up autonomous git pushes, test runs, and issue triage
- Securing access with SSH keys and restricting shell permissions
Prerequisites
Before starting, ensure you have:
- A DigitalOcean or Vultr account (or equivalent)
- Basic familiarity with Linux, SSH, and Git
- An OpenAI-compatible API key (OpenAI, Anthropic via proxy, or local LLM endpoint)
- A GitHub or GitLab repository to operate on
Step 1: Provision the Cloud VM
Create a minimal Ubuntu 22.04 droplet (1 CPU, 1 GB RAM, 25 GB SSD):
# Example using DigitalOcean CLI (doctl)
doctl compute droplet create ai-agent \
--image ubuntu-22-04-x64 \
--size s-1vcpu-1gb \
--region nyc3 \
--ssh-keys <your-ssh-key-id> \
--wait
Cost: ~$5/month. Smaller plans exist but may be too constrained for agent workloads.
SSH into the machine:
ssh root@your-vm-ip
Step 2: Install Dependencies
Update packages and install essentials:
apt-get update && apt-get upgrade -y
apt-get install -y git curl python3 python3-pip docker.io
pip3 install --upgrade pip
Step 3: Install agent-deck
agent-deck is an open-source terminal session manager designed for orchestrating AI agents. It exposes a tmux-like interface and can spawn multiple agent sessions.
curl -fsSL https://raw.githubusercontent.com/humanlayer/agent-deck/main/install.sh | bash
source ~/.bashrc
Verify installation:
agent-deck --version
Step 4: Install orca
orca is a minimal CLI runtime for running terminal-based AI agents. It supports plugin-style workflows and integrates with agent-deck.
git clone https://github.com/humanlayer/orca.git
cd orca
pip3 install .
Configure orca with your LLM provider:
orca config set llm.provider openai
orca config set llm.api_key $OPENAI_API_KEY
Export the API key securely:
echo 'export OPENAI_API_KEY="your-api-key-here"' >> ~/.bashrc
source ~/.bashrc
Step 5: Bootstrap the Agent Environment
Clone the target repository:
git clone git@github.com:your-org/your-repo.git
cd your-repo
Start an agent-deck session:
agent-deck new my-agent
Inside the session, launch orca:
orca agent --name coder --prompt "You are a senior engineer maintaining this repo. Fix bugs, write tests, and commit improvements autonomously." --workdir /path/to/repo
Step 6: Enable Autonomous Git Operations
Allow the agent to commit and push changes:
orca plugin add git-commit
orca plugin add git-push
Ensure SSH credentials are available:
ssh-agent bash
ssh-add ~/.ssh/id_ed25619
Security note: Use a deploy key with limited push permissions instead of your personal SSH key.
Step 7: Automate Test Execution
Add a test runner plugin:
orca plugin add test-runner --cmd "make test"
Configure orca to run tests after each commit:
orca hooks add post-commit "orca run test-runner"
Step 8: Schedule the Agent
Use cron to restart the agent daily:\n
crontab -e
Add:
```cron\0 9 * * * agent-deck send "my-agent" "orca agent --name coder --prompt '...' --workdir /path/to/repo' > /dev/null 2>&1
---
## Step 9: Monitor Agent Sessions
List active sessions:
```bash
agent-deck ls
Attach to a session:
agent-deck attach my-agent
Cost Breakdown
| Resource | Monthly Cost |
|---|---|
| VM (1vCPU, 1GB) | $5.00 |
| Storage | $0.50 |
| Outbound Bandwidth | $0.20 |
| Total | $5.70 |
Savings vs. Copilot Workspace ($20/month): 71% cheaper.
Security Considerations
- Restrict shell access via SSH keys only
- Use a dedicated GitHub deploy key with write-only access
- Run the agent under a non-root user
- Regularly audit
agent-decksessions andorcalogs
Frequently Asked Questions
Q: Can I use a local LLM instead of OpenAI?
A: Yes. Point orca to any OpenAI-compatible endpoint (e.g., Ollama, vLLM).
Q: How do I prevent the agent from deleting files?
A: Add a pre-execution hook that blocks destructive commands like rm -rf.
Q: What happens if the agent produces bad code?
A: All changes go through git commits. Use branch protection rules and require PR reviews before merging.
Top comments (0)