Skip to content

Allow PM2 CLI to recognize custom ecosystem filenames like ecosystem.dev.js #6021

@atiris

Description

@atiris

Description:
Currently PM2 only treats files named exactly ecosystem.config.js
as valid ecosystem configuration files. If I run pm2 start ecosystem.dev.js,
PM2 interprets it as a script instead of a config file and doesn't load all defined apps.

Use case:
I maintain multiple environment-specific config files (ecosystem.dev.js,
ecosystem.test.js, ecosystem.prod.js). I'd like to be able to start/select them via CLI
(e.g. pm2 start --config ecosystem.dev.js or with --config-file),
similar to how many tools allow a --config flag.

Expected behavior:

  • PM2 should recognize or allow specifying custom config filenames
  • Treat them same as ecosystem.config.js, i.e. load all apps

Fictive example: ecosystem.dev.js

const path = require('path');
module.exports = {
apps: [
{ name: 'app-dev', cwd: path.resolve(__dirname, '../../backend'), script: 'node server-dev.js' },
{ name: 'worker-dev', script: 'node worker-dev.js' }]};

Expected pm2 start ecosystem.dev.js to spawn both apps—not run the file itself.

pm2 --version
6.0.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions