Skip to content

commands

Class info

Classes

Name Children Inherits
Command
aclientp.schema.v2.commands
A slash command the user invokes by including ``/name`` in a prompt.
    Skill
    aclientp.schema.v2.commands
    **UNSTABLE**: An Agent Skill the user invokes with a ``skill`` content block.
      TextCommandInput
      aclientp.schema.v2.commands
      All text typed after the command name (and the following whitespace) is the input.
        UnknownCommand
        aclientp.schema.v2.commands
        A custom or future command kind; ``type`` values starting with ``_`` are extensions.
          UnknownCommandInput
          aclientp.schema.v2.commands
          A custom or future input kind; ``type`` values starting with ``_`` are extensions.

            🛈 DocStrings

            v2 available commands: slash commands and skills the agent advertises.

            AvailableCommand module-attribute

            AvailableCommand = Annotated[
                Annotated[Command, Tag("command")]
                | Annotated[Skill, Tag("skill")]
                | Annotated[UnknownCommand, Tag(OTHER_TAG)],
                Discriminator(open_discriminator("type", frozenset({"command", "skill"}))),
            ]
            

            A command the agent advertises to the client.

            AvailableCommandInput module-attribute

            AvailableCommandInput = Annotated[
                Annotated[TextCommandInput, Tag("text")] | Annotated[UnknownCommandInput, Tag(OTHER_TAG)],
                Discriminator(open_discriminator("type", frozenset({"text"}))),
            ]
            

            How a command takes input.

            Command

            Bases: AnnotatedObject

            A slash command the user invokes by including /name in a prompt.

            Source code in src/aclientp/schema/v2/commands.py
            class Command(AnnotatedObject):
                """A slash command the user invokes by including ``/name`` in a prompt."""
            
                type: Literal["command"] = Field(default="command", init=False)
            
                name: str
                """Command name without the leading ``/``, e.g. ``create_plan``; no whitespace."""
            
                description: str
                """What the command does."""
            
                input: AvailableCommandInput | MISSING | None = MISSING
                """The command's input; omitted means it takes none."""
            

            description instance-attribute

            description: str
            

            What the command does.

            input class-attribute instance-attribute

            input: AvailableCommandInput | MISSING | None = MISSING
            

            The command's input; omitted means it takes none.

            name instance-attribute

            name: str
            

            Command name without the leading /, e.g. create_plan; no whitespace.

            Skill

            Bases: AnnotatedObject

            UNSTABLE: An Agent Skill the user invokes with a skill content block.

            Agents MUST only send skills to clients that advertise session.commands.skill.

            Source code in src/aclientp/schema/v2/commands.py
            class Skill(AnnotatedObject):
                """**UNSTABLE**: An Agent Skill the user invokes with a ``skill`` content block.
            
                Agents MUST only send skills to clients that advertise ``session.commands.skill``.
                """
            
                type: Literal["skill"] = Field(default="skill", init=False)
            
                name: str
                """Skill name, used in ``skill`` content blocks; no whitespace."""
            
                description: str
                """What the skill does, shown to users."""
            
                path: AbsolutePath | MISSING | None = MISSING
                """Absolute path of the file defining the skill (normally its ``SKILL.md``) on the
                agent's machine."""
            

            description instance-attribute

            description: str
            

            What the skill does, shown to users.

            name instance-attribute

            name: str
            

            Skill name, used in skill content blocks; no whitespace.

            path class-attribute instance-attribute

            path: AbsolutePath | MISSING | None = MISSING
            

            Absolute path of the file defining the skill (normally its SKILL.md) on the agent's machine.

            TextCommandInput

            Bases: AnnotatedObject

            All text typed after the command name (and the following whitespace) is the input.

            Source code in src/aclientp/schema/v2/commands.py
            class TextCommandInput(AnnotatedObject):
                """All text typed after the command name (and the following whitespace) is the input."""
            
                type: Literal["text"] = Field(default="text", init=False)
            
                hint: str
                """Hint to show while no input has been given."""
            

            hint instance-attribute

            hint: str
            

            Hint to show while no input has been given.

            UnknownCommand

            Bases: Unknown

            A custom or future command kind; type values starting with _ are extensions.

            Source code in src/aclientp/schema/v2/commands.py
            class UnknownCommand(Unknown):
                """A custom or future command kind; ``type`` values starting with ``_`` are extensions."""
            
                type: str
                """The command kind."""
            
                name: str
                """Command name."""
            
                description: str
                """What the command does."""
            

            description instance-attribute

            description: str
            

            What the command does.

            name instance-attribute

            name: str
            

            Command name.

            type instance-attribute

            type: str
            

            The command kind.

            UnknownCommandInput

            Bases: Unknown

            A custom or future input kind; type values starting with _ are extensions.

            Source code in src/aclientp/schema/v2/commands.py
            class UnknownCommandInput(Unknown):
                """A custom or future input kind; ``type`` values starting with ``_`` are extensions."""
            
                type: str
                """The input kind."""
            

            type instance-attribute

            type: str
            

            The input kind.