Skip to content

Latest commit

 

History

History
115 lines (71 loc) · 2.15 KB

File metadata and controls

115 lines (71 loc) · 2.15 KB

Cocos CLI Commands

This directory contains all command implementations for Cocos CLI.

Available Commands

cocos create

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 (2d or 3d, default: 3d)

Examples:

cocos create --project /path/to/MyGame --type 3d
cocos create --project ./My2dGame --type 2d

cocos build

Build 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-mobile

cocos start-mcp-server

Start 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 3000

cocos wizard

Start interactive wizard

Usage:

cocos wizard

Description: 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 wizard

Global Options

All 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)