Categorygithub.com/hasura/graphql-engine/cli/v2
modulepackage
2.46.0
Repository: https://github.com/hasura/graphql-engine.git
Documentation: pkg.go.dev

# README

Hasura GraphQL Engine CLI

GoDoc

Installation

Download GraphQL Engine CLI bundled with Hasura CLI

  • Linux/macOS

    curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash
    

    This will install the Hasura CLI in /usr/local/bin. You might have to provide your sudo password depending on the permissions of your /usr/local/bin location.

    If you’d prefer to install to a different location other than /usr/local/bin, set the INSTALL_PATH variable accordingly:

    curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | INSTALL_PATH=$HOME/bin bash
    

    You can also install a specific version of the CLI by providing the VERSION variable:

    curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | VERSION=v2.43.0 bash
    
  • Windows

    Download the binary cli-hasura-windows-amd64.exe available under Assets of the latest release from the GitHub release page: https://github.com/hasura/graphql-engine/releases

Download using go get

go get github.com/hasura/graphql-engine/cli/cmd/hasura

Build from source

git clone https://github.com/hasura/graphql-engine
cd graphql-engine/cli
make deps
make build-cli-ext copy-cli-ext
make build
# binaries will be in _output directory

Usage

hasura init --directory <my-project> --endpoint <graphql-endpoint> --admin-secret <admin-secret>
cd <my-project>
hasura console

Contributing

Checkout the contributing guide.

# Packages

No description provided by the author
Package commands contains the definition for all the commands present in Hasura CLI.
No description provided by the author
Package migrate implements migrations on Hasura GraphQL Engine.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package util contains utility functions used by various commands.
Package version implements server, cli and console version handling.

# Functions

CheckFilesystemBiundary returns an error if dir is filesystem root.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewConfigVersionValue returns ConfigVersion set with default value.
NewExecutionContext returns a new instance of execution context.
validateDirectory tries to parse dir for the filesRequired and returns error if any one of them is missing.

# Constants

DefaultEnvironment - CLI running in default mode.
Other constants used in the package.
Other constants used in the package.
Other constants used in the package.
Name of the global configuration directory.
Name of the global configuration file.
Name of the file to store last update check time.
No description provided by the author
No description provided by the author
No description provided by the author
ServerOnDockerEnvironment - CLI running in cli-migrations image.
No description provided by the author
V1 represents config version 1.
V2 represents config version 2.
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

ErrInvalidConfigVersion - if the config version is not valid.

# Structs

Config represents configuration required for the CLI to function.
ExecutionContext contains various contextual information required by the cli at various points of it's execution.
GlobalConfig is the configuration object stored in the GlobalConfigFile.
HasuraServerConfig is the type returned by the v1alpha1/config API TODO: Move this type to a client implementation for hasura.
ServerAPIPaths has the custom paths defined for server api.
ServerConfig has the config values required to contact the server.
No description provided by the author

# Type aliases

ConfigVersion defines the version of the Config.
No description provided by the author
Environment defines the environment the CLI is running.
No description provided by the author