Command#
- class graftkit.Command[source]#
Bases:
FrozenModelOne command.
- Attributes:
- namestr
The command’s name on the command line.
- helpstr
One-line help.
- optionstuple[Option, …]
Plain options and positionals.
- interviewInterview
Questions and consents. A command with any gets
--yes.- runCallable[[Invocation], None] | None
What the command does;
Nonefor a group of subcommands.- subcommandstuple[Command, …]
Nested commands.
- examplestuple[Example, …]
Command lines that run the command, checked when the app is built.
- annotationsdict[str, str]
Free-form metadata for the app built on the kit, such as whether an assistant may run the command. The kit stores it and includes it in
--describe, but never interprets it; namespace keys by the app, e.g.{"myapp.agent": "hand-off"}.interactiveboolWhether the command has questions or consents.
Methods
document(command_line)Return what
--describeprints: everything needed to run the command.- document(command_line: str) dict[str, Any][source]#
Return what
--describeprints: everything needed to run the command.- Parameters:
- command_linestr
How the command is invoked, e.g.
mytool deploy.
- Returns:
- dict[str, Any]
The document: the command’s help, examples, options and annotations; for a command that asks, also its questions and consents with the procedure an assistant follows.