{
  "id": "hasura",
  "name": "Hasura CLI",
  "homepage": "https://hasura.io/docs/2.0/hasura-cli/overview/",
  "description": "A command line tool that acts as an interface to the Hasura GraphQL Engine's Metadata API, to create, migrate and manage projects.",
  "icon": "SimpleIcons:hasura",
  "executables": [
    "hasura"
  ],
  "dotfiles": {
    "paths": [
      "~/.hasura/config.json"
    ],
    "exclude": [
      "~/.hasura/plugins/"
    ],
    "secret": [],
    "machine_lines": [
      {
        "file": "~/.hasura/config.json",
        "match": {
          "key_path": [
            "uuid"
          ]
        }
      }
    ]
  },
  "commands": {
    "format": 1,
    "label": "Hasura project",
    "description": "Initialise a project, open the console and manage migrations. Metadata, actions, seeds and plugin commands are left out.",
    "quality": "ai-draft",
    "base": "fig:hasura",
    "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/hasura.ts",
        "license": "MIT"
      }
    ],
    "subcommand": [
      {
        "path": [
          "init"
        ],
        "label": "Initialise a project",
        "description": "Create a directory for Hasura migrations and metadata.",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/hasura.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "directory",
            "label": "Directory name",
            "description": "Defaults to the current directory.",
            "type": "string",
            "position": 0,
            "sources": [
              "fig"
            ]
          },
          {
            "id": "endpoint",
            "label": "Endpoint",
            "description": "HTTP(S) endpoint of the Hasura GraphQL engine.",
            "type": "string",
            "option": [
              "--endpoint"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "admin_secret",
            "label": "Admin secret",
            "type": "string",
            "option": [
              "--admin-secret"
            ],
            "sensitive": true,
            "sources": [
              "fig"
            ]
          },
          {
            "id": "install_manifest",
            "label": "Install manifest",
            "type": "string",
            "option": [
              "--install-manifest"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "version",
            "label": "Config version",
            "type": "integer",
            "option": [
              "--version"
            ],
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "init",
            "label": "New project",
            "fields": [
              "directory",
              "endpoint",
              "admin_secret"
            ],
            "required": []
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "directory",
              "endpoint",
              "admin_secret"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "install_manifest",
              "version"
            ]
          }
        ]
      },
      {
        "path": [
          "console"
        ],
        "label": "Open the console",
        "description": "Serve the console and migration API locally.",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/hasura.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "endpoint",
            "label": "Endpoint",
            "description": "HTTP(S) endpoint of the Hasura GraphQL engine.",
            "type": "string",
            "option": [
              "--endpoint"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "admin_secret",
            "label": "Admin secret",
            "type": "string",
            "option": [
              "--admin-secret"
            ],
            "sensitive": true,
            "sources": [
              "fig"
            ]
          },
          {
            "id": "no_browser",
            "label": "No browser",
            "type": "boolean",
            "option": [
              "--no-browser"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "console_port",
            "label": "Console port",
            "type": "string",
            "option": [
              "--console-port"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "api_port",
            "label": "API port",
            "type": "string",
            "option": [
              "--api-port"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "address",
            "label": "Address",
            "type": "string",
            "option": [
              "--address"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "use_server_assets",
            "label": "Use server assets",
            "type": "boolean",
            "option": [
              "--use-server-assets"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "project",
            "label": "Project directory",
            "type": "path",
            "option": [
              "--project"
            ],
            "path": {
              "kind": "directory",
              "role": "input"
            },
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "console",
            "label": "Open console",
            "fields": [
              "endpoint",
              "admin_secret",
              "no_browser",
              "project"
            ],
            "required": []
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "endpoint",
              "admin_secret",
              "no_browser",
              "console_port",
              "project"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "address",
              "use_server_assets",
              "api_port"
            ]
          }
        ]
      },
      {
        "path": [
          "migrate",
          "apply"
        ],
        "label": "Apply migrations",
        "description": "Apply migrations to the database. Use --up/--down/goto by editing the command.",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/hasura.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "endpoint",
            "label": "Endpoint",
            "description": "HTTP(S) endpoint of the Hasura GraphQL engine.",
            "type": "string",
            "option": [
              "--endpoint"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "admin_secret",
            "label": "Admin secret",
            "type": "string",
            "option": [
              "--admin-secret"
            ],
            "sensitive": true,
            "sources": [
              "fig"
            ]
          },
          {
            "id": "version",
            "label": "Only this version",
            "type": "string",
            "option": [
              "--version"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "type",
            "label": "Migration type",
            "type": "string",
            "option": [
              "--type"
            ],
            "description": "Use with a version.",
            "suggestions": [
              {
                "value": "up",
                "label": "Up"
              },
              {
                "value": "down",
                "label": "Down"
              }
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "dry_run",
            "label": "Dry run",
            "type": "boolean",
            "option": [
              "--dry-run"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "skip_execution",
            "label": "Mark applied only",
            "description": "Skip running the SQL but record the migration as applied.",
            "type": "boolean",
            "option": [
              "--skip-execution"
            ],
            "effect": "overwrite",
            "sources": [
              "fig"
            ]
          },
          {
            "id": "all_databases",
            "label": "All databases",
            "type": "boolean",
            "option": [
              "--all-databases"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "project",
            "label": "Project directory",
            "type": "path",
            "option": [
              "--project"
            ],
            "path": {
              "kind": "directory",
              "role": "input"
            },
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "apply",
            "label": "Apply pending",
            "fields": [
              "endpoint",
              "admin_secret",
              "project"
            ],
            "required": []
          },
          {
            "id": "preview",
            "label": "Dry run",
            "fields": [
              "endpoint",
              "admin_secret",
              "dry_run"
            ],
            "required": [],
            "set": {
              "dry_run": [
                true
              ]
            }
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "endpoint",
              "admin_secret",
              "version",
              "dry_run",
              "project"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "skip_execution",
              "all_databases",
              "type"
            ]
          }
        ]
      },
      {
        "path": [
          "migrate",
          "create"
        ],
        "label": "Create a migration",
        "description": "Create the files for a new migration.",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/hasura.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "name",
            "label": "Migration name",
            "type": "string",
            "position": 0,
            "sources": [
              "fig"
            ]
          },
          {
            "id": "up_sql",
            "label": "Up SQL",
            "type": "string",
            "option": [
              "--up-sql"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "down_sql",
            "label": "Down SQL",
            "type": "string",
            "option": [
              "--down-sql"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "sql_from_file",
            "label": "SQL file",
            "type": "path",
            "option": [
              "--sql-from-file"
            ],
            "path": {
              "kind": "file",
              "role": "input"
            },
            "sources": [
              "fig"
            ]
          },
          {
            "id": "sql_from_server",
            "label": "SQL from server",
            "type": "boolean",
            "option": [
              "--sql-from-server"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "from_server",
            "label": "Dump from server",
            "type": "boolean",
            "option": [
              "--from-server"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "endpoint",
            "label": "Endpoint",
            "description": "HTTP(S) endpoint of the Hasura GraphQL engine.",
            "type": "string",
            "option": [
              "--endpoint"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "admin_secret",
            "label": "Admin secret",
            "type": "string",
            "option": [
              "--admin-secret"
            ],
            "sensitive": true,
            "sources": [
              "fig"
            ]
          },
          {
            "id": "project",
            "label": "Project directory",
            "type": "path",
            "option": [
              "--project"
            ],
            "path": {
              "kind": "directory",
              "role": "input"
            },
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "sql",
            "label": "From SQL",
            "fields": [
              "name",
              "up_sql",
              "down_sql",
              "project"
            ],
            "required": [
              "name"
            ]
          },
          {
            "id": "file",
            "label": "From SQL file",
            "fields": [
              "name",
              "sql_from_file",
              "project"
            ],
            "required": [
              "name",
              "sql_from_file"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "name",
              "up_sql",
              "down_sql",
              "sql_from_file",
              "project"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "sql_from_server",
              "from_server",
              "endpoint",
              "admin_secret"
            ]
          }
        ]
      }
    ]
  }
}
