Skip to content

cocos/cocos-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c51ae77 ยท Feb 11, 2026

History

403 Commits
Jan 8, 2026
Nov 24, 2025
Oct 10, 2025
Jan 9, 2026
Feb 4, 2026
Dec 20, 2025
Jan 5, 2026
Feb 11, 2026
Jan 4, 2026
Feb 9, 2026
Feb 5, 2026
Sep 8, 2025
Dec 3, 2025
Oct 23, 2025
Sep 15, 2025
Jan 5, 2026
Nov 17, 2025
Dec 29, 2025
Jan 9, 2026
Oct 24, 2025
Oct 29, 2025
Feb 11, 2026
Feb 11, 2026
Jan 10, 2026
Feb 11, 2026
Nov 26, 2025

Repository files navigation

๐ŸŽฎ COCOS CLI

Node.js Cocos Engine License

cli logo

๐Ÿš€ A powerful command-line interface tool for Cocos Engine development

โœจ Features

  • ๐Ÿ—๏ธ Project Management: Create, import, and build Cocos projects
  • ๐Ÿ“ฆ Resource Management: Import/export resources, batch processing
  • โšก Build System: Multi-platform build support
  • ๐ŸŽจ Interactive Interface: Wizard-guided operations

๐Ÿ“‹ Prerequisites

  • Node.js 22.17.0
  • Git
  • Visual Studio with C++ build tools (for Windows)
  • Xcode (for macOS)

For native development, please refer to the Native Development Setup Guide for detailed setup instructions.

๐Ÿ› ๏ธ Installation

  1. Clone the repository

    git clone <repository-url>
    cd cocos-cli
  2. Install dependencies

    npm install -g node-gyp
    npm run init
    npm install
  3. Build and link globally

    npm run build
    npm link

๐Ÿš€ Quick Start

See Quick Start Guide for detailed usage steps.

๐Ÿ“š Commands

# Create project
cocos create --project ./my-project

# Build project
cocos build --project ./my-project --platform web-mobile

# Import project
cocos import --project ./my-project

# Show project information
cocos info --project ./my-project

# Start MCP server
cocos start-mcp-server --project ./my-project --port 9527

# Interactive wizard
cocos wizard

# Display help
cocos --help

For detailed command documentation, see Commands Documentation.

๐Ÿงช Testing

Unit Tests

# Run all unit tests (core)
npm test

# Run only core tests
npm run test:core

# Run tests in watch mode
npm run test:watch

# Run tests with coverage report
npm run test:coverage

E2E Tests

# Run E2E tests
npm run test:e2e

# Run E2E tests in debug mode (preserves test projects)
npm run test:e2e:debug

# Check E2E test coverage
npm run check:e2e-coverage

# Generate E2E coverage HTML report
npm run check:e2e-coverage:report

Run All Tests

# Run all tests (unit + E2E)
npm run test:all

For more testing details, see:

๐Ÿ“– Documentation

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide to get started.

The guide covers:

  • Development workflow and building the project
  • Running and writing tests
  • Code style and formatting
  • Debugging techniques
  • Submitting pull requests

๐Ÿ“„ License

MIT License - see the LICENSE file for details.