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

Section Navigation

  • Extension
  • Repo
  • Command
  • Example
  • Option
  • Interview
  • Question
  • Consent
  • Invocation
  • Console
  • CliError
  • non_empty
  • when
  • run
  • Result
  • make_root
  • assert_conformant
  • FakeGitHub
  • FakeGit
  • FakeClone
  • PullRequest
  • isolate
  • API reference
  • Consent

Consent#

class graftkit.Consent[source]#

Bases: FrozenModel

A confirmation a command may need before it acts.

Declared on the command’s Interview so --describe 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 --describe.

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.