init_project
Initialize a new project with Starwind UI components using your preferred package manager to start building interfaces quickly.
Instructions
Initializes a new project with Starwind UI
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| packageManager | No | Package manager to use (npm, yarn, pnpm) |
Implementation Reference
- src/tools/init_project_tool.ts:32-59 (handler)The main handler function for the 'init_project' tool. It determines the package manager, constructs the appropriate 'starwind init' command using npx/yarn dlx/pnpm dlx, and returns an object with the command, timestamp, and instructions.handler: async (args: InitProjectArgs = {}) => { const packageManager = args.packageManager || "npx"; // Build the init command based on the package manager let initCommand: string; switch (packageManager) { case "npm": initCommand = "npx starwind@latest init --defaults"; break; case "yarn": initCommand = "yarn dlx starwind@latest init --defaults"; break; case "pnpm": initCommand = "pnpm dlx starwind@latest init --defaults"; break; default: initCommand = "npx starwind@latest init --defaults"; } return { packageManager, command: initCommand, timestamp: new Date().toISOString(), instructions: "Run this command in your project directory to initialize Starwind UI", note: "This will create or modify files in your project directory. Make sure to review the changes and have a clean git working tree before running.", }; },
- src/tools/init_project_tool.ts:21-31 (schema)Input schema definition for the 'init_project' tool, validating the optional 'packageManager' argument with enum values.inputSchema: { type: "object", properties: { packageManager: { type: "string", description: "Package manager to use (npm, yarn, pnpm)", enum: ["npm", "yarn", "pnpm"], }, }, required: [], },
- src/tools/init_project_tool.ts:8-13 (schema)TypeScript interface defining the arguments for the init_project handler, used for type safety.export interface InitProjectArgs { /** Package manager to use (npm, yarn, pnpm) */ packageManager?: "npm" | "yarn" | "pnpm"; /** Additional options for initialization */ options?: string[]; }
- src/tools/index.ts:37-38 (registration)Registers the initProjectTool in the central 'tools' Map by name, making it available for MCP server handling.// Register init project tool tools.set(initProjectTool.name, initProjectTool);
- src/config/settings.ts:35-35 (registration)Lists 'init_project' as an enabled tool in the configuration settings."init_project",