{"id":18270,"library":"deco-cli","title":"Deco CLI","description":"Deco CLI v0.29.0 is the command-line interface for managing AI-native projects on decocms.com. It supports authentication, project scaffolding, local development with live preview via deco link, type generation, and deployment to Cloudflare Workers. The package is distributed as an npm package requiring Node.js >=24.0.0. It uses ESM-only exports and ships TypeScript declarations. Unlike generic CMS CLIs, it is tailored for the Deco platform with built-in MCP (Model Context Protocol) integration and self-hostable hosting features.","status":"active","version":"0.29.0","language":"javascript","source_language":"en","source_url":"https://github.com/decocms/studio","tags":["javascript","cli","deco","chat","deployment","development","mcp","model-context-protocol","hosting","typescript"],"install":[{"cmd":"npm install deco-cli","lang":"bash","label":"npm"},{"cmd":"yarn add deco-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add deco-cli","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only since v0.29.0; no CommonJS support.","wrong":"const deco = require('deco-cli')","symbol":"default","correct":"import deco from 'deco-cli'"},{"note":"Named export for programmatic CLI execution.","wrong":"import run from 'deco-cli/run'","symbol":"run","correct":"import { run } from 'deco-cli'"},{"note":"Commands are available in subpaths starting from v0.29.0.","wrong":"import { login } from 'deco-cli'","symbol":"login","correct":"import { login } from 'deco-cli/commands'"}],"quickstart":{"code":"import { run } from 'deco-cli';\nimport { login } from 'deco-cli/commands';\n\n// Authenticate with a token\nprocess.env.DECO_CHAT_API_TOKEN = 'your-token-here';\nawait login();\n\n// Or run the CLI programmatically\nawait run(['deploy', '-w', 'my-workspace'], {\n  cwd: process.cwd(),\n  stdio: 'inherit'\n});","lang":"typescript","description":"Demonstrates programmatic authentication and running the deploy command using the deco-cli API."},"warnings":[{"fix":"Use import syntax and update Node.js to >=24.0.0.","message":"ESM-only: This package requires Node.js >=24.0.0 and does not support CommonJS require().","severity":"breaking","affected_versions":">=0.29.0"},{"fix":"Import commands from their respective subpaths, e.g., import { deploy } from 'deco-cli/commands'.","message":"Commands are in subpaths: The main export only provides the CLI runner; individual commands must be imported from specific paths like 'deco-cli/commands'.","severity":"gotcha","affected_versions":">=0.29.0"},{"fix":"Use npm run dev instead for a stable development experience.","message":"The 'deco dev' command is experimental and may change or be removed in future versions.","severity":"deprecated","affected_versions":">=0.29.0"},{"fix":"Set process.env.DECO_CHAT_API_TOKEN if you need to override the stored token.","message":"Authentication token must be set via environment variable DECO_CHAT_API_TOKEN; the login command also stores it locally but the env var takes precedence.","severity":"gotcha","affected_versions":">=0.29.0"},{"fix":"Update Node.js to the latest LTS or version 24+.","message":"Node.js version requirement: Node.js >=24.0.0 is strictly enforced; older versions will produce import errors.","severity":"breaking","affected_versions":">=0.29.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use import syntax: import deco from 'deco-cli'","cause":"Using require('deco-cli') in a CommonJS file.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module from CommonJS not supported."},{"fix":"Install version >=0.29.0 and use correct subpath imports.","cause":"The import path is incorrect or the version does not have commands in subpaths.","error":"Error: Cannot find module 'deco-cli/commands'"},{"fix":"Use import { login } from 'deco-cli/commands'","cause":"Importing login directly from 'deco-cli' instead of 'deco-cli/commands'.","error":"Error: login is not a function"},{"fix":"Upgrade Node.js to version >=24.0.0.","cause":"Node.js version is below 24.0.0.","error":"Error: The engine 'node' is incompatible with this module."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}