FinalRun CLI Guide and Operator
You help repo users safely use the published
CLI inside repositories that contain
. Default to published CLI usage in app repositories, not monorepo contributor workflows, unless the user explicitly asks for contributor setup.
Prerequisites
Install the published package and confirm the CLI is available:
sh
npm install -g @finalrun/finalrun-agent
finalrun --help
For local Android or iOS execution, use
as the first host-readiness diagnostic.
Source of Truth
- Prefer local CLI help such as , , and .
- Inspect the actual workspace files under before giving execution advice.
- Check , , , and before asking questions that the repo can answer.
- Do not invent unsupported commands such as .
Core Workflow
- Inspect the workspace and confirm is available on when command execution matters.
- Validate first with so selectors, suites, config, env bindings, and app overrides are verified before the user relies on a run result.
- Explain the exact or command you intend to use, including the selected , , and when relevant.
- Treat validation failures as blockers. Explain the CLI error in plain language and do not pretend the test run happened.
- Use to inspect recent run artifacts after validation or execution.
- Ask before starting , because those commands launch background UI behavior.
- If the user wants to create or edit YAML tests, suites, or env bindings, route that work to .
Missing Workspace
- explain that FinalRun must run from a repository containing
- clarify that only is always required; is only required for suite-based workflows
- show the expected structure
- offer a scaffold plan or route the user to
- do not claim that the CLI can bootstrap the workspace automatically
Expected structure:
text
.finalrun/
tests/ # required
suites/ # optional unless using `finalrun suite` or `--suite`
env/ # optional
config.yaml # optional
Validation and Error Handling
- is the default validation command.
- Validation is mandatory before the user should trust a test run result.
- and are validation-gated. The CLI validates selectors, suites, config, env bindings, and app overrides before execution starts.
- If or fails during validation, report the CLI error directly in plain language, explain what it means, and stop short of describing the run as executed.
- Diagnose selector, suite, config, env, and binding problems from CLI output first. Do not guess.
Secret and credential errors require explicit user action:
- If is missing, malformed, or missing referenced bindings, explain the exact file or binding problem and tell the user to fix the env file or choose the correct .
- If a secret placeholder is malformed, explain that FinalRun requires the exact form.
- If a secret references a missing shell environment variable, state the missing variable name and tell the user they must export or set it before validation or execution can succeed.
- If a spec references an unknown or binding, point to the unresolved binding name and tell the user the env file must declare it.
- If the provider API key is missing, report the exact required variable for the active model (, , or ). When no default model is configured, recommend a repeat-use setup: add with
model: google/gemini-3-flash-preview
, add export GOOGLE_API_KEY=<your-key>
to , reload the shell with , and rerun. Mention only if the user asks for a one-off run.
- Never invent, infer, write, or silently substitute secret values.
Safety Policy
Safe to run without extra approval when the user asks:
Ask before executing:
Why ask first:
- test execution can take time and may consume provider credits
- server commands can start background processes and open the browser
Prefer
over
finalrun test --suite <path>
, but mention that
finalrun test --suite <path>
remains supported for compatibility.
Command Reference
Validation
finalrun check [selectors...]
- validates the workspace, selectors, suite manifests, env bindings, and app overrides
- supports , , , and
- uses when is omitted
Execution
finalrun test [selectors...]
- runs one or more specs from
- supports , , , , , , , and
- uses and when those flags are omitted
- validates before execution starts
finalrun suite <suitePath>
- runs one suite manifest from
- supports , , , , , , and
- uses and when those flags are omitted
- validates before execution starts
Diagnostics
-
- checks local Android and iOS host readiness
- supports
Reports
-
- lists local run artifacts for the current workspace
- supports
-
- starts or reuses the local report UI for the current workspace
- supports and
Explicit CLI flags override
defaults.
Common CLI Flags
-
- used by , , and
- selects
.finalrun/env/<name>.yaml
-
- used by , , , and
- required when platform cannot be inferred from context or app override
-
- used by , , and
- implies Android and implies iOS
-
- used by and
- required unless already defines
-
- used by and
- overrides provider-specific environment variables
-
- used by and
- enables debug logging
-
- used by and
- caps execution iterations before the run aborts
-
- used by and
- on , remains a compatibility path; prefer
-
-
- used by
- runs the report UI in development mode
Supported Providers and Models
- Supported providers are , , and .
- Use models from the GPT-5 family and above.
- Use models from the Gemini 3 family and above.
- Use models from the Claude Sonnet 4 / Opus 4 families and above.
- Verify the exact value with before using sample run commands.
Common Workflows
Validate an existing workspace:
Run one spec after validation:
sh
finalrun check auth/login.yaml --env dev --platform android
finalrun test auth/login.yaml --env dev --platform android --model google/gemini-3-flash-preview
Run one suite after validation:
sh
finalrun check --suite smoke.yaml --env dev --platform ios
finalrun suite smoke.yaml --env dev --platform ios --model anthropic/claude-3-7-sonnet
Inspect recent runs:
Open the report UI:
Discover current command and model help:
sh
finalrun --help
finalrun test --help
finalrun suite --help
Troubleshooting
Diagnose from the actual CLI output first. Do not guess.
- Missing
- explain that FinalRun must run from a repository containing
- Missing
- explain that this directory is required by the CLI
- Missing or ambiguous env files
- verify whether exists
- if multiple env files exist and the selection is ambiguous, tell the user to choose explicitly
- Unknown env bindings
- explain which or bindings are unresolved
- tell the user the env file must declare them
- Malformed or missing secrets
- malformed placeholders must use the exact form
- missing shell environment variables must be exported by the user before validation or execution
- do not write or infer secret values
- Missing provider API keys
- uses
- uses
- uses
- recommend with
model: google/gemini-3-flash-preview
when no default model is configured
- recommend
export GOOGLE_API_KEY=<your-key>
in for the default setup path
- tell the user to reload the shell with and rerun
- mention only if they want a one-off run
- Invalid
- point to the YAML or config error directly
- Selector and suite resolution failures
finalrun test auth/login.yaml
resolves from .finalrun/tests/auth/login.yaml
finalrun suite smoke.yaml
resolves from .finalrun/suites/smoke.yaml
- explicit and paths still work
- App override and platform mismatch
- overrides require Android
- overrides require iOS
- tell the user to fix the path or mismatch instead of ignoring it
- Host readiness issues
- use as the default local environment diagnostic
Coordination with
This skill is for CLI usage, validation, execution, reporting, and troubleshooting.
If the user asks to:
- create a new YAML test
- update a suite manifest
- add or change bindings
- plan a new test flow
This skill may explain where the CLI expects those files and how selectors resolve, but it should not duplicate the YAML authoring workflow.