> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://gtm-tools.sh/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://gtm-tools.sh/_mcp/server.

# CLI

> gtm-tools is a single npm-installable binary that fronts every tool through one bearer token. Namespaces: admin, socials, reddit, email, signals, mcp, extension, update.

## Getting started

The GTM Tools CLI lets you call every tool directly from your terminal. Qualify accounts on buying signals, look up a company or a person on LinkedIn, verify an email, engage on Reddit, and manage the wallet, all without writing code.

### Installation

Install with curl:

```bash
curl -fsSL https://api.gtm-tools.sh/cli/install.sh | bash
```

Install with npm:

```bash
npm install -g @gtm-tools/cli
```

### Authentication

Sign in through the browser once and the CLI stores the key for you:

```bash
gtm-tools admin login
```

Credentials land in `~/.gtm-tools/config.json` (chmod 600), so every later call picks them up automatically, and so does the [browser extension](/extension) through the native helper. No `export` needed. `gtm-tools admin logout` clears them.

To use a key you already have, set it as an environment variable instead:

```bash
export GTM_TOOLS_API_KEY=sk_...
```

Or pass it directly with the `--api-key` flag. Get a key with [`get_api_key`](/knowledge-base/getting-started/getting-api-key), and on a box that cannot open a browser use the code flow: `gtm-tools admin auth you@yourcompany.com`, then the same command with `--code 123456`.

## Usage

Commands follow the pattern:

```bash
gtm-tools <namespace> <command> [args] [flags]
```

Namespaces: `admin`, `socials`, `reddit`, `email`, `signals`, `mcp`, `extension`, `update`.

Some namespaces nest a subcommand:

```bash
gtm-tools admin keys list
```

Use `--help` on the CLI, a namespace, or any command for the full flag list.

## Examples

```bash
# Qualify a domain on buying signals
gtm-tools signals detect gymshark.com

# Domain to LinkedIn company page
gtm-tools socials company-url siena.cx

# Decision-makers, filtered before you pay for hydration
gtm-tools socials employees gorgias.com --filter "(CEO OR CTO OR Founder) NOT intern" --limit 25

# SMTP-verified professional email
gtm-tools email find --name "Justin Mares" --domain kettleandfire.com

# A Reddit thread with its full comment tree
gtm-tools reddit post "https://www.reddit.com/r/SaaS/comments/1abcde/some_slug/"

# Balance and per-tool costs
gtm-tools admin balance
```

## Features

* **One binary for the whole surface.** LinkedIn, Reddit, email finding, signals, and billing, on the same auth as MCP and REST. (`get_coordinates` is the one tool without a CLI command; call it over HTTP instead, see the [API Reference](/api-reference).)
* **Browser sign-in.** `gtm-tools admin login` opens WorkOS in your browser and stores the key at `~/.gtm-tools/config.json` (chmod 600). No `export` needed.
* **Shared credentials.** The [browser extension](/extension) reads the same stored key through the native helper, so Connect works without a second sign-in.
* **MCP config patching.** `gtm-tools mcp add --client claude-desktop` edits the client's config file in place.
* **Self-updating.** `gtm-tools update` swaps the binary in place; every command also runs a cached background version check.
* **Script-friendly.** JSON on stdout, non-zero exit on failure.

## Global flags

Available on every command:

| Flag                | Effect                                                                                     |
| ------------------- | ------------------------------------------------------------------------------------------ |
| `--api-key <key>`   | Use this key instead of `GTM_TOOLS_API_KEY` or the stored config                           |
| `--url <url>`       | Point at a different API base (default `https://api.gtm-tools.sh`, or `GTM_TOOLS_API_URL`) |
| `--format <format>` | `json` (default), `compact`, or `table`. See [Output formats](#output-formats)             |
| `--json`            | Alias for `--format compact`                                                               |
| `--version`         | Print the CLI version                                                                      |
| `--help`            | Print help for the CLI, a namespace, or a command                                          |

## Output formats

Control how results are displayed with the `--format` flag:

* `json`: pretty-printed JSON (default)
* `compact`: single-line JSON, for piping and logs
* `table`: aligned columns, for responses that contain a list

`table` falls back to JSON when a response has nothing tabular in it. Everything goes to stdout, so any format pipes into `jq`; errors go to stderr with a non-zero exit code.

```bash
# Just the LinkedIn URL
gtm-tools socials company-url siena.cx | jq -r '.url'

# Scan a list of domains for signals that fired
for d in gymshark.com mammaly.de kettleandfire.com; do
  gtm-tools signals detect "$d" | jq '.signals[] | select(.fired == true) | .name'
done
```

## AI skill

The CLI is also available as an Agent Skills skill, allowing AI coding assistants to use it on your behalf. Install it with:

```bash
npx skills add arnaudjnn/gtm-skills --skill gtm-tools
```

This works with any compatible tool, including OpenClaw, Claude Code, Cursor, and Codex. See the [Agent Onboarding](/integrations/agent-onboarding#gtm-tools-skills) page for more details.