# summary

Verify the Cuneiform For Salesforce app version required by this CLI build, and (optionally) the version installed in a target org.

# description

Reports the Cuneiform For Salesforce managed-package version this CLI release was tested against. Without `--target-org`, the command is a local-only readout — no Salesforce API calls, no authentication required.

When `--target-org` is supplied, the command queries the org for the installed Cuneiform For Salesforce package via the Tooling API and reports one of five states:

- `installed-match` — installed version satisfies the requirement (exit 0)
- `installed-newer` — installed version is newer than required (exit 0, advisory)
- `installed-version-unknown` — Cuneiform is detected via namespace but the version is not exposed (typical for source-pushed scratch orgs — CLI-1569). Compatibility cannot be verified, but the package is present (exit 0, advisory)
- `installed-older` — installed version is older than required (exit 1)
- `not-installed` — Cuneiform For Salesforce is not installed in this org (exit 1)

Use this command to:

- Confirm a scratch org or sandbox is ready for CLI operations after a fresh package install
- Diagnose CLI errors that look like data-shape mismatches but are version-compatibility issues
- Pin CLI/app version pairs in CI before running profiling jobs

# examples

- Print the required app version (no auth, no API calls):

  <%= config.bin %> <%= command.id %>

- Verify the installed version in a target org:

  <%= config.bin %> <%= command.id %> --target-org myOrg

- Machine-readable output for CI:

  <%= config.bin %> <%= command.id %> --target-org myOrg --json

# flags.target-org.summary

Target org username or alias. When supplied, the command queries the org's installed Cuneiform For Salesforce version and reports compatibility.

# flags.api-version.summary

API version to use when querying the target org. Defaults to the org's maximum supported version.

# state.installed-match

✓ Installed version matches the required version. Compatible.

# state.installed-newer

✓ Installed version is newer than required. Likely compatible — newer org-side features may not be exposed by this CLI build.

# state.installed-version-unknown

⚠ Cuneiform For Salesforce is present in this org (detected via namespace) but the package version is not exposed by the standard API. This is typical for source-pushed scratch orgs. Compatibility cannot be verified against the requirement — proceed at your own risk.

# state.installed-older

✗ Installed version is older than required. CLI commands that depend on newer app features will fail. Upgrade Cuneiform For Salesforce in this org to at least the required version.

# state.not-installed

✗ Cuneiform For Salesforce is not installed in this org. Install the managed package before running CLI commands.

# errors.manifestInvalid

This CLI build's `package.json` is missing the `cuneiform.requiredAppVersion` field. This is a build-time configuration error — please file an issue on the salesforce-cli repository.

# errors.orgQueryFailed

Failed to query the installed package version from the target org: %s
