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

# Session

> Create, manage, and chat with AI task sessions

`mulerun session` manages AI task sessions on the MuleRun platform — the
same sessions you would otherwise drive from the web UI, but scriptable.

This page is a quick overview. Detailed per-subcommand pages are coming
soon.

## At a glance

```bash theme={null}
mulerun session run    --prompt "Build a todo app"        # create + chat in one shot
mulerun session create --name "API design" --ttl 3600     # create only
mulerun session list   --limit 10 --status idle           # browse
mulerun session get    <session-id>                       # details
mulerun session prompt <session-id> "Add a delete button" # multi-turn
mulerun session events <session-id> --limit 100           # event log
mulerun session publish <session-id>                      # publish preview
mulerun session delete <session-id>                       # cleanup
```

Attach local files to any prompt with `-f`:

```bash theme={null}
mulerun session run --prompt "Analyze this data" -f data.csv
mulerun session prompt <session-id> "Compare these" -f a.pdf -f b.pdf
```

## Common subcommands

| Command               | What it does                                                 |
| --------------------- | ------------------------------------------------------------ |
| `session create`      | Create a new session (no prompt).                            |
| `session run`         | Create a session and stream the first prompt.                |
| `session list`        | List sessions (filter by status, paginate).                  |
| `session get`         | Show session details.                                        |
| `session prompt`      | Send a follow-up prompt (positional `<text>`).               |
| `session chat`        | Send a follow-up prompt (`--prompt` flag, file attachments). |
| `session cancel`      | Cancel the in-flight operation.                              |
| `session status`      | View / update session status.                                |
| `session events`      | Tail the event log.                                          |
| `session publish`     | Publish a preview URL.                                       |
| `session renew`       | Renew the sandbox timeout.                                   |
| `session restart-acp` | Restart the ACP subprocess.                                  |
| `session question`    | Respond to a Human-in-the-Loop question.                     |
| `session share`       | Generate a shareable link.                                   |
| `session delete`      | Delete the session.                                          |

## Streaming

Long-running prompts stream their output to stdout as the agent works.
Status messages go to stderr; press `Ctrl+C` to cancel cleanly (the CLI
sends an explicit `session/cancel` over the WebSocket).

For machine consumption use `-o json` or `-o jsonl`.

## Tips

* `session run` is the fastest way from zero to a streaming response.
* Once a session exists, prefer `session prompt` (positional text) for
  shell-friendly one-liners and `session chat` (`--prompt`) when you also
  need to attach files.
* Combine with [`mulerun page`](/cli/commands/page) to publish the output
  of a session as a deployed page.
