@minecraft/creator-tools
Version:
Minecraft Creator Tools command line and libraries.
49 lines (48 loc) • 1.98 kB
TypeScript
/**
* ToolCommands - Unified command system for Minecraft Creator Tools
*
* This module provides a unified way to register and invoke commands across:
* - CLI (via thin adapter)
* - MCP tools
* - In-game edit bar (SearchCommandEditor)
* - Serve mode interactive terminal
* - Server management UI
* - Home page command bar
*
* USAGE:
* ```typescript
* import { ToolCommandRegistry, initializeToolCommands } from "./toolcommands";
*
* // Initialize (registers all built-in commands)
* initializeToolCommands();
*
* // Execute a command
* const result = await ToolCommandRegistry.instance.execute("/help", context);
*
* // Get autocomplete suggestions
* const completions = await ToolCommandRegistry.instance.getCompletions("/cr", 3, context);
* ```
*/
export type { IToolCommand, IToolCommandMetadata, IToolCommandResult } from "./IToolCommand";
export { ToolCommandBase, ToolCommandScope } from "./IToolCommand";
export type { IToolCommandArgument, IToolCommandFlag, AutocompleteProvider } from "./IToolCommandArgument";
export type { IToolCommandContext, IToolCommandOutput, IToolCommandSession } from "./IToolCommandContext";
export { ToolCommandContextFactory } from "./IToolCommandContext";
export { ToolCommandRegistry } from "./ToolCommandRegistry";
export { ToolCommandParser } from "./ToolCommandParser";
export type { ParsedToolCommand } from "./ToolCommandParser";
export * from "./AutocompleteProviders";
export * from "./commands";
/**
* Initialize the ToolCommand system by registering all built-in commands.
* Safe to call multiple times (only initializes once).
*
* NOTE: This registers only platform-safe commands. For Node.js-only commands
* (e.g., ServerCommand), call registerNodeOnlyCommands() from
* "./registerNodeCommands" in your Node.js entry point.
*/
export declare function initializeToolCommands(): void;
/**
* Check if ToolCommands have been initialized.
*/
export declare function isToolCommandsInitialized(): boolean;