All apps/Hasura CLI

Hasura CLI

hasura

A command line tool that acts as an interface to the Hasura GraphQL Engine's Metadata API, to create, migrate and manage projects.

Runs as hasura|macOS, Linux, Windows|hasura.io

Command form

ai-draft · 6 tasks · 30 fields

Initialise a project, open the console and manage migrations. Metadata, actions, seeds and plugin commands are left out.

Opens the form; the finished command lands at your prompt, unrun
otty gui hasura

hasura init

Initialise a project

Create a directory for Hasura migrations and metadata.

Initialise a projectExample values, fixed in this page — nothing here reaches a terminal
Basic
Directory name
string
Endpoint
string
Admin secret
string
TasksEach one presets the form for one job
New project
directoryendpointadmin_secret
ParametersOnly these flags are editable in the form
Directory name
Defaults to the current directory.
string · positional 0
Endpoint
HTTP(S) endpoint of the Hasura GraphQL engine.
string
--endpoint
Admin secret
string
--admin-secret
Install manifest
string
--install-manifest
Config version
integer
--version

hasura console

Open the console

Serve the console and migration API locally.

Open the consoleExample values, fixed in this page — nothing here reaches a terminal
Basic
Endpoint
string
Admin secret
string
No browser
--no-browser
Project directory
directory
TasksEach one presets the form for one job
Open console
endpointadmin_secretno_browserproject
ParametersOnly these flags are editable in the form
Endpoint
HTTP(S) endpoint of the Hasura GraphQL engine.
string
--endpoint
Admin secret
string
--admin-secret
No browser
boolean
--no-browser
Console port
string
--console-port
API port
string
--api-port
Address
string
--address
Use server assets
boolean
--use-server-assets
Project directory
path
--project

hasura migrate apply

Apply migrations

Apply migrations to the database. Use --up/--down/goto by editing the command.

Apply migrationsExample values, fixed in this page — nothing here reaches a terminal
Basic
Endpoint
string
Admin secret
string
Project directory
directory
TasksEach one presets the form for one job
Apply pending
endpointadmin_secretproject
Dry run
endpointadmin_secretdry_run
ParametersOnly these flags are editable in the form
Endpoint
HTTP(S) endpoint of the Hasura GraphQL engine.
string
--endpoint
Admin secret
string
--admin-secret
Only this version
string
--version
Migration type
Use with a version.
string
--typeupdown
Dry run
boolean
--dry-run
Mark applied only
Skip running the SQL but record the migration as applied.
boolean
--skip-execution
All databases
boolean
--all-databases
Project directory
path
--project

hasura migrate create

Create a migration

Create the files for a new migration.

Create a migrationExample values, fixed in this page — nothing here reaches a terminal
Basic
Migration name*
string
Up SQL
string
Down SQL
string
Project directory
directory
TasksEach one presets the form for one job
From SQL
nameup_sqldown_sqlproject
From SQL file
namesql_from_fileproject
ParametersOnly these flags are editable in the form
Migration name
string · positional 0
Up SQL
string
--up-sql
Down SQL
string
--down-sql
SQL file
path
--sql-from-file
SQL from server
boolean
--sql-from-server
Dump from server
boolean
--from-server
Endpoint
HTTP(S) endpoint of the Hasura GraphQL engine.
string
--endpoint
Admin secret
string
--admin-secret
Project directory
path
--project
SourcesEvery flag above is checked against these
fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

Before it fills your prompt, Otty checks the installed hasura against its version. A form that does not match your version is not offered.