Skip to content

Native CLI

This page documents the public legato native command group exposed by @ddgutierrezc/legato-capacitor through its package bin entry.

Terminal window
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.

This CLI resolves the repository root by walking up from the current working directory until both of these paths exist:

  • packages/capacitor
  • apps/capacitor-demo

If that layout is not found, commands fail with exit code 1.

Runs repository checks and reports findings for:

  • apps/capacitor-demo/ios/App/App/Info.plist (UIBackgroundModes includes audio)
  • packages/capacitor/android/src/main/AndroidManifest.xml (required foreground-service permissions and Legato playback service declaration)
  • 0: all findings are ok
  • 1: at least one finding is missing or misconfigured
  • Default output: human-readable report
  • --json: prints a JSON object with command, repoRoot, findings, and exitCode

Builds a change plan from the same checks used by doctor, but does not write files.

  • 0: always returns success when mode is valid
  • 1: only for CLI misuse (for example, invalid mode selection)
  • Default output: planned changes marked as SAFE or SKIP
  • --json: prints command, repoRoot, findings, plannedChanges, exitCode

Applies safe planned changes only.

Safe writes are restricted to this patch set:

  • apps/capacitor-demo/ios/App/App/Info.plist
  • packages/capacitor/android/src/main/AndroidManifest.xml
  • Paths outside the supported patch set
  • Paths marked as Capacitor-generated artifacts (for example, ios/App/CapApp-SPM/**)
  • Unsafe changes that require manual intervention
  • 0: no unsafe pending changes remain (including idempotent no-op skips)
  • 1: one or more planned changes were skipped for safety/manual reasons
  • Default output: plan plus applied/skipped counters
  • --json: prints command, repoRoot, findings, applied, skipped, exitCode
  • --json: supported by doctor, configure --dry-run, and configure --apply
  • configure requires exactly one mode: --dry-run or --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.