Overview
The terminal commands capability gives your Utari workers the power to execute shell commands, install packages, run scripts, and interact with the command line interface in your workspace. This powerful tool enables workers to perform technical tasks like setting up environments, running builds, executing scripts, and managing processes.Terminal Command Capabilities
Your workers can execute four types of terminal operations:Execute Command
Check Command Output
List Commands
Terminate Command
Execute Command
The core capability for running shell commands with two execution modes:Blocking Mode (Synchronous)
When to Use:- Quick commands that complete in seconds
- Package installations
- File operations (copy, move, delete)
- Build processes
- Script execution that completes quickly
- Any command where you need immediate results
Non-Blocking Mode (Asynchronous)
When to Use:- Long-running processes
- Development servers
- Watch processes
- Background jobs
- Continuous monitoring tasks
- Any command that runs indefinitely
Command Execution Examples
Installing Dependencies
- Node.js/NPM
- Python/Pip
- System Packages
Running Scripts
File and Directory Operations
Check Command Output
Monitor non-blocking commands running in background sessions.Execute Non-Blocking Command
Get Session Information
Check Output
Monitor Periodically
Example Workflow
List Commands
View all active tmux sessions to see what’s currently running. Use Cases:- Check which background processes are active
- Identify session IDs for monitoring
- Verify servers are still running
- Audit workspace processes
- Troubleshoot command execution
Terminate Command
Stop running commands by killing their tmux sessions.Identify Session
Terminate Session
Verify Termination
Choosing Execution Mode
Use Blocking Mode (blocking=true) For:
Quick Operations
Package Installation
File Operations
Build Processes
Script Execution
System Commands
Use Non-Blocking Mode (blocking=false) For:
Servers
Watch Processes
Long-Running Jobs
Monitoring
Background Tasks
Interactive Programs
Common Workflows
Setting Up a Development Environment
Update System
Install Dependencies
Install Project Packages
Start Development Server
Verify Server
Running Tests and Builds
Install Test Dependencies
Run Tests
Build Project
Verify Build Output
Managing Long-Running Processes
Start Background Process
Monitor Progress
List All Processes
Terminate When Complete
Best Practices
Choose Right Mode
Monitor Non-Blocking
Clean Up Sessions
Handle Errors
Use Full Paths
Test Commands First
Include Flags
Document Sessions
Troubleshooting
Command fails with permission error
Command fails with permission error
- Using
sudoif appropriate (apt-get, system operations) - Checking file/directory permissions with
ls -la - Ensuring you’re in the correct directory
- Verifying the command syntax is correct
Package installation fails
Package installation fails
- Always include
--break-system-packagesflag - Try updating pip:
pip install --upgrade pip --break-system-packages - Check internet connectivity
- Clear cache:
npm cache clean --force - Delete node_modules and reinstall
- Check package.json for syntax errors
Can't check output of blocking command
Can't check output of blocking command
- Blocking commands return output directly
- They automatically clean up sessions
- Don’t use check_command_output for them
- The output is in the execute_command response
Non-blocking command not running
Non-blocking command not running
- Use list_commands to see active sessions
- Check output with check_command_output
- Look for errors in the command syntax
- Ensure required dependencies are installed
- Try running in blocking mode first to debug
Session appears stuck
Session appears stuck
- Check output to see if it’s waiting for input
- Verify the command is appropriate for non-blocking
- Terminate and restart if necessary
- Check for errors in the command output
Command works locally but fails in Utari
Command works locally but fails in Utari
- Environment differences (paths, installed packages)
- Missing dependencies
- Different shell or system configuration
- Required system packages not installed