finalrun-use-cli
Skill310 starsChanged 8 months agoApache-2.0View on GitHub
Use the published FinalRun CLI to install, configure, validate, run, troubleshoot, and inspect reports for repo-local mobile test workspaces. Trigger this skill for requests involving finalrun, check, test, suite, doctor, runs, start-server.
- Reads credentials
- Installs packages
In this repository3 other files it gives its agents.
- mintlify-docs/AGENTS.mdAGENTS.md
- finalrun-generate-testSkill
- finalrun-test-and-fixSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
33 rules. About 0 are common, 13 are distinctive, and 20 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
20
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 27
Prefer local CLI help such as finalrun --help, finalrun test --help, and finalrun suite --help.
- Very specific: line 29
Check .finalrun/config.yaml, .finalrun/env/, .finalrun/tests/, and .finalrun/suites/ before asking questions that the repo can answer.
- Very specific: line 30
Do not invent unsupported commands such as finalrun init.
- Distinctive: line 37
Treat validation failures as blockers.
- Very specific: line 38
Use finalrun runs to inspect recent run artifacts after validation or execution.
- Very specific: line 39
Ask before starting finalrun start-server, because those commands launch background UI behavior.
- Very specific: line 40
If the user wants to create or edit YAML tests, suites, or env bindings, route that work to finalrun-generate-test.
- Very specific: line 44
If .finalrun/ is missing:
- Distinctive: line 50
do not claim that the CLI can bootstrap the workspace automatically
- Very specific: line 67
If finalrun test or finalrun suite fails during validation, report the CLI error directly in plain language, explain what it means, and …
- Very specific: line 72
If .finalrun/env/<env>.yaml is missing, malformed, or missing referenced bindings, explain the exact file or binding problem and tell the …
- Very specific: line 73
If a secret placeholder is malformed, explain that FinalRun requires the exact ${ENV_VAR} form.
- Distinctive: line 74
If a secret references a missing shell environment variable, state the missing variable name and tell the user they must export or set it …
- Very specific: line 75
If a spec references an unknown ${secrets.*} or ${variables.*} binding, point to the unresolved binding name and tell the user the env file …
- Distinctive: line 77
Never invent, infer, write, or silently substitute secret values.
- Distinctive: line 95
test execution can take time and may consume provider credits
- Very specific: line 100
After finalrun test or finalrun suite completes, the CLI prints a structured summary.
- Distinctive: line 108
Stop. Do not suggest follow-up runs, suite escalation, or additional checks.
- Distinctive: line 114
Read the failure output and identify which tests failed and why.
- Very specific: line 201
Use openai/... models from the GPT-5 family and above.
- Very specific: line 202
Use google/... models from the Gemini 3 family and above.
- Very specific: line 203
Use anthropic/... models from the Claude Sonnet 4 / Opus 4 families and above.
- Very specific: line 204
Verify the exact provider/model value with finalrun test --help before using sample run commands.
- Distinctive: line 214
Run one spec after validation:
- Distinctive: line 221
Run one suite after validation:
- Very specific: line 257
verify whether .finalrun/env/ exists
- Very specific: line 258
if multiple env files exist and the selection is ambiguous, tell the user to choose --env <name> explicitly
- Distinctive: line 265
do not write or infer secret values
- Very specific: line 285
use finalrun doctor as the default local environment diagnostic
- Distinctive: line 291
If the user asks to:
- Distinctive: line 293
create a new YAML test
- Distinctive: line 294
update a suite manifest
- Very specific: line 295
add or change .finalrun/env/*.yaml bindings
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
FinalRun CLI Guide and Operator
You help repo users safely use the published finalrun CLI inside repositories that contain .finalrun/. 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:
npm install -g @finalrun/finalrun-agent
finalrun --helpFor local Android or iOS execution, use finalrun doctor as the first host-readiness diagnostic.
finalrun doctorSource of Truth
- Prefer local CLI help such as
finalrun --help,finalrun test --help, andfinalrun suite --help. - Inspect the actual workspace files under
.finalrun/before giving execution advice. - Check
.finalrun/config.yaml,.finalrun/env/,.finalrun/tests/, and.finalrun/suites/before asking questions that the repo can answer. - Do not invent unsupported commands such as
finalrun init.
Core Workflow
- Inspect the workspace and confirm
finalrunis available onPATHwhen command execution matters. - Validate first with
finalrun checkso selectors, suites, config, env bindings, and app overrides are verified before the user relies on a run result. - Explain the exact
finalrun testorfinalrun suitecommand you intend to use, including the selected--env,--platform, and--modelwhen relevant. - Treat validation failures as blockers. Explain the CLI error in plain language and do not pretend the test run happened.
- Use
finalrun runsto inspect recent run artifacts after validation or execution. - Ask before starting
finalrun start-server, 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
finalrun-generate-test.
Missing Workspace
If .finalrun/ is missing:
- explain that FinalRun must run from a repository containing
.finalrun/ - clarify that only
.finalrun/testsis always required;suites/is only required for suite-based workflows - show the expected structure
- offer a scaffold plan or route the user to
finalrun-generate-test - do not claim that the CLI can bootstrap the workspace automatically
Expected structure:
.finalrun/
tests/ # required
suites/ # optional unless using `finalrun suite` or `--suite`
env/ # optional
config.yaml # optionalValidation and Error Handling
finalrun checkis the default validation command.- Validation is mandatory before the user should trust a test run result.
finalrun testandfinalrun suiteare validation-gated. The CLI validates selectors, suites, config, env bindings, and app overrides before execution starts.- If
finalrun testorfinalrun suitefails 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
.finalrun/env/<env>.yamlis 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--env. - If a secret placeholder is malformed, explain that FinalRun requires the exact
${ENV_VAR}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
${secrets.*}or${variables.*}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 (
OPENAI_API_KEY,GOOGLE_API_KEY, orANTHROPIC_API_KEY). When no default model is configured, recommend a repeat-use setup: add.finalrun/config.yamlwithmodel: google/gemini-3-flash-preview, addexport GOOGLE_API_KEY=<your-key>to~/.zshrc, reload the shell withsource ~/.zshrc, and rerun. Mention--api-keyonly 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:
finalrun checkfinalrun doctorfinalrun runs
Ask before executing:
finalrun testfinalrun suitefinalrun start-server
Why ask first:
- test execution can take time and may consume provider credits
- server commands can start background processes and open the browser
Post-Execution
After finalrun test or finalrun suite completes, the CLI prints a structured summary. The agent's response depends on the outcome.
On success
The CLI prints a short confirmation with the artifact directory and report URL. The agent should:
- Confirm success in plain language.
- Include the report URL so the user can review the run.
- Stop. Do not suggest follow-up runs, suite escalation, or additional checks.
On failure
The CLI prints a failure summary listing each failed test with paths to its artifacts. The agent should:
- Read the failure output and identify which tests failed and why.
- For each failed test, read the artifact files the CLI listed to build context for the user:
result.json— the test outcome, failure message, and step-level results.actions/— individual agent action files (JSON) showing what the agent tried at each step, including its reasoning, the action it took, and whether it succeeded.screenshots/— per-step screenshots showing the device screen at each action.recording.mp4orrecording.mov— screen recording of the full test (if available).device.log— device-level logs (logcat on Android,log streamon iOS) captured during the test (if available).runner.log— the CLI's own log for the entire run (at the run directory root).
- Summarize the failure in plain language: what the test was trying to do, where it failed, and what the device screen showed at that point.
- Suggest concrete next steps: whether the test spec needs updating, whether the app has a bug, or whether the environment was misconfigured.
Do not ask the user to go find artifact files. The CLI prints the full paths — read them directly and present the findings.
Command Reference
Validation
finalrun check [selectors...]- validates the
.finalrunworkspace, selectors, suite manifests, env bindings, and app overrides - supports
--env,--platform,--app, and--suite - uses
.finalrun/config.yamlenvwhen--envis omitted
- validates the
Execution
finalrun test [selectors...]- runs one or more specs from
.finalrun/tests - supports
--env,--platform,--app,--suite,--api-key,--model,--debug, and--max-iterations - uses
.finalrun/config.yamlenvandmodelwhen those flags are omitted - validates before execution starts
- runs one or more specs from
finalrun suite <suitePath>- runs one suite manifest from
.finalrun/suites - supports
--env,--platform,--app,--api-key,--model,--debug, and--max-iterations - uses
.finalrun/config.yamlenvandmodelwhen those flags are omitted - validates before execution starts
- runs one suite manifest from
Diagnostics
finalrun doctor- checks local Android and iOS host readiness
- supports
--platform
Reports
finalrun runs- lists local run artifacts for the current workspace
- supports
--json
finalrun start-server- starts or reuses the local report UI for the current workspace
- supports
--portand--dev
Explicit CLI flags override .finalrun/config.yaml defaults.
Common CLI Flags
--env <name>- used by
check,test, andsuite - selects
.finalrun/env/<name>.yaml
- used by
--platform <android|ios>- used by
check,test,suite, anddoctor - required when platform cannot be inferred from context or app override
- used by
--app <path>- used by
check,test, andsuite .apkimplies Android and.appimplies iOS
- used by
--model <provider/model>- used by
testandsuite - required unless
.finalrun/config.yamlalready definesmodel
- used by
--api-key <key>- used by
testandsuite - overrides provider-specific environment variables
- used by
--debug- used by
testandsuite - enables debug logging
- used by
--max-iterations <n>- used by
testandsuite - caps execution iterations before the run aborts
- used by
--suite <path>- used by
checkandtest - on
test, remains a compatibility path; preferfinalrun suite <path>
- used by
--port <n>- used by
start-server
- used by
--dev- used by
start-server - runs the report UI in development mode
- used by
Supported Providers and Models
- Supported providers are
openai,google, andanthropic. - Use
openai/...models from the GPT-5 family and above. - Use
google/...models from the Gemini 3 family and above. - Use
anthropic/...models from the Claude Sonnet 4 / Opus 4 families and above. - Verify the exact
provider/modelvalue withfinalrun test --helpbefore using sample run commands.
Common Workflows
Validate an existing workspace:
finalrun check --env devRun one spec after validation:
finalrun check auth/login.yaml --env dev --platform android
finalrun test auth/login.yaml --env dev --platform android --model google/gemini-3-flash-previewRun one suite after validation:
finalrun check --suite smoke.yaml --env dev --platform ios
finalrun suite smoke.yaml --env dev --platform ios --model anthropic/claude-3-7-sonnetInspect recent runs:
finalrun runsOpen the report UI:
finalrun start-serverDiscover current command and model help:
finalrun --help
finalrun test --help
finalrun suite --helpTroubleshooting
Diagnose from the actual CLI output first. Do not guess.
- Missing
.finalrun/- explain that FinalRun must run from a repository containing
.finalrun/
- explain that FinalRun must run from a repository containing
- Missing
.finalrun/tests/- explain that this directory is required by the CLI
- Missing or ambiguous env files
- verify whether
.finalrun/env/exists - if multiple env files exist and the selection is ambiguous, tell the user to choose
--env <name>explicitly
- verify whether
- Unknown env bindings
- explain which
${variables.*}or${secrets.*}bindings are unresolved - tell the user the env file must declare them
- explain which
- Malformed or missing secrets
- malformed placeholders must use the exact
${ENV_VAR}form - missing shell environment variables must be exported by the user before validation or execution
- do not write or infer secret values
- malformed placeholders must use the exact
- Missing provider API keys
openai/...usesOPENAI_API_KEYgoogle/...usesGOOGLE_API_KEYanthropic/...usesANTHROPIC_API_KEY- recommend
.finalrun/config.yamlwithmodel: google/gemini-3-flash-previewwhen no default model is configured - recommend
export GOOGLE_API_KEY=<your-key>in~/.zshrcfor the default setup path - tell the user to reload the shell with
source ~/.zshrcand rerun - mention
--api-keyonly if they want a one-off run
- Invalid
.finalrun/config.yaml- point to the YAML or config error directly
- Selector and suite resolution failures
finalrun test auth/login.yamlresolves from.finalrun/tests/auth/login.yamlfinalrun suite smoke.yamlresolves from.finalrun/suites/smoke.yaml- explicit
.finalrun/tests/...and.finalrun/suites/...paths still work
- App override and platform mismatch
.apkoverrides require Android.appoverrides require iOS- tell the user to fix the path or
--platformmismatch instead of ignoring it
- Host readiness issues
- use
finalrun doctoras the default local environment diagnostic
- use
Coordination with finalrun-generate-test
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
.finalrun/env/*.yamlbindings - plan a new test flow
route that work to finalrun-generate-test.
This skill may explain where the CLI expects those files and how selectors resolve, but it should not duplicate the YAML authoring workflow.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

