ConfigsJul 25, 2026·3 min read

Chameleon (CML) — Cross-Platform Development Framework by Didi

A write-once, run-anywhere framework by Didi that compiles a single codebase to Web, WeChat Mini-Program, Alipay Mini-Program, Baidu Smart App, and native platforms.

Agent ready

Ready-to-run agent install

This asset can be installed after the agent chooses its runtime, checks the plan, and runs the matching command.

Native · 98/100Policy: allow
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
Chameleon Overview
Direct install command
npx -y tokrepo@latest install eeedaf3c-87e3-11f1-9bc6-00163e2b0d79 --target codex

Run after dry-run confirms the install plan.

Introduction

Chameleon, abbreviated CML, is a cross-platform development framework created by Didi Chuxing. It enables developers to write application logic once using a unified MVVM syntax and compile it to multiple target platforms including Web, WeChat Mini-Program, Alipay Mini-Program, Baidu Smart App, and native apps via a polymorphic protocol.

What Chameleon Does

  • Compiles a single codebase to Web, WeChat, Alipay, Baidu, and QQ mini-programs
  • Provides a unified component model with platform-specific polymorphic interfaces
  • Includes a cross-platform API library covering network, storage, navigation, and device features
  • Supports a polymorphic protocol allowing platform-specific code when needed
  • Offers a CLI tool for scaffolding, development, and multi-target builds

Architecture Overview

Chameleon uses a compile-time approach: source files written in CML syntax (a superset of Vue-like templates) are parsed and transformed into platform-specific output. The polymorphic protocol lets developers define interface contracts and provide platform-specific implementations, ensuring that unique platform capabilities remain accessible. The runtime layer normalizes lifecycle hooks, event handling, and data binding across targets. The build pipeline uses Webpack internally and outputs platform-native project structures.

Self-Hosting & Configuration

  • Install the chameleon-tool CLI globally via npm
  • Initialize a project with cml init project and select target platforms
  • Configure target-specific settings in the project configuration file
  • Use cml dev for live development with hot reload on the selected platform
  • Build for production with cml build which outputs deployable artifacts for each target

Key Features

  • True multi-platform compilation from a single codebase to 6+ target runtimes
  • Polymorphic protocol for clean separation of cross-platform and platform-specific code
  • Rich built-in component library with consistent behavior across platforms
  • Comprehensive API library (chameleon-api) for network, storage, location, and animation
  • Mature CLI toolchain with scaffolding, dev server, and production build support

Comparison with Similar Tools

  • Taro — compiles React/Vue code to mini-programs and native apps; Chameleon uses its own CML syntax with a stronger emphasis on polymorphic platform abstraction
  • uni-app — Vue-based cross-platform framework with wide platform coverage; Chameleon provides a more explicit polymorphic interface system
  • React Native — targets iOS and Android with native rendering; Chameleon prioritizes web and mini-program targets over native mobile
  • Flutter — uses Dart and its own rendering engine for pixel-perfect cross-platform UI; Chameleon outputs platform-native code for each target

FAQ

Q: What syntax does Chameleon use for templates? A: CML uses a Vue-like template syntax with custom directives. Developers familiar with Vue will find the learning curve minimal.

Q: Can I use platform-specific features? A: Yes. The polymorphic protocol lets you define an interface and provide separate implementations per platform, so you can access native APIs without polluting the shared codebase.

Q: Which mini-program platforms does Chameleon support? A: WeChat, Alipay, Baidu, QQ, and Toutiao mini-programs are all supported as build targets.

Q: Is Chameleon suitable for new projects in 2025? A: Chameleon is best suited for teams that need broad mini-program coverage. Evaluate it alongside Taro and uni-app based on your target platform mix and preferred component model.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets