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] # cli/cli.go: `GlobalConfigDirName = ".hasura"`, `GlobalConfigFileName = # "config.json"`, created under os.UserHomeDir() on first run # (https://github.com/hasura/graphql-engine/blob/master/cli/global_config.go). # https://hasura.io/docs/2.0/policies/telemetry/ documents editing # `enable_telemetry` there, so the file is user-settable, not just state. # The project's own config.yaml lives in the project directory, not here. paths = ["~/.hasura/config.json"] # Plugin binaries the CLI downloads for itself (cli.go: `plugins` under the # global config dir). exclude = ["~/.hasura/plugins/"] secret = [] # `uuid` is generated on first run to identify this installation in telemetry — # an install id, not a preference. Two machines sharing it would report as one. [[dotfiles.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 } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/hasura.ts" license = "MIT" [[commands.subcommand]] path = ["init"] label = "Initialise a project" description = "Create a directory for Hasura migrations and metadata." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/hasura.ts" license = "MIT" [[commands.subcommand.field]] id = "directory" label = "Directory name" description = "Defaults to the current directory." type = "string" position = 0 sources = ["fig"] [[commands.subcommand.field]] id = "endpoint" label = "Endpoint" description = "HTTP(S) endpoint of the Hasura GraphQL engine." type = "string" option = ["--endpoint"] sources = ["fig"] [[commands.subcommand.field]] id = "admin_secret" label = "Admin secret" type = "string" option = ["--admin-secret"] sensitive = true sources = ["fig"] [[commands.subcommand.field]] id = "install_manifest" label = "Install manifest" type = "string" option = ["--install-manifest"] sources = ["fig"] [[commands.subcommand.field]] id = "version" label = "Config version" type = "integer" option = ["--version"] sources = ["fig"] [[commands.subcommand.task]] id = "init" label = "New project" fields = ["directory", "endpoint", "admin_secret"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["directory", "endpoint", "admin_secret"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["install_manifest", "version"] [[commands.subcommand]] path = ["console"] label = "Open the console" description = "Serve the console and migration API locally." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/hasura.ts" license = "MIT" [[commands.subcommand.field]] id = "endpoint" label = "Endpoint" description = "HTTP(S) endpoint of the Hasura GraphQL engine." type = "string" option = ["--endpoint"] sources = ["fig"] [[commands.subcommand.field]] id = "admin_secret" label = "Admin secret" type = "string" option = ["--admin-secret"] sensitive = true sources = ["fig"] [[commands.subcommand.field]] id = "no_browser" label = "No browser" type = "boolean" option = ["--no-browser"] sources = ["fig"] [[commands.subcommand.field]] id = "console_port" label = "Console port" type = "string" option = ["--console-port"] sources = ["fig"] [[commands.subcommand.field]] id = "api_port" label = "API port" type = "string" option = ["--api-port"] sources = ["fig"] [[commands.subcommand.field]] id = "address" label = "Address" type = "string" option = ["--address"] sources = ["fig"] [[commands.subcommand.field]] id = "use_server_assets" label = "Use server assets" type = "boolean" option = ["--use-server-assets"] sources = ["fig"] [[commands.subcommand.field]] id = "project" label = "Project directory" type = "path" option = ["--project"] path = { kind = "directory", role = "input" } sources = ["fig"] [[commands.subcommand.task]] id = "console" label = "Open console" fields = ["endpoint", "admin_secret", "no_browser", "project"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["endpoint", "admin_secret", "no_browser", "console_port", "project"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["address", "use_server_assets", "api_port"] [[commands.subcommand]] path = ["migrate", "apply"] label = "Apply migrations" description = "Apply migrations to the database. Use --up/--down/goto by editing the command." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/hasura.ts" license = "MIT" [[commands.subcommand.field]] id = "endpoint" label = "Endpoint" description = "HTTP(S) endpoint of the Hasura GraphQL engine." type = "string" option = ["--endpoint"] sources = ["fig"] [[commands.subcommand.field]] id = "admin_secret" label = "Admin secret" type = "string" option = ["--admin-secret"] sensitive = true sources = ["fig"] [[commands.subcommand.field]] id = "version" label = "Only this version" type = "string" option = ["--version"] sources = ["fig"] [[commands.subcommand.field]] 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"] [[commands.subcommand.field]] id = "dry_run" label = "Dry run" type = "boolean" option = ["--dry-run"] sources = ["fig"] [[commands.subcommand.field]] 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"] [[commands.subcommand.field]] id = "all_databases" label = "All databases" type = "boolean" option = ["--all-databases"] sources = ["fig"] [[commands.subcommand.field]] id = "project" label = "Project directory" type = "path" option = ["--project"] path = { kind = "directory", role = "input" } sources = ["fig"] [[commands.subcommand.task]] id = "apply" label = "Apply pending" fields = ["endpoint", "admin_secret", "project"] required = [] [[commands.subcommand.task]] id = "preview" label = "Dry run" fields = ["endpoint", "admin_secret", "dry_run"] required = [] set = { dry_run = [true] } [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["endpoint", "admin_secret", "version", "dry_run", "project"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["skip_execution", "all_databases", "type"] [[commands.subcommand]] path = ["migrate", "create"] label = "Create a migration" description = "Create the files for a new migration." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/hasura.ts" license = "MIT" [[commands.subcommand.field]] id = "name" label = "Migration name" type = "string" position = 0 sources = ["fig"] [[commands.subcommand.field]] id = "up_sql" label = "Up SQL" type = "string" option = ["--up-sql"] sources = ["fig"] [[commands.subcommand.field]] id = "down_sql" label = "Down SQL" type = "string" option = ["--down-sql"] sources = ["fig"] [[commands.subcommand.field]] id = "sql_from_file" label = "SQL file" type = "path" option = ["--sql-from-file"] path = { kind = "file", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "sql_from_server" label = "SQL from server" type = "boolean" option = ["--sql-from-server"] sources = ["fig"] [[commands.subcommand.field]] id = "from_server" label = "Dump from server" type = "boolean" option = ["--from-server"] sources = ["fig"] [[commands.subcommand.field]] id = "endpoint" label = "Endpoint" description = "HTTP(S) endpoint of the Hasura GraphQL engine." type = "string" option = ["--endpoint"] sources = ["fig"] [[commands.subcommand.field]] id = "admin_secret" label = "Admin secret" type = "string" option = ["--admin-secret"] sensitive = true sources = ["fig"] [[commands.subcommand.field]] id = "project" label = "Project directory" type = "path" option = ["--project"] path = { kind = "directory", role = "input" } sources = ["fig"] [[commands.subcommand.task]] id = "sql" label = "From SQL" fields = ["name", "up_sql", "down_sql", "project"] required = ["name"] [[commands.subcommand.task]] id = "file" label = "From SQL file" fields = ["name", "sql_from_file", "project"] required = ["name", "sql_from_file"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["name", "up_sql", "down_sql", "sql_from_file", "project"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["sql_from_server", "from_server", "endpoint", "admin_secret"]