Phials plugin documentation
User guide
AI Disclosure: This page was generated by an LLM and may contain inaccuracies. Hand-crafted documentation will be implemented over time on the road to 1.0

CommandContext

Since Plugin API: 1.0.0

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;
    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).
activeContextKeysReadonlySet<CommandContextKey>yesActive context keys (for debugging/inspection)