Skip to main content
Version: v2.x

Hasura CLI: hasura init

Initialize a new Hasura GraphQL Engine project.

Synopsis

This is generally the first command that you would run in a new project. It creates a directory with the necessary files and directories to configure an instance of the Hasura GraphQL Engine. You can pass various flags to customize the behavior of the command and pre-configure environment variables.

hasura init [directory-name] [flags]

Examples

# Create a directory to store migrations
hasura init [directory-name]

# Now, edit <my-directory>/config.yaml to add endpoint and admin secret

# Create a directory with endpoint and admin secret configured:
hasura init <my-project> --endpoint https://my-graphql-engine.com --admin-secret adminsecretkey

# Create a Hasura Project in the current working directory
hasura init .

# See https://hasura.io/docs/2.0/graphql/core/migrations/index.html for more details

Options

    --admin-secret string   admin secret for Hasura GraphQL Engine
--endpoint string http(s) endpoint for Hasura GraphQL Engine
-h, --help help for init
--version int config version to be used (default 3)

Options inherited from parent commands

--envfile string      .env filename to load ENV vars from (default ".env")
--log-level string log level (DEBUG, INFO, WARN, ERROR, FATAL) (default "INFO")
--no-color do not colorize output (default: false)
--project string directory where commands are executed (default: current dir)
--skip-update-check skip automatic update check on command execution

SEE ALSO

  • hasura - Hasura GraphQL Engine command line tool

Auto generated by spf13/cobra