{
  "id": "opencode",
  "name": "OpenCode",
  "homepage": "https://opencode.ai/docs/config/",
  "description": "The open source coding agent, model-agnostic by design.",
  "icon": "theSVG:opencode",
  "executables": [
    "opencode"
  ],
  "dotfiles": {
    "paths": [
      "[configHome]/opencode/opencode.json",
      "[configHome]/opencode/AGENTS.md",
      "[configHome]/opencode/plugins/",
      "[configHome]/opencode/commands/",
      "[configHome]/opencode/themes/",
      "[configHome]/opencode/skills/"
    ],
    "exclude": [
      "[configHome]/opencode/node_modules/",
      "[configHome]/opencode/bun.lock",
      "[configHome]/opencode/package-lock.json",
      "[configHome]/opencode/tui.json",
      "[configHome]/opencode/opencode.json.tui-migration.bak",
      "[xdgData]/opencode/log/",
      "[xdgData]/opencode/storage/",
      "[xdgData]/opencode/cache/"
    ],
    "secret": [
      "[xdgData]/opencode/auth.json"
    ]
  },
  "commands": {
    "format": 1,
    "label": "OpenCode",
    "description": "Start the opencode TUI, run one-off messages or serve headless. Other subcommands are left out.",
    "quality": "ai-draft",
    "base": "fig:opencode",
    "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/opencode.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "project",
        "label": "Project directory",
        "type": "path",
        "position": 0,
        "path": {
          "kind": "directory",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "model",
        "label": "Model",
        "description": "Format provider/model.",
        "type": "string",
        "option": [
          "-m",
          "--model"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "continue",
        "label": "Continue last session",
        "type": "boolean",
        "option": [
          "-c",
          "--continue"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "session",
        "label": "Session ID",
        "type": "string",
        "option": [
          "-s",
          "--session"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "fork",
        "label": "Fork session",
        "description": "Use with continue or a session ID.",
        "type": "boolean",
        "option": [
          "--fork"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "prompt",
        "label": "Prompt",
        "type": "string",
        "option": [
          "--prompt"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "agent",
        "label": "Agent",
        "type": "string",
        "option": [
          "--agent"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "pure",
        "label": "No external plugins",
        "type": "boolean",
        "option": [
          "--pure"
        ],
        "sources": [
          "fig"
        ]
      }
    ],
    "task": [
      {
        "id": "open",
        "label": "Open in a project",
        "fields": [
          "project",
          "model",
          "agent"
        ],
        "required": []
      },
      {
        "id": "continue",
        "label": "Continue last session",
        "fields": [
          "project",
          "continue",
          "model"
        ],
        "required": [
          "continue"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "project",
          "model",
          "continue",
          "session",
          "prompt",
          "agent"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "fork",
          "pure"
        ]
      }
    ],
    "subcommand": [
      {
        "path": [
          "run"
        ],
        "label": "Run with a message",
        "description": "Run opencode non-interactively with a message. Server attach options are left out.",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/opencode.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "message",
            "label": "Message",
            "type": "string",
            "position": 0,
            "multiple": true,
            "sources": [
              "fig"
            ]
          },
          {
            "id": "model",
            "label": "Model",
            "description": "Format provider/model.",
            "type": "string",
            "option": [
              "-m",
              "--model"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "agent",
            "label": "Agent",
            "type": "string",
            "option": [
              "--agent"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "continue",
            "label": "Continue last session",
            "type": "boolean",
            "option": [
              "-c",
              "--continue"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "session",
            "label": "Session ID",
            "type": "string",
            "option": [
              "-s",
              "--session"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "format",
            "label": "Output format",
            "type": "enum",
            "option": [
              "--format"
            ],
            "choices": [
              {
                "value": "default",
                "label": "Formatted"
              },
              {
                "value": "json",
                "label": "Raw JSON events"
              }
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "file",
            "label": "Attach files",
            "type": "path",
            "option": [
              "-f",
              "--file"
            ],
            "multiple": true,
            "path": {
              "kind": "file",
              "role": "input",
              "must_exist": true
            },
            "sources": [
              "fig"
            ]
          },
          {
            "id": "dir",
            "label": "Directory",
            "type": "path",
            "option": [
              "--dir"
            ],
            "path": {
              "kind": "directory",
              "role": "input",
              "must_exist": true
            },
            "sources": [
              "fig"
            ]
          },
          {
            "id": "thinking",
            "label": "Show thinking",
            "type": "boolean",
            "option": [
              "--thinking"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "share",
            "label": "Share session",
            "type": "boolean",
            "option": [
              "--share"
            ],
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "ask",
            "label": "Ask a question",
            "fields": [
              "message",
              "model",
              "file"
            ],
            "required": [
              "message"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "message",
              "model",
              "agent",
              "continue",
              "file",
              "format"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "session",
              "dir",
              "thinking",
              "share"
            ]
          }
        ]
      },
      {
        "path": [
          "serve"
        ],
        "label": "Start a headless server",
        "description": "Run an opencode server without the TUI.",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/opencode.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "port",
            "label": "Port",
            "type": "integer",
            "option": [
              "--port"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "hostname",
            "label": "Hostname",
            "type": "string",
            "option": [
              "--hostname"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "mdns",
            "label": "mDNS discovery",
            "type": "boolean",
            "option": [
              "--mdns"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "cors",
            "label": "CORS domains",
            "type": "string",
            "option": [
              "--cors"
            ],
            "multiple": true,
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "serve",
            "label": "Start server",
            "fields": [
              "port",
              "hostname"
            ],
            "required": []
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "port",
              "hostname",
              "mdns",
              "cors"
            ]
          }
        ]
      }
    ]
  }
}
