!
prefix to execute bash commands directly within Ona Agent conversations. This provides immediate command execution and automatically adds the output to the conversation context, making it a powerful tool for sharing specific information with the agent.

Running bash commands with ! prefix in Ona Agent
How bash commands work
When you type!
followed by a command in the chat interface, Ona Agent executes the command immediately and includes both the command and its output in the conversation context.
Basic syntax
Common use cases
Quick information gathering
Get immediate context without asking the agent to run commands:Sharing specific output
Provide exact command output for the agent to analyze:Environment verification
Confirm your environment state before asking for help:File system exploration
Share directory structure or file contents:Benefits of using ! commands
Immediate execution
- Commands run instantly without agent interpretation
- No waiting for the agent to understand and execute
- Direct access to your environment state
Shared context
- Command output becomes part of conversation history
- Agent can reference the exact output in responses
- Ensures agent and user see the same information
Efficiency
- Faster than asking the agent to run commands
- Reduces back-and-forth communication
- Provides precise, unfiltered output
Verification
- Confirm environment state before making changes
- Share exact error messages for troubleshooting
- Validate assumptions with real data
Best practices
Use for context sharing
Perfect for providing specific information to the agent:Combine with questions
Share command output then ask for analysis:Verify before changes
Check current state before asking for modifications:Share configuration
Provide exact configuration for troubleshooting:Command execution details
Working directory
- Commands execute in your current environment’s working directory
- Use
!pwd
to confirm your location
Environment variables
- Commands have access to your environment variables
- Use
!env
to see available variables - Environment-specific tools and configurations are available
Output handling
- Both stdout and stderr are captured
- Long output is included in full
- Binary output is handled appropriately
Security considerations
- Commands run with your user permissions
- Be cautious with destructive commands
- Output is visible in the conversation history
Examples in practice
Debugging a failing test
Troubleshooting
Command not found
If a command isn’t recognized:- Verify the command exists with
!which commandname
- Check your PATH with
!echo $PATH
- Ensure required tools are installed in your environment
Long-running commands
For commands that take time to complete:- The interface will wait for completion
- press ESC or click stop if you need to cancel
Comparison with agent commands
When to use ! commands
- Quick information gathering
- Sharing exact output for analysis
- Verifying environment state
- Providing specific context
When to ask the agent
- Complex multi-step operations
- Code generation and modification
- Analysis and interpretation of results
- Planning and decision-making tasks
Next steps
- Try using
!pwd
and!ls
to explore your environment - Combine ! commands with questions for better context
- Learn about AGENTS.md for project-specific instructions
- Explore slash commands for organization-wide prompts