Native CLI
This page documents the public legato native command group exposed by @ddgutierrezc/legato-capacitor through its package bin entry.
Command surface
Section titled “Command surface”legato native doctor [--json]legato native configure --dry-run [--json]legato native configure --apply [--json]native is the only command group implemented by this CLI surface.
Repository scope
Section titled “Repository scope”This CLI resolves the repository root by walking up from the current working directory until both of these paths exist:
packages/capacitorapps/capacitor-demo
If that layout is not found, commands fail with exit code 1.
legato native doctor
Section titled “legato native doctor”Runs repository checks and reports findings for:
apps/capacitor-demo/ios/App/App/Info.plist(UIBackgroundModesincludesaudio)packages/capacitor/android/src/main/AndroidManifest.xml(required foreground-service permissions and Legato playback service declaration)
Exit behavior
Section titled “Exit behavior”0: all findings areok1: at least one finding ismissingormisconfigured
Output
Section titled “Output”- Default output: human-readable report
--json: prints a JSON object withcommand,repoRoot,findings, andexitCode
legato native configure --dry-run
Section titled “legato native configure --dry-run”Builds a change plan from the same checks used by doctor, but does not write files.
Exit behavior
Section titled “Exit behavior”0: always returns success when mode is valid1: only for CLI misuse (for example, invalid mode selection)
Output
Section titled “Output”- Default output: planned changes marked as
SAFEorSKIP --json: printscommand,repoRoot,findings,plannedChanges,exitCode
legato native configure --apply
Section titled “legato native configure --apply”Applies safe planned changes only.
What it can mutate
Section titled “What it can mutate”Safe writes are restricted to this patch set:
apps/capacitor-demo/ios/App/App/Info.plistpackages/capacitor/android/src/main/AndroidManifest.xml
What it does not mutate
Section titled “What it does not mutate”- Paths outside the supported patch set
- Paths marked as Capacitor-generated artifacts (for example,
ios/App/CapApp-SPM/**) - Unsafe changes that require manual intervention
Exit behavior
Section titled “Exit behavior”0: no unsafe pending changes remain (including idempotent no-op skips)1: one or more planned changes were skipped for safety/manual reasons
Output
Section titled “Output”- Default output: plan plus applied/skipped counters
--json: printscommand,repoRoot,findings,applied,skipped,exitCode
Flags and argument rules
Section titled “Flags and argument rules”--json: supported bydoctor,configure --dry-run, andconfigure --applyconfigurerequires exactly one mode:--dry-runor--apply- Passing both mode flags, or neither, returns exit code
1
legato with no args, --help, unknown command groups, or unknown native subcommands prints usage and exits with 1.