# `CliSubprocessCore.ProviderCLI`
[🔗](https://github.com/nshkrdotcom/cli_subprocess_core/blob/v0.1.0/lib/cli_subprocess_core/provider_cli.ex#L1)

Shared provider-specific CLI resolution policies for the core runtime.

Built-in provider profiles should resolve their launch program through this
module instead of duplicating discovery logic in downstream adapters.

# `resolve_opt`

```elixir
@type resolve_opt() ::
  {:allow_js_entrypoint, boolean()}
  | {:default_command, String.t()}
  | {:display_name, String.t()}
  | {:env_var, String.t() | nil}
  | {:execution_surface,
     ExternalRuntimeTransport.ExecutionSurface.t() | map() | keyword() | nil}
  | {:extra_keys, [atom()]}
  | {:install_hint, String.t() | nil}
  | {:known_locations, [String.t()]}
  | {:known_locations_first?, boolean()}
  | {:node_command, String.t()}
  | {:npm_global_bin, String.t() | nil}
  | {:npx_command, String.t() | nil}
  | {:npx_disable_env, String.t() | nil}
  | {:npx_package, String.t() | nil}
  | {:path_candidates, [String.t()]}
  | {:resolution_cwd, String.t() | nil}
```

# `runtime_failure_opt`

```elixir
@type runtime_failure_opt() ::
  {:command, String.t() | nil}
  | {:cwd, String.t() | nil}
  | {:execution_surface,
     ExternalRuntimeTransport.ExecutionSurface.t() | map() | keyword() | nil}
  | {:stderr, String.t() | nil}
```

# `resolve`

```elixir
@spec resolve(atom(), keyword(), [resolve_opt()]) ::
  {:ok, CliSubprocessCore.CommandSpec.t()}
  | {:error, CliSubprocessCore.ProviderCLI.Error.t()}
```

# `resolve!`

```elixir
@spec resolve!(atom(), keyword(), [resolve_opt()]) ::
  CliSubprocessCore.CommandSpec.t()
```

# `runtime_failure`

```elixir
@spec runtime_failure(atom(), term(), [runtime_failure_opt()]) ::
  CliSubprocessCore.ProviderCLI.ErrorRuntimeFailure.t()
```

Classifies a provider runtime failure after launch selection has already
completed.

This covers both local transport errors (for example `{:command_not_found,
"gemini"}`) and remote execution failures that only become visible after the
provider command is invoked over an execution surface such as SSH.

# `runtime_failure_code`

```elixir
@spec runtime_failure_code(CliSubprocessCore.ProviderCLI.ErrorRuntimeFailure.t()) ::
  String.t()
```

Maps a classified runtime failure to the stable public error code used across
the shared provider/runtime stack.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
