Status: β Production Ready | Version: 0.2.0 | Challenge: GitHub Copilot CLI Challenge
DevFlow is a complete SaaS platform + self-hosted CLI agent that orchestrates AI-powered development workflows using the GitHub Copilot SDK.
Unlike traditional CLI tools, DevFlow enables teams to:
- π Use a cloud-based SaaS dashboard for task management
- π Run a self-hosted agent locally for code privacy
- π€ Execute complex workflows powered by GitHub Copilot (fix bugs, implement features, explain code, review PRs)
- π± Receive real-time notifications via Slack/Telegram
- π Integrate seamlessly with GitHub repositories
npm install -g @untools/devflowdevflow init
# Authenticate with GitHubdevflow start
# Agent polls for tasks every 5 secondsVisit the web dashboard and create a task. Watch your agent execute AI workflows!
- Next.js 14 + MongoDB
- OAuth authentication
- Task creation & monitoring
- Real-time notifications
- 11 REST API endpoints
- 3 simple commands:
init,start,status - Task polling every 5 seconds
- Secure JWT token management
- Runs locally on your machine
- Real integration with
@github/copilot-sdk - 4 AI-powered workflows
- 7 integrated tools (git, files, tests, GitHub API, etc.)
- Executes on your machineβcode never leaves
| Workflow | What It Does |
|---|---|
| fix-bug | Analyzes issue β implements fix β runs tests β creates PR |
| feature | Implements new feature with tests and documentation |
| explain | Generates documentation for code |
| review-pr | Reviews pull requests for best practices |
βββββββββββββββββββββββββββββββββββ
β Web Platform (SaaS Dashboard) β
β - Task management β
β - Notifications β
β - User management β
βββββββββββββββββββββββββββββββββββ
β (HTTP/REST)
β
βββββββββββββββββββββββββββββββββββ
β CLI Agent (Self-Hosted) β
β - Polls for tasks β
β - Secure authentication β
β - Task execution coordination β
βββββββββββββββββββββββββββββββββββ
β (Local HTTP)
βββββββββββββββββββββββββββββββββββ
β Agent-Host (Local) β
β - Copilot SDK integration β
β - Workflow execution β
β - Tool management β
βββββββββββββββββββββββββββββββββββ
- 40,000+ lines of TypeScript
- 3 independent applications
- 11 REST API endpoints
- 4 AI-powered workflows
- 7 integrated tools
- 60,000+ words of documentation
- 0 TypeScript errors (all 3 apps compile)
Comprehensive guides available:
- GETTING_STARTED.md - 5-minute quick start
- API_REFERENCE.md - Complete API specification
- CHALLENGE_SUBMISSION.md - Challenge details
- PROJECT_SUMMARY.md - Full project overview
- E2E_TESTING.md - Testing guide
- TROUBLESHOOTING.md - Solutions
- PRODUCTION_DEPLOYMENT.md - Deployment guide
Before you begin, ensure you have the following installed:
- Node.js: 18.0.0 or later
- npm: 9.0.0 or later
- MongoDB: Local instance or MongoDB Atlas connection
- Git: For repository cloning
- Operating System: macOS, Linux, or Windows (WSL2 recommended for Windows)
Check your versions:
node --version # Should output v18.0.0 or higher
npm --version # Should output 9.0.0 or higher# Clone the repository
git clone https://github.com/untools/devflow.git
cd devflow
# Install dependencies for all workspaces
npm installThis installs dependencies for three applications:
apps/web- Next.js SaaS dashboardapps/agent-host- Copilot SDK engineapps/agent- CLI agent
Create .env.local files for each application:
apps/web/.env.local
# Database
MONGODB_URI=mongodb://localhost:27017/devflow
# Authentication
JWT_SECRET=your-super-secret-key-change-this
JWT_EXPIRY=2592000 # 30 days in seconds
# GitHub OAuth (create app at https://github.com/settings/developers)
GITHUB_OAUTH_CLIENT_ID=your-github-app-id
GITHUB_OAUTH_CLIENT_SECRET=your-github-app-secret
# Telegram Integration (optional)
TELEGRAM_BOT_TOKEN=your-bot-token
TELEGRAM_CHAT_ID=your-chat-id
# Slack Integration (optional)
SLACK_WEBHOOK_URL=your-webhook-url
# Agent-Host
AGENT_HOST_URL=http://localhost:3001
DEVFLOW_API_SECRET=test-secret-123apps/agent-host/.env.local
# GitHub
GITHUB_TOKEN=ghp_your-personal-access-token
# Copilot
COPILOT_API_KEY=your-copilot-key
# Platform Communication
DEVFLOW_API_SECRET=test-secret-123
DEVFLOW_API_URL=http://localhost:3000
# Server
PORT=3001
NODE_ENV=developmentapps/agent/.env.local
# Platform
DEVFLOW_PLATFORM_URL=http://localhost:3000
# Agent
AGENT_ID=local-agent-dev
AGENT_NAME=My DevFlow Agent
# Authentication
DEVFLOW_AGENT_TOKEN=your-jwt-token
DEVFLOW_API_SECRET=test-secret-123Option A: Local MongoDB
# Install MongoDB via Homebrew (macOS)
brew tap mongodb/brew
brew install mongodb-community
# Start MongoDB
brew services start mongodb-community
# Verify it's running
mongo --eval "db.version()"Option B: MongoDB Atlas (Cloud)
- Create account at https://www.mongodb.com/cloud/atlas
- Create a cluster and get connection string
- Update
MONGODB_URIinapps/web/.env.local
DevFlow consists of 3 independent services. Run each in a separate terminal:
Terminal 1: Web Platform (Next.js)
npm run dev --workspace=apps/web
# Runs on http://localhost:3000
# Dashboard for task management and monitoringTerminal 2: Agent-Host (Copilot Engine)
npm run dev --workspace=apps/agent-host
# Runs on http://localhost:3001
# Real-time workflow execution engineTerminal 3: CLI Agent
npm run dev --workspace=apps/agent -- cli start
# Polls platform every 5 seconds for tasks
# Executes tasks via Agent-HostOnce all three are running, you should see:
- Web Platform: "β Next.js ready in Xms"
- Agent-Host: "Server running on port 3001"
- CLI Agent: "β Connected successfully" and "Waiting for tasks..."
-
Open the dashboard
http://localhost:3000 -
Authenticate
- Click "Sign In"
- GitHub OAuth flow
- Complete authentication
-
Create an Agent
- Dashboard β Agents β Register
- Name: "local-dev"
- Save the Agent ID
-
Create Your First Task
- Click "Create Task"
- Select Intent: explain
- Paste this code:
function fibonacci(n) { if (n <= 1) return n; return fibonacci(n - 1) + fibonacci(n - 2); }
- Click "Execute"
-
Watch the Agent Work
- Monitor in CLI agent terminal
- See progress updates in real-time
- View generated documentation
# 1. Initialize the agent
devflow init
# Follow prompts for platform URL and authentication
# 2. Start polling for tasks
devflow start
# 3. In another terminal, create a task via API
curl -X POST http://localhost:3000/api/tasks \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"agentId": "local-agent-dev",
"intent": "explain",
"description": "Explain the fibonacci function",
"payload": {
"code": "function fib(n) { if (n <= 1) return n; return fib(n-1) + fib(n-2); }"
}
}'-
Identify the issue:
- Repository:
owner/repo - Issue description: "Fix authentication error on login"
- Repository:
-
Create task:
devflow task create \ --intent fix-bug \ --repo owner/repo \ --description "Fix authentication error on login" -
Agent executes:
- Clones repository
- Analyzes issue
- Implements fix
- Runs tests
- Creates pull request
-
Plan the feature:
- Specification: "Add dark mode toggle"
-
Create task:
devflow task create \ --intent feature \ --repo owner/repo \ --description "Implement dark mode with persistent storage" -
Agent builds:
- Analyzes codebase
- Plans architecture
- Writes implementation
- Adds tests
- Creates documentation
- Opens PR
devflow task create \
--intent explain \
--description "Explain how the auth middleware works" \
--code-path src/middleware/auth.tsdevflow task create \
--intent review-pr \
--repo owner/repo \
--pr-number 42 \
--description "Review for security and performance"# Verify MongoDB is running
ps aux | grep mongod
# Start MongoDB if not running
brew services start mongodb-community# Ensure all 3 services are running
curl http://localhost:3000/health # Web platform
curl http://localhost:3001/health # Agent-Host
# If not responding, restart the service# Re-initialize with fresh credentials
devflow init
# Or manually update token in config
cat ~/.devflow/config.json # View config# Check service logs for errors
# View CLI Agent terminal for error messages
# Verify all services have proper environment variables
env | grep DEVFLOW
# Check network connectivity
curl -I http://localhost:3000
curl -I http://localhost:3001Live Reload: All services support hot-reload during development.
Debugging: View detailed logs:
# In CLI agent terminal
devflow start --log-level debug
# Check web platform logs
npm run dev --workspace=apps/web -- --debugTesting Your Changes:
# Run linter across all apps
npm run lint
# Run tests if available
npm test
# Build all applications
npm run buildDatabase Reset:
# Connect to MongoDB and drop database
mongo
> use devflow
> db.dropDatabase()
> exitOnce you're familiar with the basics:
-
Connect to Real GitHub
- Register your GitHub App
- Deploy to production server
- Monitor real workflow executions
-
Set Up Notifications
- Configure Telegram integration
- Set up Slack webhooks
- Real-time updates to your chat
-
Advanced Configuration
- Custom workflows
- Extended tool integration
- Performance optimization
-
Production Deployment
- See PRODUCTION_DEPLOYMENT.md
- Docker containerization
- Cloud deployment (Render, Vercel, AWS)
- Node.js 18+
- MongoDB (local or Atlas)
- GitHub account
# Clone repository
git clone https://github.com/untools/devflow.git
cd devflow
# Install dependencies
npm install
# Start services (3 terminals)
# Terminal 1: Web Platform
npm run dev --workspace=apps/web
# http://localhost:3000
# Terminal 2: Agent-Host
npm run dev --workspace=apps/agent-host
# http://localhost:3001
# Terminal 3: CLI Agent
npm run dev --workspace=apps/agent -- cli start# apps/web/.env.local
MONGODB_URI=mongodb://localhost:27017/devflow
JWT_SECRET=<random-secret>
GITHUB_OAUTH_CLIENT_ID=<your-github-app-id>
GITHUB_OAUTH_CLIENT_SECRET=<your-github-app-secret>- β OAuth 2.0 authentication
- β JWT tokens (30-day expiry)
- β Secure config storage (mode 0o600)
- β Local code execution (code never uploaded)
- β Bearer token authentication on all APIs
Next.js 14 SaaS platform with MongoDB
- User authentication
- Agent management
- Task creation & monitoring
- Real-time notifications
npm package @untools/devflow
- CLI:
devflow init,devflow start,devflow status - Task polling from platform
- Secure configuration management
Express.js server with Copilot SDK
- Real
@github/copilot-sdkintegration - Workflow execution engine
- Tool definitions and execution
Ready to publish to npm:
cd apps/agent
npm publish --access publicUsers can then install globally:
npm install -g @untools/devflow- β Built with GitHub Copilot SDK
- β Complete CLI tool
- β Innovative two-tier architecture
- β Production-ready code (40,000+ LOC)
- β Comprehensive documentation (60,000+ words)
- β All 3 apps compile (0 errors)
- β Ready for GitHub Copilot CLI Challenge
MIT
- npm:
@untools/devflow - GitHub: github.com/untools/devflow
- Challenge: GitHub Copilot CLI Challenge
- Deadline: February 15, 2025 (Submitted January 24 - 22 days early)
Built with β€οΈ for the GitHub Copilot CLI Challenge