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

# Ask MeshAgent from the CLI

> Send direct prompts through MeshAgent from the terminal without starting a room agent.

`meshagent ask` is the direct terminal prompt path for MeshAgent.

Use it when you want to:

* ask one question through the active MeshAgent project
* get a streamed terminal answer without starting a room agent
* open a lightweight interactive terminal UI

`meshagent ask` uses the hosted [MeshAgent LLM Proxy](./llm_proxy) path directly for the active project. It does not require `meshagent llm proxy` to be running.

If you want Codex or Claude configured for normal use, use [Use Codex and Claude with MeshAgent](./use_codex_claude). If you want another local SDK or tool to talk through MeshAgent, use [Local CLI Proxy](./local_cli_proxy).

## Get started

If you have not set up MeshAgent yet, start with:

```bash bash theme={null}
meshagent setup
```

`meshagent ask` uses:

* the active MeshAgent project
* either a MeshAgent token in `MESHAGENT_TOKEN` or a logged-in CLI session from `meshagent auth login`

<Tip>
  If `meshagent ask` cannot find a MeshAgent token or logged-in CLI session, run `meshagent setup` first, then retry.
</Tip>

## One-shot prompt

```bash bash theme={null}
meshagent ask --message "Summarize the differences between queue channels and messaging channels."
```

You can also choose the output format:

```bash bash theme={null}
meshagent ask \
  --message "Write release notes for this diff." \
  --format markdown
```

And override the model for the request:

```bash bash theme={null}
meshagent ask \
  --message "Explain this API at a beginner level." \
  --model gpt-5.4
```

## Interactive terminal UI

Run `meshagent ask` with no `--message` in a TTY to open the interactive prompt UI:

```bash bash theme={null}
meshagent ask
```

This is useful when you want a quick back-and-forth in the terminal but do not need a persistent room agent.

## When to use `meshagent ask` vs `meshagent process`

Use `meshagent ask` when:

* you want direct terminal prompting
* you do not need a room-connected agent identity
* you do not need chat, queue, mail, or toolkit channels

Use `meshagent process` when:

* the agent should stay available in a room
* the agent should accept chat, queue, mail, or toolkit work
* the workflow needs persisted room and thread behavior

## Related docs

* [Use Codex and Claude with MeshAgent](./use_codex_claude)
* [Local CLI Proxy](./local_cli_proxy)
* [MeshAgent LLM Proxy](./llm_proxy)
* [Process Agents](../process/overview)
