Phials developer documentation
User guide
AI Notice: Most documentation right now was auto-generated by an LLM. Handwritten documentation will be implemented over time on the road to 1.0

CommandContext

Runtime context passed to command handlers and predicates. Built from the active pane’s current state.

Signature

interface CommandContext {
    pane: PluginPaneContext;
    selectedFiles: FileEntry[];
    targetFile: FileEntry | null;
    currentPath: string;
    isVial: boolean;
    hasPropertySchema: boolean;
    isRecursiveVial: boolean;
    activeContextKeys: ReadonlySet<CommandContextKey>;
}

Members

NameTypeRequiredDescription
panePluginPaneContextyesThe active pane (always available)
selectedFilesFileEntry[]yesSelected files (empty if none)
targetFileFileEntry | nullyesThe “target” file (for context menu: right-clicked file; otherwise: first selected)
currentPathstringyesCurrent directory path
isVialbooleanyesWhether current directory is a vial
hasPropertySchemabooleanyesWhether the saved-views scope has a property schema (e.g. Boards).
isRecursiveVialbooleanyesActive vial uses recursive subtree indexing
activeContextKeysReadonlySet<CommandContextKey>yesActive context keys (for debugging/inspection)