A professional-grade browser automation platform with both web and CLI interfaces. Built with Next.js 14, TypeScript, React, Tailwind CSS, Playwright, and Python.
This repository contains two main components:
- Web Application (Root): Enterprise-ready Next.js web interface with advanced features
- CLI Tool (
nava-cli/): Python-based command-line interface for browser automation
Choose the interface that best fits your workflow!
π Major Update: Nava has been transformed into a professional-grade automation platform!
- π API Key Authentication - Secure your instance with optional API keys
- β‘ 8 New Task Types - Scroll, hover, dropdown selection, text extraction, smart waits, tab switching, file upload, downloads
- π Workflow Library - Save, manage, and reuse automation workflows
- πΈ Screenshot Gallery - Automatic screenshot management with visual gallery
- π Task History & Replay - Persistent command history with one-click replay
- π¨ Enhanced UI - Modern navigation, better feedback, mobile responsive
- π‘οΈ Production Ready - TypeScript strict mode, comprehensive error handling, optimized builds
- Modern Navigation Bar: Quick access to Workflows, Screenshots, and Documentation
- Beautiful UI: Responsive interface with Tailwind CSS and modern design
- Real-time Execution: Instant task execution with live feedback
- Workflow Management: Save and reuse complex automation sequences
- Screenshot Gallery: Visual gallery with lightbox, download, and metadata
- Task History: Persistent history with replay functionality
- API Security: Optional API key authentication for production deployments
- RESTful API: Comprehensive API endpoints for programmatic access
- Vercel Ready: Optimized for serverless deployment
- TypeScript: Fully typed codebase with strict mode enabled
- Python-Based: Powerful command-line automation tool
- Rich Terminal UI: Interactive command-line interface
- Scheduling: Automate tasks with built-in scheduler
- Workflow Management: Create and execute complex automation workflows
- Integration Support: Extensible integration system
- Natural Language Commands: Control browsers with simple English (26+ command types)
- Smart Text-Based Clicking: Click buttons and links by their visible text
- Intelligent Form Filling: Fill forms by field labels automatically
- Multi-Step Workflows: Chain multiple commands with comma separation
- Advanced Interactions: Scroll, hover, select dropdowns, extract text, smart waits
- Tab Management: Switch between browser tabs
- File Operations: Upload files and capture downloads
- Visible/Headless Toggle: Watch automation or run in background
- Playwright Integration: Robust browser automation powered by Playwright
- Node.js 18.17.0 or higher
- pnpm, npm, or yarn package manager
- Vercel account (optional, for deployment)
- Python 3.8 or higher
- pip package manager
The web application is now at the root of the repository.
# Using pnpm (recommended)
pnpm install
# Or using npm
npm installnpx playwright install chromiumpnpm run dev
# Or: npm run devOpen http://localhost:3000 in your browser.
The CLI tool is located in the nava-cli/ directory.
cd nava-clipip install -r requirements.txtpython cli.pyFor detailed CLI documentation, see nava-cli/README_PRO.md
pnpm run build
pnpm start
# Or: npm run build && npm startImportant: The web application is now at the repository root, so deployment is simpler.
- Install Vercel CLI:
npm i -g vercel- Login to Vercel:
vercel login- Deploy from the repository root:
vercelFor production deployment:
vercel --prod- Push your code to GitHub
- Go to vercel.com
- Click "Import Project"
- Select your GitHub repository
- Vercel will auto-detect Next.js configuration
- Configure build settings (optional):
- Framework Preset: Next.js (auto-detected)
- Root Directory:
.(leave as root) - Build Command:
pnpm run buildornpm run build - Install Command:
pnpm install && npx playwright install chromium
- Click "Deploy"
- Go to vercel.com/new
- Import your Git repository
- Vercel will auto-detect Next.js from the root
- Add build settings if needed:
Build Command: pnpm run build Install Command: pnpm install && npx playwright install chromium - Deploy
Note: The vercel.json configuration is already set up at the repository root.
Create a .env.local file in the root directory:
# Node Environment
NODE_ENV=production
# Playwright Configuration
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0
# API Security (set to 'none' to disable authentication)
NAVA_API_KEY=your_secure_api_key_here
# Optional: Rate Limiting
MAX_REQUESTS_PER_MINUTE=60
# Optional: Browser Configuration
DEFAULT_TIMEOUT=30000
MAX_CONCURRENT_SESSIONS=5
# Optional: Features
ENABLE_SCREENSHOTS=true
ENABLE_FILE_UPLOAD=trueThe vercel.json file is pre-configured with:
- Optimized memory (2GB) for Hobby plan compatibility
- Extended timeout (60s) for automation tasks
- Playwright Chromium installation
- Environment variable management
Note: For production deployments requiring longer timeouts or more memory, consider upgrading to Vercel Pro plan.
- Want a visual interface with real-time feedback
- Need to deploy on Vercel or other serverless platforms
- Prefer TypeScript/JavaScript ecosystem
- Want easy API access for integrations
- Need a production-ready web UI
- Prefer command-line interfaces
- Need advanced scheduling capabilities
- Want local Python-based automation
- Need workflow management features
- Want to integrate with Python scripts
Both interfaces share the same core automation features!
All API endpoints support optional API key authentication via the x-api-key header:
curl -X POST http://localhost:3000/api/execute \
-H "Content-Type: application/json" \
-H "x-api-key: your_api_key_here" \
-d '{"task": "go to github.com"}'Set NAVA_API_KEY=none in .env.local to disable authentication.
Endpoint: POST /api/execute
Headers:
Content-Type: application/json
x-api-key: your_api_key (if authentication enabled)
Request Body:
{
"task": "go to github.com, scroll down, screenshot",
"headless": true
}Response:
{
"success": true,
"result": {
"success": true,
"taskType": "screenshot",
"detail": "Screenshot captured successfully",
"data": {
"screenshot": "base64_encoded_image...",
"pageUrl": "https://github.com"
}
},
"timestamp": "2024-01-01T12:00:00.000Z"
}Endpoint: POST /api/execute-chain
Headers:
Content-Type: application/json
x-api-key: your_api_key (if authentication enabled)
Request Body:
{
"tasks": [
"go to github.com",
"scroll down 500",
"hover over .menu",
"click search button",
"wait for #results to appear"
],
"headless": true
}Response:
{
"success": true,
"results": [...],
"totalTasks": 3,
"successfulTasks": 3,
"failedTasks": 0,
"timestamp": "2024-01-01T12:00:00.000Z"
}Endpoint: GET /api/workflows
Headers:
x-api-key: your_api_key (if authentication enabled)
Response:
{
"success": true,
"templates": [
{
"id": "template_1",
"name": "Login Flow",
"description": "Standard login workflow",
"tasks": ["go to https://example.com", "click login button", ...],
"tags": ["authentication", "login"]
}
]
}Endpoint: GET /api/screenshots
Headers:
x-api-key: your_api_key (if authentication enabled)
Response:
{
"success": true,
"screenshots": [
{
"filename": "screenshot_123.png",
"url": "/screenshots/screenshot_123.png",
"size": 245678,
"created": "2024-01-01T12:00:00.000Z"
}
],
"count": 15
}go to <url>- Navigate to a URLvisit <url>- Navigate to a URLnavigate to <url>- Navigate to a URLaccess <page>- Navigate by clicking a link/button with text
Examples:
go to https://example.com
go to github.com
access my dashboard
search for <query>- Google searchsearch <query>- Google search
Examples:
search for react tutorials
search Tradia AI
click <button text>- Click by visible text (button, link, etc.)click <selector>- Click by CSS selector
Examples:
click login button
click menu
click Sign In
click #submit-btn
scroll down- Scroll down 500pxscroll up- Scroll up 500pxscroll down <pixels>- Scroll down custom amountscroll to top- Scroll to page topscroll to bottom- Scroll to page bottomscroll to <selector>- Scroll to element
Examples:
scroll down
scroll down 1000
scroll to top
scroll to #footer
hover over <selector>- Hover over elementhover <selector>- Hover over element
Examples:
hover over .menu-item
hover #dropdown-trigger
select "<option>" from <selector>- Select dropdown option
Examples:
select "United States" from #country
select "Blue" from select[name="color"]
get text from <selector>- Extract text from elementextract text from <selector>- Extract text from element
Examples:
get text from h1
extract text from .description
wait for <selector> to appear- Wait for elementwait for <selector> for <seconds> seconds- Wait with timeoutwait <seconds>- Wait for duration
Examples:
wait for #success to appear
wait for .loading for 10 seconds
wait 5
switch to tab <index>- Switch to browser tab (0-indexed)
Examples:
switch to tab 0
switch to tab 1
upload <filepath> to <selector>- Upload file to inputdownload- Capture download event
Examples:
upload /path/to/file.pdf to input[type="file"]
download
fill <field name> with <value>- Fill by label textfill <selector> with <value>- Fill by CSS selector
Examples:
fill email with test@example.com
fill password with mypassword
fill #username with john_doe
type <text> in <selector>- Type textpress <key>- Press a keyboard key
Examples:
type hello world in #search
press Enter
extract links- Get all links from pagescreenshot- Capture page screenshot (auto-saved to gallery)
Separate commands with commas to execute them in sequence:
Examples:
go to example.com, scroll down, hover over button, click menu
go to store.com, select "Blue" from #color, click add to cart, screenshot
go to form.com, fill name, wait for #confirmation to appear, screenshot
go to github.com, scroll to bottom, extract links
If Playwright browsers aren't installing:
npx playwright install --with-deps chromiumThe configuration is optimized for Vercel Hobby plan (2GB limit). For Pro plan:
- Upgrade your Vercel plan
- Adjust
vercel.json:
{
"functions": {
"app/api/**/*.ts": {
"memory": 3008,
"maxDuration": 300
}
}
}If you encounter ESLint or TypeScript errors:
# Run build locally to see errors
pnpm run build
# Common fixes already implemented:
# - Suspense boundaries for useSearchParams
# - TypeScript strict mode compliance
# - ESLint rule complianceIf API calls fail with 401:
- Check
NAVA_API_KEYis set in.env.local - Include
x-api-keyheader in requests - Or set
NAVA_API_KEY=noneto disable auth
Nava/
βββ app/ # Next.js app directory (Web App)
β βββ api/
β β βββ execute/
β β β βββ route.ts # Single task execution API
β β βββ execute-chain/
β β β βββ route.ts # Task chain execution API
β β βββ workflows/ # β¨ NEW
β β β βββ route.ts # Workflow templates API
β β βββ screenshots/ # β¨ NEW
β β βββ route.ts # Screenshot management API
β βββ workflows/ # β¨ NEW
β β βββ page.tsx # Workflow management page
β βββ screenshots/ # β¨ NEW
β β βββ page.tsx # Screenshot gallery page
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Enhanced home page with all features
βββ lib/ # Web app utilities
β βββ browser.ts # Browser session management (enhanced)
β βββ task-executor.ts # Task parsing and execution (enhanced)
β βββ workflow-manager.ts # β¨ NEW - Workflow storage & operations
β βββ screenshot-manager.ts # β¨ NEW - Screenshot storage & operations
βββ public/
β βββ screenshots/ # β¨ NEW - Screenshot storage directory
βββ middleware.ts # β¨ NEW - API authentication middleware
βββ nava-cli/ # Python CLI Tool
β βββ cli.py # Main CLI entry point
β βββ browser.py # Browser automation core
β βββ task_executor.py # Task execution logic
β βββ scheduler.py # Task scheduling
β βββ workflow.py # Workflow management
β βββ integrations.py # External integrations
β βββ api_server.py # API server for CLI
β βββ setup.bat # Windows setup script
β βββ run.bat # Windows run script
β βββ README_PRO.md # CLI documentation
βββ .env.example # Environment variables template (enhanced)
βββ next.config.js # Next.js configuration
βββ package.json # Web app dependencies
βββ pnpm-lock.yaml # pnpm lock file
βββ tailwind.config.ts # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration (strict mode)
βββ vercel.json # Vercel deployment config (optimized)
βββ netlify.toml # β¨ NEW - Netlify deployment config
βββ QUICKSTART.md # Quick start guide
βββ FEATURES.md # β¨ NEW - Detailed feature documentation
βββ QUICK-REFERENCE.md # β¨ NEW - Command cheat sheet
βββ IMPLEMENTATION-COMPLETE.md # β¨ NEW - Technical implementation details
βββ NEW-FEATURES-README.md # β¨ NEW - v2.0 feature overview
βββ README.md # This file
For faster cold starts, consider Edge runtime for non-browser tasks:
export const runtime = 'edge';Implement response caching for repeated tasks:
export const revalidate = 60; // Cache for 60 secondsUse the task chain API with parallel execution for multiple tasks.
- API Key Authentication: Optional middleware-based authentication (
middleware.ts) - CORS Configuration: Properly configured CORS headers
- Input Validation: TypeScript strict mode with comprehensive validation
- Environment Variables: Secure configuration management
- Type Safety: Full TypeScript coverage with strict mode
- Set API Key: Always set a strong
NAVA_API_KEYin production - Enable HTTPS: Vercel provides automatic HTTPS
- Rate Limiting: Consider implementing rate limiting middleware
- Input Sanitization: Validate all user inputs before processing
- Error Handling: Production error messages don't expose sensitive data
- Monitoring: Set up logging and monitoring for suspicious activity
# Production .env.local
NAVA_API_KEY=use_a_strong_random_key_here_min_32_chars
NODE_ENV=productionAlways include the API key in requests:
curl -H "x-api-key: your_secure_key" https://your-app.vercel.app/api/executeVercel Analytics is integrated. View metrics at:
https://vercel.com/your-username/nava-web/analytics
Add custom logging in API routes:
console.log('Task executed:', result);- QUICKSTART.md: Fast 5-minute setup guide
- FEATURES.md: β¨ NEW - Complete feature guide with examples
- QUICK-REFERENCE.md: β¨ NEW - Command cheat sheet
- NEW-FEATURES-README.md: β¨ NEW - v2.0 release overview
- IMPLEMENTATION-COMPLETE.md: β¨ NEW - Technical implementation details
- DEPLOYMENT.md: Detailed Vercel deployment instructions
- MIGRATION-SUMMARY.md: Project restructuring notes
- nava-cli/README_PRO.md: Complete CLI documentation
- nava-cli/QUICKSTART.md: CLI quick start guide
- Web Pages: Visit
/workflowsand/screenshotsafter running the app - API Endpoints:
/api/execute,/api/execute-chain,/api/workflows,/api/screenshots - Environment Config: See
.env.examplefor all configuration options
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - feel free to use this project for any purpose.
For issues and questions:
- Open an issue on GitHub
- Check the troubleshooting section
- Review Vercel deployment logs (for web app)
- See CLI documentation for CLI-specific issues
- Python
- Playwright
- Rich (for terminal UI)
- Playwright - Browser automation engine
Made with β€οΈ by Abdulmuiz44
β Star this repo if you find it useful!