yera.cli.context

CLI application context passed to every command.

Symbols

class AppContext — Container passed to every CLI command as ``ctx``.

AppContext

Container passed to every CLI command as ctx.

settings is always populated (may be None when validation failed and the command tolerates it).

credential_store and active_credential_group are only populated when the command declares @requires(AppResource.SECRET_STORE); accessing them without that declaration raises :class:RuntimeError.

Methods

require_active_credential_group — Return the resolved active credential group or raise ``CredentialGroupNotSpecifiedError``.
set_secret_store — Populate the protected secret-store boundary.
set_provider_data — Populate provider config.
set_profile_data — Set the profile data in context.
set_models_universe — Set the model data in context.
set_secret_store_data — Populate the protected store and active credential group atomically.

AppContext.require_active_credential_group

require_active_credential_group() → ResolvedCredentialGroup

Return the resolved active credential group or raise CredentialGroupNotSpecifiedError.

AppContext.set_secret_store

set_secret_store(
    secret_store: CredentialStoreBackend,
) → None

Populate the protected secret-store boundary.

Parameters

secret_store
type: CredentialStoreBackend

Backend used for opaque credential values.

AppContext.set_provider_data

set_provider_data(
    providers: Providers,
) → None

Populate provider config.

AppContext.set_profile_data

set_profile_data(
    profiles: Profiles | None,
) → None

Set the profile data in context.

AppContext.set_models_universe

set_models_universe(
    models: ModelsUniverse | None,
) → None

Set the model data in context.

AppContext.set_secret_store_data

set_secret_store_data(
    secret_store: CredentialStoreBackend,
    active_credential_group: ResolvedCredentialGroup | None,
) → None

Populate the protected store and active credential group atomically.

Parameters

secret_store
type: CredentialStoreBackend

Backend used for credential groups and opaque values.

active_credential_group
type: ResolvedCredentialGroup | None

Group selected by the current project.