Skip to main content
Ctrl+K
Northbridge Capital Northbridge Capital
  • API reference
  • Requirements
  • Design
  • Changelog
  • Contributing
  • GitHub
  • PyPI
  • API reference
  • Requirements
  • Design
  • Changelog
  • Contributing
  • GitHub
  • PyPI

Section Navigation

  • App
  • Command
  • Option
  • Invocation
  • Interview
  • Question
  • Condition
  • CustomKind
  • when
  • Consent
  • Interaction
  • Console
  • non_empty
  • whole_number
  • byte_size
  • parse_kv
  • CliError
  • DeclarationError
  • API reference
  • Consent

Consent#

class cli_interview_kit.Consent[source]#

Bases: FrozenModel

A confirmation a command may need before it acts.

Declared on the command’s Interview so --questions lists it: an assistant describes it to the user first and passes --yes only once they agree.

Attributes:
keystr

Stable identifier.

whenstr

When the command asks for it and what it allows, for --questions.

safe_defaultbool | None

The answer when nobody can be asked and --yes was not given, and the prompt’s default. None means only --yes or a person can give it.

Methods

ask(console, interaction, message)

Return whether the run has this consent.

ask(console: Console, interaction: Interaction, message: str) → bool[source]#

Return whether the run has this consent.

Parameters:
consoleConsole

Where to ask.

interactionInteraction

The run’s interaction.

messagestr

The question to ask, saying exactly what will happen.

Returns:
bool

Whether the run has this consent.

Raises:
DeclarationError

The running command does not declare this consent.

CliError

Nobody can be asked, --yes was not given, and the consent has no safe default.

On this page
  • Consent
    • Consent.ask()
Show Source

© Copyright 2026, Northbridge Capital.

Created using Sphinx 9.2.0.

Built with the PyData Sphinx Theme 0.24.0.