This directory contains all command implementations for Cocos CLI.
Create a new Cocos project
Usage:
cocos create --project <target-path> [options]Required Parameters:
--project <path>- Target project directory (will be created at this path)
Optional Parameters:
-t, --type <type>- Project type (2dor3d, default:3d)
Examples:
cocos create --project /path/to/MyGame --type 3d
cocos create --project ./My2dGame --type 2dBuild Cocos project
Usage:
cocos build --project <project-path> [options]Required Parameters:
--project <path>- Cocos project path
Optional Parameters:
-p, --platform <platform>- Target platform (web-desktop, web-mobile, android, ios, etc.)--config <path>- Specify configuration file path--log-dest <path>- Specify log file path--skip-check- Skip option validation--stage <stage>- Build stage (compile, bundle, etc.)
Examples:
cocos build --project /path/to/project --platform web-mobileStart MCP (Model Context Protocol) server
Usage:
cocos start-mcp-server --project <project-path> [options]Required Parameters:
--project <path>- Cocos project path
Optional Parameters:
-p, --port <number>- MCP server port number (default: 3000)
Examples:
cocos start-mcp-server --project /path/to/project --port 3000Start interactive wizard
Usage:
cocos wizardDescription: Start interactive wizard to guide you through project setup and operations. Provides a friendly user interface to perform various CLI operations.
Features:
- 🏗️ Build project wizard
- 🚀 Start MCP server wizard
- ❓ Help information viewer
Examples:
cocos wizardAll commands support the following global options:
--config <path>- Specify configuration file path--debug- Enable debug mode--no-interactive- Disable interactive mode (for CI, interactive mode enabled by default)