{
  "id": "dstack",
  "name": "dstack",
  "homepage": "https://dstack.ai/",
  "description": "ML workflow orchestration system designed for reproducibility and collaboration",
  "executables": [
    "dstack"
  ],
  "dotfiles": {
    "paths": [
      "~/.dstack/ssh/config"
    ],
    "secret": [
      "~/.dstack/config.yml",
      "~/.dstack/server/config.yml"
    ]
  },
  "commands": {
    "format": 1,
    "label": "dstack",
    "description": "Common dstack jobs: apply a configuration, list runs, show logs and stop a run. Configuration-specific apply options, fleets, gateways, volumes and secrets are not covered.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "subcommand": [
      {
        "path": [
          "apply"
        ],
        "label": "Apply a configuration",
        "source": [
          {
            "id": "help",
            "kind": "help",
            "url": "https://dstack.ai/docs/reference/cli/dstack/apply/",
            "revision": "dstack apply --help",
            "evidence": "Usage: dstack apply [--project NAME] [-h [TYPE]] [-f FILE] [-y] [--force] [-d]\n  --project NAME     The name of the project. Defaults to $DSTACK_PROJECT\n  -f, --file FILE    The path to the configuration file. Specify - to read\n  -y, --yes          Do not ask for confirmation\n  --force            Force apply when no changes detected\n  -d, --detach       Exit immediately after submitting configuration\n  -v, --verbose      Show all plan properties including those with default\n"
          }
        ],
        "field": [
          {
            "id": "file",
            "label": "Configuration file",
            "description": "Defaults to .dstack.yml in the current directory.",
            "type": "path",
            "option": [
              "--file",
              "-f"
            ],
            "path": {
              "kind": "file",
              "role": "input",
              "must_exist": true
            },
            "sources": [
              "help"
            ]
          },
          {
            "id": "project",
            "label": "Project",
            "type": "string",
            "option": [
              "--project"
            ],
            "sources": [
              "help"
            ]
          },
          {
            "id": "yes",
            "label": "Do not ask for confirmation",
            "type": "boolean",
            "option": [
              "--yes",
              "-y"
            ],
            "sources": [
              "help"
            ]
          },
          {
            "id": "detach",
            "label": "Detach after submitting",
            "type": "boolean",
            "option": [
              "--detach",
              "-d"
            ],
            "sources": [
              "help"
            ]
          },
          {
            "id": "force",
            "label": "Force apply",
            "description": "Apply even when no changes are detected.",
            "type": "boolean",
            "option": [
              "--force"
            ],
            "sources": [
              "help"
            ]
          },
          {
            "id": "verbose",
            "label": "Show all plan properties",
            "type": "boolean",
            "option": [
              "--verbose",
              "-v"
            ],
            "sources": [
              "help"
            ]
          }
        ],
        "task": [
          {
            "id": "apply",
            "label": "Apply a configuration",
            "fields": [
              "file",
              "project",
              "yes",
              "detach"
            ],
            "required": []
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "file",
              "project",
              "yes",
              "detach"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "force",
              "verbose"
            ]
          }
        ]
      },
      {
        "path": [
          "ps"
        ],
        "label": "List runs",
        "source": [
          {
            "id": "help",
            "kind": "help",
            "url": "https://dstack.ai/docs/reference/cli/dstack/ps/",
            "revision": "dstack ps --help",
            "evidence": "Usage: dstack ps [-h] [--project NAME] [-a] [-v] [-w] [-n LAST]\n  --project NAME        The name of the project. Defaults to $DSTACK_PROJECT\n  -a, --all             Show all runs. By default, it only shows unfinished\n  -v, --verbose         Show more information about runs\n  -w, --watch           Watch statuses of runs in realtime\n  -n, --last LAST       Show only the last N runs. Implies --all\n  --json                Output in JSON format (equivalent to --format json)\n"
          }
        ],
        "field": [
          {
            "id": "project",
            "label": "Project",
            "type": "string",
            "option": [
              "--project"
            ],
            "sources": [
              "help"
            ]
          },
          {
            "id": "all",
            "label": "Show all runs",
            "type": "boolean",
            "option": [
              "--all",
              "-a"
            ],
            "sources": [
              "help"
            ]
          },
          {
            "id": "last",
            "label": "Last N runs",
            "type": "integer",
            "option": [
              "--last",
              "-n"
            ],
            "sources": [
              "help"
            ]
          },
          {
            "id": "verbose",
            "label": "Verbose",
            "type": "boolean",
            "option": [
              "--verbose",
              "-v"
            ],
            "sources": [
              "help"
            ]
          },
          {
            "id": "watch",
            "label": "Watch in real time",
            "type": "boolean",
            "option": [
              "--watch",
              "-w"
            ],
            "sources": [
              "help"
            ]
          },
          {
            "id": "json",
            "label": "JSON output",
            "type": "boolean",
            "option": [
              "--json"
            ],
            "sources": [
              "help"
            ]
          }
        ],
        "task": [
          {
            "id": "ps",
            "label": "List runs",
            "fields": [
              "all",
              "last",
              "watch",
              "json"
            ],
            "required": []
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "all",
              "last",
              "watch",
              "verbose",
              "json",
              "project"
            ]
          }
        ]
      },
      {
        "path": [
          "logs"
        ],
        "label": "Show run logs",
        "source": [
          {
            "id": "help",
            "kind": "help",
            "url": "https://dstack.ai/docs/reference/cli/dstack/logs/",
            "revision": "dstack logs --help",
            "evidence": "Usage: dstack logs [-h] [--project NAME] [-d] [--replica REPLICA] [--job JOB]\n                   [--since SINCE]\n                   run_name\n  --project NAME     The name of the project. Defaults to $DSTACK_PROJECT\n  -d, --diagnose     Show run diagnostic logs\n  --replica REPLICA  The replica number. Defaults to 0.\n  --job JOB          The job number inside the replica. Defaults to 0.\n  --since SINCE      Show only logs newer than the specified date. Can be a\n                     duration (e.g. 10s, 5m, 1d) or an RFC 3339 string (e.g.\n"
          }
        ],
        "field": [
          {
            "id": "run_name",
            "label": "Run name",
            "type": "string",
            "position": 0,
            "min": 1,
            "sources": [
              "help"
            ]
          },
          {
            "id": "since",
            "label": "Since",
            "description": "A duration such as 10s, 5m, 1d, or an RFC 3339 timestamp.",
            "type": "string",
            "option": [
              "--since"
            ],
            "sources": [
              "help"
            ]
          },
          {
            "id": "diagnose",
            "label": "Diagnostic logs",
            "type": "boolean",
            "option": [
              "--diagnose",
              "-d"
            ],
            "sources": [
              "help"
            ]
          },
          {
            "id": "replica",
            "label": "Replica number",
            "type": "integer",
            "option": [
              "--replica"
            ],
            "sources": [
              "help"
            ]
          },
          {
            "id": "job",
            "label": "Job number",
            "type": "integer",
            "option": [
              "--job"
            ],
            "sources": [
              "help"
            ]
          },
          {
            "id": "project",
            "label": "Project",
            "type": "string",
            "option": [
              "--project"
            ],
            "sources": [
              "help"
            ]
          }
        ],
        "task": [
          {
            "id": "logs",
            "label": "Show logs",
            "fields": [
              "run_name",
              "since",
              "diagnose"
            ],
            "required": [
              "run_name"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "run_name",
              "since",
              "diagnose"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "replica",
              "job",
              "project"
            ]
          }
        ]
      },
      {
        "path": [
          "stop"
        ],
        "label": "Stop a run",
        "source": [
          {
            "id": "help",
            "kind": "help",
            "url": "https://dstack.ai/docs/reference/cli/dstack/stop/",
            "revision": "dstack stop --help",
            "evidence": "Usage: dstack stop [-h] [--project NAME] [-x] [-y] run_name\n  --project NAME  The name of the project. Defaults to $DSTACK_PROJECT\n  -x, --abort\n  -y, --yes\n"
          }
        ],
        "field": [
          {
            "id": "run_name",
            "label": "Run name",
            "type": "string",
            "position": 0,
            "min": 1,
            "sources": [
              "help"
            ]
          },
          {
            "id": "abort",
            "label": "Abort instead of stopping gracefully",
            "type": "boolean",
            "option": [
              "--abort",
              "-x"
            ],
            "effect": "exec",
            "sources": [
              "help"
            ]
          },
          {
            "id": "yes",
            "label": "Do not ask for confirmation",
            "type": "boolean",
            "option": [
              "--yes",
              "-y"
            ],
            "sources": [
              "help"
            ]
          },
          {
            "id": "project",
            "label": "Project",
            "type": "string",
            "option": [
              "--project"
            ],
            "sources": [
              "help"
            ]
          }
        ],
        "task": [
          {
            "id": "stop",
            "label": "Stop a run",
            "fields": [
              "run_name",
              "yes"
            ],
            "required": [
              "run_name"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "run_name",
              "abort",
              "yes",
              "project"
            ]
          }
        ]
      }
    ]
  }
}
