{"id":18415,"library":"heroku","title":"Heroku CLI","description":"v11.3.0 — official command-line interface for managing Heroku applications and services. Built with oclif and Node.js, it supports app deployment, scaling, monitoring, Postgres databases, CI/CD pipelines, add-ons, SSL certificates, domains, team collaboration, Private Spaces, logs, and a plugin ecosystem. v11 is a major rewrite: ESM-only (converted from CJS), oclif v4, single package (monorepo removed), new color system (ansis replaces chalk), Node >=20 required. Ships TypeScript types. Active development with frequent releases.","status":"active","version":"11.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/heroku/cli","tags":["javascript","heroku","heroku-cli-plugin","typescript"],"install":[{"cmd":"npm install heroku","lang":"bash","label":"npm"},{"cmd":"yarn add heroku","lang":"bash","label":"yarn"},{"cmd":"pnpm add heroku","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"legacy utilities, partially replaced in v11","package":"heroku-cli-util","optional":true}],"imports":[{"note":"Default import works for ESM. CLI is primarily used via command line, not programmatic imports.","symbol":"heroku","correct":"import heroku from 'heroku'"},{"note":"ESM-only since v11; require() will throw ERR_REQUIRE_ESM.","wrong":"const Heroku = require('heroku')","symbol":"Heroku","correct":"import { Heroku } from 'heroku'"},{"note":"Class for building CLI plugins. Requires oclif v4 compatibility.","symbol":"Command","correct":"import { Command } from 'heroku'"}],"quickstart":{"code":"// Install globally: npm install -g heroku\n// Or use without install: npx heroku\n\nimport { Command } from 'heroku';\n\nclass MyCommand extends Command {\n  static description = 'my custom command';\n  static flags = {};\n\n  async run() {\n    const {args, flags} = await this.parse(MyCommand);\n    this.log('Hello from custom command!');\n  }\n}\n\nexport default MyCommand;\n\n// Run: heroku my-command","lang":"typescript","description":"Shows how to create a custom CLI command plugin using the Heroku CLI v11 ESM API."},"warnings":[{"fix":"Replace require('heroku') with import heroku from 'heroku'. If dynamic import needed, use import('heroku').","message":"v11 converts entire codebase to ESM. require() no longer works. Use import or dynamic import().","severity":"breaking","affected_versions":">=11.0.0"},{"fix":"Install only 'heroku' package. Remove separate @heroku-cli/* dependencies.","message":"v11 removes monorepo structure. All packages consolidated into single npm package 'heroku'. No sub-packages like @heroku-cli/plugin-* are separate.","severity":"breaking","affected_versions":">=11.0.0"},{"fix":"Update plugins to use oclif v4 API. See oclif migration guide.","message":"v11 upgrades to oclif v4. Plugin API changes: command lifecycle, hooks, and config are different.","severity":"breaking","affected_versions":">=11.0.0"},{"fix":"Replace chalk imports with ansis. See ansis documentation for API changes.","message":"v11 replaces chalk with ansis for color output. Custom color themes may break.","severity":"breaking","affected_versions":">=11.0.0"},{"fix":"Upgrade Node.js to version 20+.","message":"v11 drops Node.js <20 support. Minimum engine is 'node': '>=20'.","severity":"breaking","affected_versions":">=11.0.0"},{"fix":"Use alternative commands: heroku data:maintenance for Postgres, or remove usage.","message":"redis:maintenance and pg:maintenance commands are deprecated in v10.17.0.","severity":"deprecated","affected_versions":">=10.17.0 <11.0.0"},{"fix":"Use npx heroku to avoid version conflicts, or install globally with npm install -g heroku.","message":"Global install may conflict with npx usage. Use npx heroku for per-version usage.","severity":"gotcha","affected_versions":">=11.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Change to import heroku from 'heroku'; or use dynamic import.","cause":"Using require() on an ESM-only module in v11.","error":"Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /path/to/heroku/node_modules/heroku/lib/index.js"},{"fix":"Uninstall @heroku-cli/plugin-* and use 'heroku' directly.","cause":"v11 removed monorepo. All plugins are now in the main 'heroku' package.","error":"Cannot find module '@heroku-cli/plugin-*'"},{"fix":"Upgrade Node.js to version 20+.","cause":"Node.js version too old for v11.","error":"The engine \"node\" is incompatible with this module. Expected version \">=20\". Got \"18.x\""},{"fix":"Update plugin to oclif v4 compatible version or re-install.","cause":"Trying to run a plugin command that is not available because oclif v4 changed plugin loading.","error":"Error: Command not found. Perhaps you need to install the plugin?"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}