Docs · API reference · Verso.Abstractions

IMagicCommand Interface#

Defines a magic command that can be invoked with a prefix such as %time or #!who. Magic commands provide lightweight, inline directives that extend kernel functionality without requiring a full extension UI.

public interface IMagicCommand : Verso.Abstractions.IExtension

Implements IExtension

Properties#

Description Property#

Short description of what the command does, displayed in help listings. This shadows Description to provide command-specific help text.

string Description { get; }

Implements Description

Property Value#

System.String

Name Property#

The command name used to invoke this magic (e.g. "time", "who"). This shadows Name to provide the invocable command name.

string Name { get; }

Implements Name

Property Value#

System.String

Parameters Property#

Definitions of the parameters this command accepts, used for parsing and help generation.

System.Collections.Generic.IReadOnlyList<Verso.Abstractions.ParameterDefinition> Parameters { get; }

Property Value#

System.Collections.Generic.IReadOnlyList<ParameterDefinition>

Methods#

ExecuteAsync(string, IMagicCommandContext) Method#

Executes the magic command with the provided argument string.

System.Threading.Tasks.Task ExecuteAsync(string arguments, Verso.Abstractions.IMagicCommandContext context);

Parameters#

arguments System.String

Raw argument text following the command name.

context IMagicCommandContext

Context providing access to the kernel, outputs, and notebook state.

Returns#

System.Threading.Tasks.Task
A task that completes when the command has finished executing.