TagUI: Free RPA Tool by AI Singapore
Complete setup guide for TagUI - the open-source Robotic Process Automation (RPA) tool by AI Singapore. Includes standalone installation, Python package setup, web automation with Chrome DevTools Protocol, visual automation with SikuliX, desktop automation, OCR capabilities, and multi-language support for automating repetitive tasks.
- Step 1
What is TagUI?
TagUI is an open-source Robotic Process Automation (RPA) tool developed by AI Singapore and the community to help you rapidly automate repetitive or time-critical tasks. It supports process automation, data acquisition, and testing of web apps. TagUI converts your intentions in 23 different human languages into working JavaScript code that performs UI automation. While AI Singapore has discontinued official maintenance, the project continues to be supported by open-source contributors and the community.
Key Features: - Free and open-source RPA tool - Works on Windows, macOS, and Linux - Web automation (Chrome, Edge) - Desktop automation with visual recognition - OCR capabilities for text extraction - Supports 23 languages for writing flows - Python, R, and JavaScript integration - No setup needed in most environments - Step 2
Technology Stack Overview
TagUI uses a modern technology stack that combines multiple powerful tools. Under the hood, it uses Chrome DevTools Protocol for browser automation, SikuliX for visual automation, Tesseract OCR for optical character recognition, and legacy support for CasperJS, PhantomJS, and SlimerJS. The core is written in JavaScript and PHP, with a natural language interpreter in PHP that supports multiple languages.
Core Technologies: - Languages: JavaScript, PHP, Python - Web Automation: Chrome DevTools Protocol - Visual Automation: SikuliX - OCR: Tesseract OCR - Legacy: CasperJS, PhantomJS, SlimerJS - Package Managers: NPM, Python pip - Browser Support: Chrome, Edge (native) - Step 3
System Prerequisites
Before installing TagUI, ensure you have the required dependencies. For visual automation on desktop or browser, you need Java JDK v8 (64-bit) or later. The Google Chrome web browser is required for web automation. TagUI works on Windows, macOS, and Linux. Avoid spaces in folder paths as some components don't work well with spaces in folder and file names.
# Check Java version (required for visual automation) java -version # Java JDK 8+ (64-bit) # Check Chrome is installed google-chrome --version # or 'chrome --version' on Windows # Optional: Check Python version (for Python package) python --version # Python 3.6+ # Optional: Check Node.js (for NPM package) node --version # Node.js 12+⚠ Heads up: For visual automation, Java JDK v8 (64-bit) or later is required. Google Chrome must be installed for web automation. Avoid spaces in installation folder paths. - Step 4
Installation Method 1: Standalone Download (Recommended)
The easiest way to get started with TagUI is to download the standalone package for your operating system. No installation is required - just download, unzip, and run. This method includes all dependencies packaged together, making it the most straightforward approach for beginners.
# Download from GitHub Releases # Visit: https://github.com/aisingapore/TagUI/releases # For Windows: Download TagUI_Windows.zip # For macOS: Download TagUI_macOS.zip # For Linux: Download TagUI_Linux.tar.gz # Extract to a folder without spaces in the path # Windows: Extract to C:\tagui # macOS: Extract to ~/Desktop/tagui # Linux: Extract to /home/your_userid/tagui - Step 5
Windows Setup (Standalone)
For Windows users, after downloading and extracting TagUI, you need to install OpenJDK for Windows (if not already installed) and add TagUI to your system PATH for easy access from any command prompt.
# 1. Download and install OpenJDK 8+ (64-bit) # Visit: https://adoptium.net/ and download the latest JDK # 2. Extract TagUI to C:\tagui (avoid spaces in path) # 3. Add C:\tagui\src to your system PATH # - Right-click 'This PC' → Properties → Advanced system settings # - Click 'Environment Variables' # - Under 'System variables', find 'Path' and click Edit # - Click 'New' and add: C:\tagui\src # - Click OK to save # 4. Open a new Command Prompt and test tagui samples\1_google⚠ Heads up: You must add C:\tagui\src to the START of your system PATH variable, not the end. After modifying PATH, open a new Command Prompt window for changes to take effect. - Step 6
macOS Setup (Standalone)
For macOS users, extract TagUI to your Desktop and add it to your PATH. macOS typically comes with Java pre-installed, but you may need to install a newer JDK version for visual automation.
# 1. Download TagUI_macOS.zip from GitHub Releases # 2. Extract to Desktop cd ~/Desktop unzip TagUI_macOS.zip # 3. Add TagUI to PATH (add to ~/.zshrc or ~/.bash_profile) echo 'export PATH="$HOME/Desktop/tagui/src:$PATH"' >> ~/.zshrc source ~/.zshrc # 4. Install Java JDK 8+ if needed (for visual automation) # Download from: https://adoptium.net/ # 5. Test TagUI tagui samples/1_google - Step 7
Linux Setup (Standalone)
For Linux users, extract TagUI to your home directory and add it to your PATH. Install OpenJDK from your distribution's package manager if not already installed.
# 1. Download TagUI_Linux.tar.gz from GitHub Releases # 2. Extract to home directory cd ~ tar -xzf TagUI_Linux.tar.gz # 3. Install OpenJDK (Ubuntu/Debian) sudo apt update sudo apt install openjdk-11-jdk # Or for Fedora/RHEL sudo dnf install java-11-openjdk-devel # 4. Add TagUI to PATH (add to ~/.bashrc) echo 'export PATH="$HOME/tagui/src:$PATH"' >> ~/.bashrc source ~/.bashrc # 5. Make TagUI executable chmod +x ~/tagui/src/tagui # 6. Test TagUI tagui samples/1_google - Step 8
Installation Method 2: Python Package
TagUI can be installed as a Python package, making it easy to integrate with Python scripts and data science workflows. The Python package provides a Pythonic API for RPA automation. There are two versions: the official 'tagui' package and 'rpa' (a fork optimized for Python).
# Install TagUI Python package pip install tagui # Or install RPA for Python (optimized fork) pip install rpa # Verify installation python -c "import tagui as t; print('TagUI installed successfully')" # Or for RPA package python -c "import rpa as r; print('RPA installed successfully')"⚠ Heads up: The Python package will automatically download TagUI dependencies on first run. Ensure you have a stable internet connection and sufficient disk space. - Step 9
Installation Method 3: NPM Package
For JavaScript/Node.js developers, TagUI can be installed via NPM. This method integrates seamlessly with Node.js projects and allows you to use TagUI in your JavaScript automation scripts.
# Install TagUI globally via NPM npm install -g tagui # Or install locally in a project npm install tagui # Verify installation tagui -v # Run a sample flow tagui samples/1_google - Step 10
Your First TagUI Flow - Web Automation
TagUI flows are written in plain text files with a simple, natural language syntax. Let's create a simple flow that searches Google. TagUI automatically waits for elements to appear and handles errors, making automation scripts more reliable.
// Save this as google_search.tag // Navigate to Google https://www.google.com // Type search query and press Enter type search as automation testing[enter] // Take a screenshot snap page to results.png // Click on the first result click //h3[1] // Wait 2 seconds wait 2 - Step 11
Running TagUI Flows
TagUI flows are executed from the command line. You can run flows in visible mode to see the browser, headless mode for background execution, or with various options to customize behavior. TagUI automatically generates logs and screenshots for debugging.
# Run flow in visible mode (see browser) tagui google_search.tag # Run flow in headless mode (background) tagui google_search.tag headless # Run with Chrome browser (default) tagui google_search.tag chrome # Run with Edge browser tagui google_search.tag edge # Run with debugging output tagui google_search.tag debug # Run and generate report tagui google_search.tag report⚠ Heads up: The first time you run TagUI, it may take longer as it downloads necessary browser drivers and dependencies. - Step 12
Python Integration - Basic Example
TagUI's Python package provides a clean API for integrating RPA automation into Python scripts. This is ideal for data science workflows, web scraping, and automated testing. The API is simple and intuitive, with methods that map directly to TagUI's natural language commands.
# Import TagUI import tagui as t # Initialize TagUI t.init() # Navigate to Google t.url('https://www.google.com') # Type search query and press enter t.type('//*[@name="q"]', 'automation testing[enter]') # Wait for results t.wait(2) # Take screenshot t.snap('page', 'results.png') # Read results count results = t.read('resultStats') print(f'Results: {results}') # Close browser t.close() - Step 13
Python Integration - Visual Automation
TagUI supports visual automation using image recognition. This allows you to automate desktop applications that don't have accessible APIs. Visual automation uses SikuliX under the hood to locate UI elements by their appearance on screen.
# Import TagUI import tagui as t # Initialize with visual automation enabled t.init(visual_automation=True) # Double-click on an icon (using image file) t.dclick('outlook_icon.png') # Wait for window to open t.wait(3) # Click the 'New Mail' button t.click('new_mail_button.png') # Type into a field t.type('recipient_field.png', 'user@example.com[tab]') t.type('subject_field.png', 'Automated Email[tab]') t.type('body_field.png', 'This email was sent via TagUI automation.') # Click send button t.click('send_button.png') # Close TagUI t.close()⚠ Heads up: Visual automation requires Java JDK 8+ (64-bit). Capture reference images at the same screen resolution where automation will run for best accuracy. - Step 14
TagUI Language Reference - Core Commands
TagUI provides a comprehensive set of commands for web and desktop automation. Commands are written in natural language and support multiple selectors including XPath, CSS, id, name, class, title, text, and href. Here are the most commonly used commands.
// Navigation http://website.com or https://website.com click element_identifier rclick element_identifier // right-click dclick element_identifier // double-click hover element_identifier // Input type element_identifier as text to enter select element_identifier as option value upload element_identifier as file path // Reading read element_identifier to variable_name // Verification check element_identifier uncheck element_identifier // Screenshots snap element_identifier to filename.png snap page to filename.png // Control Flow wait 5 // wait 5 seconds wait for element_identifier if condition // commands else // commands - Step 15
Element Selectors
TagUI supports multiple ways to identify elements on web pages. You can use XPath, CSS selectors, or HTML attributes. TagUI automatically handles waiting for elements to appear and provides clear error messages if elements are not found.
// XPath selectors click //button[@id='submit'] type //input[@name='username'] as john.doe // CSS selectors click button#submit type input[name='username'] as john.doe // HTML attributes click submit // matches id='submit' type username as john.doe // matches name='username' // Text content click 'Sign In' // clicks element containing this text // Image-based (visual automation) click image_file.png // Multiple selectors (first match wins) click //button[@id='btn1'] | //button[@class='submit-btn'] - Step 16
Desktop Automation with Visual Recognition
TagUI can automate desktop applications using visual recognition powered by SikuliX. Capture screenshots of UI elements you want to interact with, then reference those images in your flows. This works with any desktop application, regardless of the underlying technology.
# Example desktop automation flow (save as desktop_app.tag) # Enable visual automation visual on # Double-click application icon dclick app_icon.png # Wait for app to load wait 3 # Click menu item click file_menu.png click new_document.png # Type text type document_area.png as Hello World # Save using keyboard shortcut keyboard [ctrl]s wait 1 type filename_field.png as mydocument keyboard [enter] # Take screenshot snap page to completed.png⚠ Heads up: Capture reference images at the same screen resolution and DPI settings where automation will run. Use PNG format for best quality and transparency support. - Step 17
OCR (Optical Character Recognition)
TagUI integrates Tesseract OCR for reading text from images and PDF documents. This is useful for extracting data from scanned documents, screenshots, or applications that don't expose text programmatically.
// Enable visual automation (includes OCR) visual on // Read text from a specific area read invoice_total.png to total_amount echo Total: `total_amount` // Read text from entire screen area read page.png to page_text // Read from PDF (convert to image first) read document.pdf to document_text - Step 18
Multi-Language Support
TagUI supports writing flows in 23 different languages. This allows teams to write automation scripts in their native language, making RPA more accessible to non-English speakers. The language is auto-detected based on the keywords used.
// English (default) https://www.google.com type search as hello world click search button // Chinese (中文) 网址 https://www.google.com 输入 搜索 为 你好世界 点击 搜索按钮 // Spanish (Español) navegar https://www.google.com escribir búsqueda como hola mundo clic botón de búsqueda // French (Français) aller https://www.google.com taper recherche comme bonjour monde cliquer bouton rechercher - Step 19
Data Tables and CSV Integration
TagUI can read data from CSV files and iterate through rows, making it ideal for batch processing and data-driven automation. This is particularly useful for form filling, data entry, and testing with multiple datasets.
// Read CSV file and iterate through rows table accounts.csv // Loop through each row for row in accounts https://example.com/login type username as `row.username` type password as `row.password` click login // Do work... click logout wait 2 - Step 20
JavaScript Integration
TagUI flows can include JavaScript code blocks for complex logic, data manipulation, and custom functionality. This provides the flexibility of a full programming language while maintaining the simplicity of natural language commands.
// Embed JavaScript in TagUI flows // Assign variables current_time = new Date().toLocaleString() echo Current time: `current_time` // JavaScript code block js begin var result = 0; for (var i = 1; i <= 10; i++) { result += i; } return result; js finish echo Sum of 1-10: `js_result` // Call JavaScript functions js console.log('Debug message') - Step 21
Error Handling and Debugging
TagUI provides built-in error handling and debugging capabilities. It automatically waits for elements, retries operations, and generates detailed logs. Use the debug option to see step-by-step execution details.
# Run with debug output tagui myflow.tag debug # Check if element exists before interacting if present('login_button') click login_button else echo Login button not found # Try-catch pattern using conditions if exist('error_message.png') echo Error detected, taking screenshot snap page to error.png fail // explicitly fail the flow # View detailed logs cat tagui_report.txt⚠ Heads up: Always use descriptive filenames for screenshots and logs to make debugging easier. TagUI automatically appends timestamps to prevent file overwrites. - Step 22
VS Code Extension
TagUI has an official Visual Studio Code extension that provides syntax highlighting, code snippets, and shortcuts. This makes writing TagUI flows much easier with IntelliSense and error detection.
# Install VS Code extension # 1. Open VS Code # 2. Go to Extensions (Ctrl+Shift+X) # 3. Search for 'TagUI' # 4. Click Install # Or install via command line code --install-extension tebelorg.tagui-language # Features: # - Syntax highlighting for .tag files # - Code snippets for common commands # - IntelliSense autocomplete # - Error detection and warnings - Step 23
Best Practices
Follow these best practices to create reliable and maintainable TagUI automation flows. Proper structure, error handling, and documentation will make your automation scripts more robust and easier to maintain.
// 1. Use descriptive variable names user_email = 'john.doe@example.com' login_timeout = 10 // 2. Add comments to explain complex logic // Navigate to admin dashboard after login https://app.example.com/admin // 3. Use wait statements to handle timing issues wait for dashboard_loaded // 4. Take screenshots at critical steps snap page to step1_login.png // 5. Validate state before proceeding if not present('logged_in_indicator') echo Login failed, aborting fail // 6. Handle errors gracefully if exist('error_notification') read error_notification to error_msg echo Error: `error_msg` snap page to error_state.png // 7. Clean up resources // Close all browser tabs at end close - Step 24
Scheduling TagUI Flows
TagUI flows can be scheduled to run automatically using system schedulers. On Windows, use Task Scheduler. On macOS/Linux, use cron. This allows for unattended automation of repetitive tasks.
# Windows Task Scheduler # 1. Open Task Scheduler # 2. Create Basic Task # 3. Set trigger (daily, weekly, etc.) # 4. Action: Start a program # 5. Program: C:\tagui\src\tagui.cmd # 6. Arguments: C:\automation\myflow.tag headless # Linux/macOS cron # Edit crontab crontab -e # Run flow every day at 9 AM 0 9 * * * /home/user/tagui/src/tagui /home/user/flows/daily_report.tag headless # Run flow every Monday at 8 AM 0 8 * * 1 ~/tagui/src/tagui ~/flows/weekly_backup.tag headless # View cron logs (Linux) grep CRON /var/log/syslog⚠ Heads up: When scheduling flows, always use absolute paths for both the TagUI executable and flow files. Use headless mode for scheduled tasks to avoid UI interruptions. - Step 25
Troubleshooting Common Issues
Here are solutions to common TagUI issues. Most problems are related to path configuration, missing dependencies, or browser driver compatibility.
# Issue: 'tagui' command not found # Solution: Add TagUI to PATH or use full path /path/to/tagui/src/tagui myflow.tag # Issue: Visual automation not working # Solution: Verify Java JDK is installed (64-bit) java -version # Should show 1.8 or higher # Issue: Chrome/Edge not launching # Solution: Update browser to latest version google-chrome --version # Issue: Element not found errors # Solution: Add wait statements or use debug mode tagui myflow.tag debug # Issue: Permissions error on Linux/macOS # Solution: Make tagui executable chmod +x ~/tagui/src/tagui # Clean cache and retry (Python package) pip uninstall tagui -y pip install tagui --no-cache-dir # View detailed error logs cat tagui_report.txt - Step 26
Resources and Community
TagUI has an active community and extensive documentation. Here are the key resources for learning more and getting help with your automation projects.
Official Resources: - GitHub Repository: https://github.com/aisingapore/TagUI - Documentation: https://tagui.readthedocs.io/ - Python Package (RPA): https://github.com/tebelorg/RPA-Python - NPM Package: https://www.npmjs.com/package/tagui Community: - GitHub Issues: Report bugs and request features - GitHub Discussions: Ask questions and share flows - Stack Overflow: Tag questions with 'tagui' Learning: - Sample Flows: Check the samples/ folder in TagUI - Video Tutorials: Search 'TagUI RPA tutorial' on YouTube - AI Singapore Learn: https://learn.aisingapore.org/ Alternatives: - RPA for Python: https://github.com/tebelorg/RPA-Python - Selenium: For pure web automation - Playwright: Modern browser automation
Feature requests
Sign in to suggest features or vote on existing ones.
No feature requests yet.
Discussion
Sign in to join the discussion.
No comments yet.