Skip to content

Latest commit

 

History

History

README.md

Nhost CLI

Nhost is an open-source Firebase alternative with GraphQL.

The Nhost CLI is used to set up a local development environment. This environment will automatically track database migrations and Hasura metadata.

It's recommended to use the Nhost CLI and the Nhost GitHub Integration to develop locally and automatically deploy changes to production with a git-based workflow (similar to Netlify & Vercel).

Services

Install

Homebrew

brew install nhost/tap/nhost

Nix

If you have flakes enabled:

nix profile install github:nhost/nhost#cli

Or run it directly without installing:

nix run github:nhost/nhost#cli

npm / pnpm / Yarn / Bun

Install the CLI in a project to pin the version for the whole team:

npm install -D @nhost/cli
pnpm add -D @nhost/cli
yarn add -D @nhost/cli
bun add -d @nhost/cli

Or run it without installing:

npx @nhost/cli@latest --version
pnpm dlx @nhost/cli@latest --version
yarn dlx @nhost/cli@latest --version
bunx @nhost/cli@latest --version

Quick install (Linux / macOS)

curl -sSL https://raw.githubusercontent.com/nhost/nhost/main/cli/get.sh | bash

Or specify a version:

curl -sSL https://raw.githubusercontent.com/nhost/nhost/main/cli/get.sh | bash -s 1.38.0

Get Started

The steps below are a quick reference. For a guided walkthrough, see the CLI Quickstart.

Authenticate

Only needed to pull configuration from an existing Nhost Cloud project or to deploy — skip it for purely local work.

nhost login

Initialize a project

Scaffolds a nhost/ directory (backend configuration, version-controlled in Git) and a functions/ directory.

nhost init

Or start from an existing Nhost Cloud project:

nhost init --remote

Start the development environment

Spins up the full stack (Postgres, GraphQL, Auth, Storage, Functions) with Docker and prints the local service URLs.

nhost up

The local dashboard runs at https://local.dashboard.local.nhost.run. Stop the stack with nhost down and follow logs with nhost logs.

MCP Server

The Nhost cli ships with an MCP server that lets you interact with your Nhost projects through AI assistants using the Model Context Protocol. It provides secure, controlled access to your GraphQL data, project configuration, and documentation—with granular permissions that let you specify exactly which queries and mutations an LLM can execute. For development, it streamlines your workflow by enabling AI-assisted schema management, metadata changes, and migrations, while providing direct access to your GraphQL schema for intelligent query building.

You can read more about the MCP server in the MCP Server documentation.

Documentation

Build from Source

Make sure you have Go 1.18 or later installed.

The source code includes a self-signed certificate for testing purposes. Nhost workers with configured access to AWS may use the cert.sh script to generate a real certificate from Let's Encrypt.

go build -o /usr/local/bin/nhost

This will build the binary available as the nhost command in the terminal.

Dependencies

Supported Platforms

  • macOS
  • Linux
  • Windows WSL2