# Overview

> Install the Mynth CLI, log in with a browser approval, and generate images, manage keys, webhooks and destinations, and read these docs from the terminal.

The Mynth CLI works from a terminal or an agent's shell. It generates and
analyzes images, reads tasks, and manages API keys, webhooks, and
destinations. With `--json`, its output is stable enough to parse, and its
exit codes tell scripts what went wrong.

## Install

Node.js 20 or newer. Install globally for the `mynth` binary:

```bash
npm install -g @mynthio/cli
mynth --help
```

Or run any command without installing, as the examples in these docs do:

```bash
npx @mynthio/cli --help
```

## Log in

```bash
npx @mynthio/cli auth login
```

The CLI prints a one-time code and opens your browser to approve it. It then
creates an API key and stores it on this machine. [Logging in](https://mynth.io/docs/sdks/cli/logging-in.md)
covers where the key lives and which credential each command sends.

## Generate an image

```bash
npx @mynthio/cli image generate \
  -m black-forest-labs/flux.2-pro \
  -p "A lighthouse at dusk, film grain"
```

The command waits and prints the image URL. Add `-o ./images` to save the
file, or `--json` for machine-readable output.

## Without an account

`docs` and `models list` work without logging in:

```bash
npx @mynthio/cli docs get getting-started
npx @mynthio/cli models list --type image
```

## Next steps

- [Logging in](https://mynth.io/docs/sdks/cli/logging-in.md): the stored key, and which credential is sent.
- [Commands](https://mynth.io/docs/sdks/cli/commands.md): every command, its flags, and exit codes.
