> ## Documentation Index
> Fetch the complete documentation index at: https://ona.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Bash commands

> Run bash commands in sessions using the ! prefix

Prefix any command with `!` to run it immediately and share the output with Ona Agent. The output becomes part of the session context, so the agent can reference it in responses.

```
!git status
!npm test
!cat src/config.js
```

<img src="https://mintcdn.com/gitpod-13c83c2b/0kMlxVRjY7ip7wfk/images/bash-commands.png?fit=max&auto=format&n=0kMlxVRjY7ip7wfk&q=85&s=39c38654f3949bf20fc6255eb5f635cb" alt="Terminal showing bash commands executed with the ! prefix, displaying command output inline in the session" width="1438" height="560" data-path="images/bash-commands.png" />

## What happens when you use `!`

`!` is the fastest way to bring shell output into the conversation without asking the agent to decide which command to run.

When you run a command this way:

* the output becomes part of the chat context for the current session
* the command result is shown directly in the session
* you can immediately ask follow-up questions about the result

## When to use ! commands

Use `!` when you want to share specific output with the agent:

* **Share errors for debugging**: `!npm test` then ask "why is this failing?"
* **Provide context**: `!cat package.json` before asking about dependencies
* **Verify state**: `!git branch` before asking about branching strategy

For complex multi-step operations, code changes, or open-ended analysis, ask the agent directly and let it run commands as needed.

## Good fits vs bad fits

Good fits:

* a single diagnostic command
* a one-off log or file dump
* a test run whose output you want the agent to interpret

Less good fits:

* long investigative workflows
* commands that mutate the repo in ways you want the agent to manage
* repeated shell sequences better handled by the agent itself or by an Automation

## Tips

* Use short, targeted commands so the output stays readable in chat.
* Prefer `!git status` or `!pytest -q` over huge recursive dumps.
* If the output is noisy, run a narrower command and ask a more specific follow-up question.
