{
  "id": "pm2",
  "name": "PM2",
  "homepage": "https://pm2.keymetrics.io",
  "description": "Production process manager for Node.js applications with a built-in load balancer.",
  "icon": "theSVG:pm2",
  "executables": [
    "pm2"
  ],
  "dotfiles": {
    "paths": [
      "~/.pm2/module_conf.json"
    ],
    "exclude": [
      "~/.pm2/logs/",
      "~/.pm2/pm2.log",
      "~/.pm2/dump.pm2"
    ],
    "secret": []
  },
  "commands": {
    "format": 1,
    "label": "PM2 processes",
    "description": "Start, restart, stop and delete managed processes. Deploy, ecosystem files, startup scripts and monitoring are left out.",
    "quality": "ai-draft",
    "base": "fig:pm2",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/pm2.ts",
        "license": "MIT"
      }
    ],
    "subcommand": [
      {
        "path": [
          "start"
        ],
        "label": "Start an app",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/pm2.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "script",
            "label": "Script, app name or id",
            "type": "string",
            "position": 0,
            "sources": [
              "fig"
            ]
          },
          {
            "id": "name",
            "label": "Process name",
            "type": "string",
            "option": [
              "--name",
              "-n"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "instances",
            "label": "Instances",
            "type": "integer",
            "option": [
              "--instances",
              "-i"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "max_memory",
            "label": "Restart above memory",
            "type": "string",
            "option": [
              "--max-memory-restart"
            ],
            "suggestions": [
              {
                "value": "100M",
                "label": "100M"
              },
              {
                "value": "500M",
                "label": "500M"
              },
              {
                "value": "1G",
                "label": "1G"
              }
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "cron",
            "label": "Cron restart pattern",
            "type": "string",
            "option": [
              "--cron",
              "-c"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "interpreter",
            "label": "Interpreter",
            "type": "string",
            "option": [
              "--interpreter"
            ],
            "suggestions": [
              {
                "value": "bash",
                "label": "bash"
              },
              {
                "value": "python",
                "label": "python"
              },
              {
                "value": "node",
                "label": "node"
              }
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "cwd",
            "label": "Working directory",
            "type": "path",
            "option": [
              "--cwd"
            ],
            "path": {
              "kind": "directory",
              "role": "input"
            },
            "sources": [
              "fig"
            ]
          },
          {
            "id": "update_env",
            "label": "Update environment",
            "type": "boolean",
            "option": [
              "--update-env",
              "-a"
            ],
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "start",
            "label": "Start a script",
            "fields": [
              "script",
              "name",
              "instances",
              "max_memory",
              "cron",
              "interpreter",
              "cwd",
              "update_env"
            ],
            "required": [
              "script"
            ]
          },
          {
            "id": "cluster",
            "label": "Start as cluster",
            "fields": [
              "script",
              "name",
              "instances"
            ],
            "required": [
              "script",
              "instances"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "script",
              "name",
              "instances",
              "max_memory"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "cron",
              "interpreter",
              "cwd",
              "update_env"
            ]
          }
        ]
      },
      {
        "path": [
          "restart"
        ],
        "label": "Restart a process",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/pm2.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "target",
            "label": "Id, name or all",
            "type": "string",
            "position": 0,
            "sources": [
              "fig"
            ]
          },
          {
            "id": "update_env",
            "label": "Update environment",
            "type": "boolean",
            "option": [
              "--update-env",
              "-a"
            ],
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "restart",
            "label": "Restart",
            "fields": [
              "target",
              "update_env"
            ],
            "required": [
              "target"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "target",
              "update_env"
            ]
          }
        ]
      },
      {
        "path": [
          "stop"
        ],
        "label": "Stop a process",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/pm2.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "target",
            "label": "Id, name or all",
            "type": "string",
            "position": 0,
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "stop",
            "label": "Stop",
            "fields": [
              "target"
            ],
            "required": [
              "target"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "target"
            ]
          }
        ]
      },
      {
        "path": [
          "delete"
        ],
        "label": "Delete a process",
        "description": "Stops the process and removes it from the pm2 list.",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/pm2.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "target",
            "label": "Id, name or all",
            "type": "string",
            "position": 0,
            "effect": "delete",
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "delete",
            "label": "Delete",
            "fields": [
              "target"
            ],
            "required": [
              "target"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "target"
            ]
          }
        ]
      }
    ]
  }
}
