Getting Started
Create your first automation project and learn the IDE
Creating a New Project
To create a new automation project:
- Make sure you are logged in
- Navigate to MY ACCOUNT -> AUTOMATIONS in your dashboard
- Click the New Automation button
- Enter a project name and optional description
- Click Create Project
Your project will be created with a default main.ts file as the entry point. This is where your automation code will start executing.
The IDE
The automation IDE provides a full development environment with:
Code Editor
Full TypeScript support with syntax highlighting, autocomplete, and error checking. The editor automatically compiles TypeScript to JavaScript on save.
File Explorer
Manage your project files and folders. Create, rename, and delete files. Organize your code across multiple TypeScript files with ES6 imports.
Git Integration
Built-in version control with commit history, diff viewer, and revert functionality. Track changes and roll back to previous versions when needed.
Options Panel
Configure automation parameters, job variables, requirements, and sharing settings. See the Configuration page for details.
Project Structure
A typical automation project structure:
my-automation/├── main.ts # Entry point (required)├── stages.ts # Stage enum definitions├── screenStates.ts # Screen state enum├── detection.ts # Screen detection logic├── handlers.ts # Stage handlers└── utils.ts # Shared utilitiesYou can organize your code however you like, but this structure works well for most automations. The entry point is always main.ts.
Your First Automation
Here's a simple automation that launches an app and takes a screenshot:
// Simple automation exampleconst PACKAGE_NAME = "com.example.myapp";
async function main() { try { // Launch the app await agent.actions.launchApp(PACKAGE_NAME);
// Wait for app to load await sleep(3000);
// Get screen content const screen = await agent.actions.screenContent();
// Find all text on screen const allNodes = getAllNodes(screen); const textNodes = allNodes.filter(node => node.text);
console.log("Found text nodes:", textNodes.length);
// Take a screenshot const screenshot = await agent.actions.screenshot(1080, 1920, 80); console.log("Screenshot taken!");
// Submit success await agent.utils.job.submitTask("success", { textNodesFound: textNodes.length });
} catch (error) { console.error("Automation failed:", error); await agent.utils.job.submitTask("failed", { error: String(error) });
} finally { // Always stop the automation stopCurrentAutomation(); }}
// Helper function for delaysfunction sleep(ms: number) { return new Promise(resolve => setTimeout(resolve, ms));}
// Start the automationmain();Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Ctrl/Cmd + S | Save current file |
Ctrl/Cmd + Space | Trigger autocomplete |
Ctrl/Cmd + / | Toggle line comment |
Ctrl/Cmd + F | Find in file |
TypeScript Compilation
When you save a .ts file, it's automatically compiled to JavaScript. The compiled .js file is what actually runs on the device.
Compilation Errors
If your TypeScript has errors, they'll be displayed when you save. Fix the errors and save again to update the compiled JavaScript.
ES6 Imports
Organize your code across multiple files using ES6 imports:
// Export enum from stages.tsexport enum Stage { Initialize = "Initialize", LaunchApp = "LaunchApp", ProcessData = "ProcessData", Complete = "Complete",}// Import in main.tsimport { Stage } from "./stages.js";
let currentStage = Stage.Initialize;
// Use the imported enumif (currentStage === Stage.Initialize) { // ...}Import Extension
Always use .js extension in imports, even when importing from .ts files. This is because the runtime executes the compiled JavaScript.