init_project
Creates and sets up new projects using Starwind UI, allowing specification of package managers like npm, yarn, or pnpm for streamlined development.
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 core handler function for the 'init_project' tool. It constructs an initialization command based on the specified package manager (npm, yarn, pnpm) and returns structured instructions including the command to run.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-30 (schema)The input schema definition for the 'init_project' tool, specifying the optional packageManager parameter with allowed values.inputSchema: { type: "object", properties: { packageManager: { type: "string", description: "Package manager to use (npm, yarn, pnpm)", enum: ["npm", "yarn", "pnpm"], }, }, required: [],
- src/tools/index.ts:37-38 (registration)Registration of the initProjectTool into the tools Map, making it available to the MCP server.// Register init project tool tools.set(initProjectTool.name, initProjectTool);
- 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[]; }