{
  "id": "caffeinate",
  "name": "caffeinate",
  "description": "Prevent the system from sleeping on behalf of a utility.",
  "executables": [
    "caffeinate"
  ],
  "commands": {
    "format": 1,
    "label": "Prevent sleep",
    "description": "Create power assertions for a duration or until a process exits. Running a utility under caffeinate is outside this form.",
    "quality": "ai-draft",
    "base": "fig:caffeinate",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": true
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/caffeinate.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "display",
        "label": "Prevent display sleep",
        "type": "boolean",
        "option": [
          "-d"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "idle",
        "label": "Prevent idle system sleep",
        "type": "boolean",
        "option": [
          "-i"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "disk",
        "label": "Prevent disk idle sleep",
        "type": "boolean",
        "option": [
          "-m"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "system",
        "label": "Prevent system sleep (AC power)",
        "description": "Valid only while the system is running on AC power.",
        "type": "boolean",
        "option": [
          "-s"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "user_active",
        "label": "Declare user active",
        "description": "Turns the display on if it is off. Without a timeout the assertion lasts 5 seconds.",
        "type": "boolean",
        "option": [
          "-u"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "timeout",
        "label": "Timeout (seconds)",
        "type": "integer",
        "option": [
          "-t"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "wait_pid",
        "label": "Wait for process (PID)",
        "description": "Release the assertion when this process exits.",
        "type": "integer",
        "option": [
          "-w"
        ],
        "sources": [
          "fig"
        ]
      }
    ],
    "task": [
      {
        "id": "display-timeout",
        "label": "Keep display awake for a time",
        "fields": [
          "display",
          "timeout"
        ],
        "required": [
          "timeout"
        ],
        "set": {
          "display": [
            true
          ]
        }
      },
      {
        "id": "until-pid",
        "label": "Keep awake until a process exits",
        "fields": [
          "idle",
          "wait_pid"
        ],
        "required": [
          "wait_pid"
        ],
        "set": {
          "idle": [
            true
          ]
        }
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "display",
          "idle",
          "timeout",
          "wait_pid"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "disk",
          "system",
          "user_active"
        ]
      }
    ]
  }
}
