Nahook CLI

The official Nahook command-line tool — trigger events, inspect deliveries, and manage endpoints from your terminal.

The Nahook CLI (nahook) is the fastest way to interact with Nahook from a terminal. Trigger events, inspect deliveries, debug failed webhooks, and manage endpoints without leaving your shell.

The CLI also ships an embedded Model Context Protocol server as the nahook mcp serve subcommand — see the MCP server docs for installing it in Claude Desktop, Cursor, and other AI assistants.

How to install the Nahook CLI on macOS, Linux, and Windows

brew install getnahook/tap/nahook
curl -fsSL https://cli.nahook.com/install.sh | sh
go install github.com/getnahook/nahook-cli/cmd/nahook@latest

The install script verifies the SHA-256 checksum of the release archive and offers to install shell completions for bash, zsh, and fish. Set NAHOOK_NO_COMPLETION=1 to skip the completion step.

Windows binaries are published to GitHub Releases but no Windows installer is available yet. Download nahook_<version>_windows_amd64.zip, extract nahook.exe, and add it to PATH.

How to authenticate the CLI: nahook login

The CLI uses a browser-based device authorization flow — no need to manually copy API keys.

nahook login

This opens your browser, prompts you to pick a workspace, and writes credentials to ~/.nahook/config.toml. The CLI token expires after 90 days of inactivity; daily use keeps it alive automatically.

To verify:

nahook whoami

To log out:

nahook logout

Authentication: CLI token vs ingestion key

The CLI uses two separate credentials for distinct surfaces:

TokenUsed byHow to provide
CLI token (nhc_…)endpoints, events, dashboard-equivalent operationsnahook login (stored automatically)
Ingestion key (nhk_…)nahook send, nahook triggerNAHOOK_INGESTION_KEY env var, or ingestion_key = "nhk_..." in ~/.nahook/config.toml

The ingestion key is the same one your SDKs use — copy it from any environment in your dashboard.

Quickstart: send your first webhook in 5 minutes

# 1. Install
brew install getnahook/tap/nahook

# 2. Authenticate
nahook login

# 3. See what's in the workspace
nahook endpoints list

# 4. Send a test webhook to one endpoint
export NAHOOK_INGESTION_KEY=nhk_us_your_key
nahook send ep_your_endpoint --data '{"order_id": "ord_42"}'

# 5. Trace what happened
nahook events list --endpoint ep_your_endpoint
nahook events get del_xxxxx --include-payload
nahook events attempts del_xxxxx

Nahook CLI command reference

nahook login

Authorize this device against a Nahook workspace via browser-based device grant.

nahook login

nahook logout

Revoke the local CLI token and remove stored credentials.

nahook logout

nahook whoami

Show the current CLI token, workspace, and region. Reads local config only — no network call.

nahook whoami

nahook endpoints

Manage webhook endpoints in the current workspace.

nahook endpoints list
nahook endpoints get ep_xxx
nahook endpoints create --url https://example.com/hook --type webhook
nahook endpoints update ep_xxx --is-active=false
nahook endpoints delete ep_xxx

nahook events

Inspect and replay webhook deliveries.

# List deliveries for an endpoint
nahook events list --endpoint ep_xxx

# Filter by status, paginate
nahook events list --endpoint ep_xxx --status failed --limit 100
nahook events list --endpoint ep_xxx --all     # walk every page

# Inspect one delivery
nahook events get del_xxx
nahook events get del_xxx --include-payload    # also fetch the original body

# See per-attempt logs
nahook events attempts del_xxx

# Re-enqueue a failed or dead-lettered delivery
nahook events resend del_xxx

nahook send

Send a webhook directly to one endpoint, bypassing event-type fan-out.

nahook send ep_xxx --data '{"orderId":"o_1"}'
nahook send ep_xxx --data @body.json
cat body.json | nahook send ep_xxx --data -
nahook send ep_xxx --data '{...}' --idempotency-key key_123

nahook trigger

Fire an event and let Nahook fan it out to every endpoint subscribed to the given event type.

nahook trigger order.created --data '{"orderId":"o_1"}'
nahook trigger order.created --data @body.json
cat body.json | nahook trigger order.created --data -

nahook mcp serve

Run the embedded Model Context Protocol server over stdio. Meant to be launched as a subprocess by an MCP client (Claude Desktop, Cursor, Cline, …), not run directly. This local server exposes the full toolset, including the production event-firing tools.

Prefer zero install? Nahook also runs a hosted MCP server at https://mcp.nahook.com/ that connects over OAuth — no binary, no keys. See the MCP server docs for both options and client-specific setup.

Output format: tables, JSON, and piping to jq

The CLI is TTY-aware: tables when stdout is a terminal, JSON when piped, and --json to force JSON in either case.

nahook endpoints list                 # table
nahook endpoints list | jq            # JSON (auto-detected pipe)
nahook endpoints list --json | jq     # explicit JSON

Configuration: ~/.nahook/config.toml and environment variables

Credentials and settings live in ~/.nahook/config.toml. Override the directory for CI, sandboxed environments, or per-project credentials:

NAHOOK_CONFIG_DIR=$PWD/.nahook nahook login

To point at a non-default API host (self-hosted or staging):

NAHOOK_API_URL=https://api-staging.nahook.com nahook login

Source code

getnahook/nahook-cli

GitHub repository, install script, release notes