{
  "version": 2,
  "title": "Run Commands",
  "description": "Run any custom commands with Nx.",
  "type": "object",
  "cli": "nx",
  "outputCapture": "pipe",
  "presets": [
    {
      "name": "Arguments forwarding",
      "keys": ["commands"]
    },
    {
      "name": "Custom done conditions",
      "keys": ["commands", "readyWhen"]
    },
    {
      "name": "Setting the cwd",
      "keys": ["commands", "cwd"]
    }
  ],
  "properties": {
    "commands": {
      "type": "array",
      "description": "Commands to run in child process.",
      "items": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "command": {
                "type": "string",
                "description": "Command to run in child process."
              },
              "forwardAllArgs": {
                "type": "boolean",
                "description": "Whether arguments should be forwarded when interpolation is not present."
              },
              "prefix": {
                "type": "string",
                "description": "Prefix in front of every line out of the output"
              },
              "color": {
                "type": "string",
                "description": "Color of the output",
                "enum": [
                  "black",
                  "red",
                  "green",
                  "yellow",
                  "blue",
                  "magenta",
                  "cyan",
                  "white"
                ]
              },
              "bgColor": {
                "type": "string",
                "description": "Background color of the output",
                "enum": [
                  "bgBlack",
                  "bgRed",
                  "bgGreen",
                  "bgYellow",
                  "bgBlue",
                  "bgMagenta",
                  "bgCyan",
                  "bgWhite"
                ]
              },
              "description": {
                "type": "string",
                "description": "An optional description useful for inline documentation purposes. It is not used as part of the execution of the command."
              }
            },
            "additionalProperties": false,
            "required": ["command"]
          },
          {
            "type": "string"
          }
        ]
      },
      "x-priority": "important"
    },
    "command": {
      "type": "string",
      "description": "Command to run in child process.",
      "x-priority": "important"
    },
    "parallel": {
      "type": "boolean",
      "description": "Run commands in parallel.",
      "default": true,
      "x-priority": "important"
    },
    "readyWhen": {
      "type": "string",
      "description": "String to appear in `stdout` or `stderr` that indicates that the task is done. When running multiple commands, this option can only be used when `parallel` is set to `true`. If not specified, the task is done when all the child processes complete."
    },
    "args": {
      "type": "string",
      "description": "Extra arguments. You can pass them as follows: nx run project:target --args='--wait=100'. You can then use {args.wait} syntax to interpolate them in the workspace config file. See example [above](#chaining-commands-interpolating-args-and-setting-the-cwd)"
    },
    "envFile": {
      "type": "string",
      "description": "You may specify a custom .env file path."
    },
    "color": {
      "type": "boolean",
      "description": "Use colors when showing output of command.",
      "default": false
    },
    "cwd": {
      "type": "string",
      "description": "Current working directory of the commands. If it's not specified the commands will run in the workspace root, if a relative path is specified the commands will run in that path relative to the workspace root and if it's an absolute path the commands will run in that path."
    },
    "installDependenciesIfNotExists": {
      "type": "boolean",
      "description": "Run the package manager install command if the virtual environment is not activated (default: false)",
      "default": false
    },
    "__unparsed__": {
      "hidden": true,
      "type": "array",
      "items": {
        "type": "string"
      },
      "$default": {
        "$source": "unparsed"
      },
      "x-priority": "internal"
    }
  },
  "additionalProperties": true,
  "oneOf": [
    {
      "required": ["commands"]
    },
    {
      "required": ["command"]
    }
  ],
  "examplesFile": "../../../docs/run-commands-examples.md"
}
