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

> ## Agent Instructions
> Melso product MCP: https://melso.ai/api/mcp (OAuth; one company per grant). REST: https://melso.ai. Documentation-search MCP: https://docs.melso.ai/mcp. The docs search server does not act on customer accounts.
>
> Use the live tool schema and respect company membership. Ask the person to authorize the exact fiscal document version in the signed-in app. A professional prepares and files included returns after authorization; AI does not file alone. A prepared file or approval receipt is not evidence of filing. Never claim completion from an accepted Task or Run. Keep credentials out of chat and logs. Agents features are internal or by private invitation.

# Tasks from the terminal

> Choose a company, create a Task, read its result and send a follow-up.

<Info>Melso Agents is available only internally or by private invitation. Agents-specific features require existing access. For the autónomo fiscal service, see [Get started](/essentials/quickstart).</Info>

## Choose a company

After [installing the CLI](/cli/install), sign in and list the companies you can access:

```bash theme={null}
melso login
melso workspace list
```

Use the UUID of your invited Agents company to select it, then make a read:

```bash theme={null}
melso workspace switch YOUR_COMPANY_UUID
melso task list
```

The CLI calls companies `workspace`. Selection follows this order: `--workspace-id`, then `MELSO_WORKSPACE_ID`, then the profile default saved by `workspace switch`. Clear a previous environment override or flag if you intend to use the profile default.

## Create work

Confirm that the harness and [execution funding](/concepts/provider-accounts) are available to your account before starting a Run:

```bash theme={null}
melso task create --title "Review the draft" --prompt "Check the draft for missing sections." --harness codex --output json
```

The returned Task `id` is the identifier to keep. To save an idle Task instead, use `melso task create --title "Review the draft"` without a prompt.

```bash theme={null}
export TASK_ID='TASK_UUID_FROM_CREATE_RESPONSE'
melso task get "$TASK_ID"
melso task runs "$TASK_ID" --output json
```

A Task can have several Runs. Follow successor attempts after retries or pauses; the first attempt's failure does not always mean the Task has stopped. [Runs](/concepts/runs) explains the states and newest-first ordering.

## Read the result

Once an outcome Run completes, read the stored Task messages:

```bash theme={null}
melso task message list "$TASK_ID" --output json --compact=false --limit 100
```

Read the assistant reply whose `run_id` matches the completed Run. The JSON output is a message array; if there are older pages, the CLI prints the next `--before-created-at` and `--before-id` values to standard error. Supply both to continue. Stored replies have output redaction applied; review the content before treating the work as delivered.

For the execution transcript, copy the Run's actual `id` from `task runs`:

```bash theme={null}
export RUN_ID='RUN_UUID_FROM_TASK_RUNS'
melso run messages "$RUN_ID" --output json
```

## Send a follow-up

With the human login used above, this command posts a message and requests another turn of work:

```bash theme={null}
melso task message create "$TASK_ID" --content "List the three most important missing sections." --output json
melso task runs "$TASK_ID" --output json
```

Follow the new Run and read its stored reply using the commands above. A message receipt alone does not establish completion. A completed Task can reopen on a human follow-up; an explicitly cancelled Task remains read-only.

For longer or private document text, save a UTF-8 file in your current directory and use `melso task message create "$TASK_ID" --content-file ./follow-up.txt`. Standard input is also supported with `--content-stdin`. Keep credentials out of Task text and private documents out of terminal history.

## Resume paused work

Resume takes the **Task ID**, even though it is under `run`:

```bash theme={null}
melso run resume "$TASK_ID"
melso task runs "$TASK_ID" --output json
```

Use it only for a paused Task. After resuming, observe its Runs again because the successor can have a different ID. Use `melso task --help` and `melso run --help` for other controls.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.