CLI · eject
cem eject
Eject your project from the create-express-modular CLI dependency, inlining raw standalone scripts directly into package.json for 100% autonomy.
bash
cem ejectcem eject gives you complete ownership of your project scripts. It inspects your chosen ORM, package manager, and build configuration, replaces all cem <command> scripts with direct node/tsx/tsc equivalents, and unlinks the CLI dependency.
What changes in package.json
Before ejecting, scripts delegate to the CEM binary:
json
// Before ejection
{
"scripts": {
"start:dev": "cem dev",
"build": "cem build",
"start": "cem start",
"check": "cem check",
"fix": "cem fix"
}
}After running cem eject, standalone tooling commands are inlined directly:
json
// After ejection
{
"scripts": {
"start:dev": "tsx watch src/server.ts",
"build": "tsc -p tsconfig.json",
"start": "node dist/server.js",
"check": "tsc --noEmit && eslint src && prettier --check src",
"fix": "eslint src --fix && prettier --write src",
"lint": "eslint src",
"format": "prettier --write src"
}
}Why eject?
| Advantage | Details |
|---|---|
| Zero CLI dependency | Your CI and deployment containers no longer need create-express-modular installed globally or locally. |
| Custom toolchains | Easily substitute tsx with SWC, esbuild, Rolldown, or custom bundling pipelines without CLI interference. |
| Standard npm scripts | Developers familiar with standard Express codebases can run standard scripts without learning any CLI syntax. |
| Preserved architecture | All modular code, folders, and cem-cli.json metadata remain intact, so your project structure stays pristine. |
Can I still use cem subcommands?
Yes! If you have create-express-modular installed globally, you can still use generator commands like cem add module <Name>, cem add env <KEY>, or cem list. Ejecting only decouples your project's runtime and build scripts from the CLI.