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

# Ask the Advisor

> Ask an architecture question and get an answer grounded in your organization's decisions, with the decisions it drew on.

`actual advisor` puts an architecture question to the Advisor in Actual AI and prints its answer, followed by the related decisions it drew on, each with a confidence. The answer comes from your organization's ADRs, scoped to the repository you're working in, so you can trace each recommendation back to a decision your team made. The Advisor runs in your Actual AI account: it needs a sign-in and no local runner.

The [`actual` skill](https://docs.actual.ai/plugin/skills/actual) asks the Advisor only when you ask it to, for example "Ask the Actual advisor how we should handle database access in a new service."

## Prerequisites

* Sign in with `actual login`. `actual whoami` exits 2 when you aren't signed in. See [Sign in](https://docs.actual.ai/sign-in.md).
* Connect your repository at [app.actual.ai](https://app.actual.ai), so the Advisor can scope answers to it.

## Ask a question

```bash theme={null}
actual advisor "When should we introduce a message queue?"
```

The command starts an Advisor job and waits for the answer, which can take a few minutes. Progress, such as `advisor thinking…`, goes to standard error and the answer to standard output, so a script or an agent can capture the answer alone. The output is text; there's no JSON form.

For example, part of the output for a question about authentication, trimmed to one related decision:

```text theme={null}
advisor thinking…
## Relevant ADRs (5 found)

### ADR: Standardize External API Client Initialization with Explicit Credential Management for Applications

**Policy:** Applications must implement explicit credential management at external service boundaries with dependency injection of authenticated clients.

**Confidence:** High

_(4 more related ADRs returned)_
```

## Scope

By default the question is scoped to the repository you're standing in. The CLI matches the working tree's `origin` remote to one of your organization's connected repositories, and runs the question at the organization level when nothing matches, the match is ambiguous, or you aren't in a git repository.

`--repo` picks the scope and remembers it for later questions from the same working tree:

```bash theme={null}
actual advisor --repo actual-cli "How should this command report errors?"   # by name
actual advisor --repo owner/actual-cli "..."                                # owner/name, for a name shared across owners
actual advisor --repo <repository-uuid> "..."                               # by id
actual advisor --repo none                                                  # pin the organization level
actual advisor --repo auto                                                  # forget the pin, detect from origin again
actual advisor --show-scope                                                 # print the remembered scope and exit
```

`none` and `auto` are keywords. To scope to a repository literally named `none` or `auto`, pass its `owner/name` form or its id. An unrecognized name fails with the list of repositories you can choose from.

## Flags

| Flag | What it does |
| - | - |
| `<QUERY>` | The question. Optional when you only change or show the scope |
| `--repo <REPO>` | The connected repository to scope to, by name, `owner/name` or id; `none` pins the organization level and `auto` returns to detection from `origin` |
| `--show-scope` | Prints the remembered scope for this repository and exits without asking |
| `--org <ORG_ID>` | The organization to ask. Defaults to the one you signed in to. Without `--repo`, it runs one organization-level question and leaves the remembered scope as it was |
| `--api-url <URL>` | The Advisor API's base URL, for another deployment. Defaults to production; `ACTUAL_API_URL` sets it too |

## Failures and fixes

| Message or exit | Cause | Fix |
| - | - | - |
| `Not signed in to Actual AI`, exit 2 | No stored sign-in, or it couldn't be renewed | Run `actual login` |
| The browser never returns during `actual login` | An account in several organizations, with no `--org` | Run `actual login --org <ORG_ID>` |
| An unknown repository name | `--repo` names no connected repository | Pick one from the list it prints, or use `owner/name` or the id |

The CLI renews an expiring sign-in before each question, so a sign-in that's merely old needs nothing from you. [actual advisor](https://docs.actual.ai/cli/advisor.md) lists the command's help text.


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