review-local command#

The local review command is available either as a script:

review-local README.md

or through the package entrypoint:

python -m moa review-local README.md

Synopsis:

    usage: python -m moa review-local [-h] [--token TOKEN] [--save]
                                      [--copilot-review] [--model MODEL]
                                      [--prompt PROMPT] [-v]
                                      file [file ...]
    
    Reviews local files and prints markdown.
    
    positional arguments:
      file              Local files to review
    
    options:
      -h, --help        show this help message and exit
      --token TOKEN     GitHub personal access token. Resolution order: flag >
                        GITHUB_TOKEN env var > cached value
                        (/home/runner/.config/moa/review_pr.json) >
                        unauthenticated.
      --save            Save the resolved --token to
                        /home/runner/.config/moa/review_pr.json so it is used
                        automatically in future invocations. The file is created
                        with owner-only read permissions (0600).
      --copilot-review  Use GitHub Copilot (via GitHub Models API) to generate an
                        AI review. Requires a GitHub token with models access.
      --model MODEL     AI model used for --copilot-review. When omitted, Copilot
                        chooses the model automatically and falls back to
                        openai/gpt-4.1 if needed. Any model available on the
                        GitHub Models API is accepted.
      --prompt PROMPT   Add a follow-up prompt to the Copilot review session. The
                        prompt is sent as a continuation of the same conversation
                        so the model has full context from the initial review. Can
                        be used multiple times to ask several follow-up questions.
                        Only meaningful when --copilot-review is also set.
      -v, --verbose     Print progress information to stderr.

Examples:

review-local README.md
review-local --copilot-review --token "$GITHUB_TOKEN" moa/commands/review_pr.py
python -m moa review-local README.md

The command prints a # Local Files Review markdown report containing the provided files and, if requested, a ## Copilot Review section. It reuses the same token cache file as review-pr (~/.config/moa/review_pr.json) and supports --save to persist the resolved token. Use -v or --verbose to print progress information to standard error while the command runs, including which token source/type is used.

review-local supports the same --copilot-review, --model, and --prompt flags as review-pr. Use --prompt one or more times to ask follow-up questions as part of the same Copilot conversation session:

review-local --copilot-review --token "$GITHUB_TOKEN" \
    --prompt "Highlight any security concerns." \
    moa/commands/review_pr.py