---
title: "CLI Quickstart"
description: "Create, inspect, and update a diagram from the command line."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.merfolk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Quickstart

This guide covers the CLI workflow. If you are new to Merfolk, start with the [product quickstart](/getting-started/quickstart) to understand how the web app, CLI, and coding agents work together.

## 1. Connect your account

Run:

```sh
merfolk login
```

Use your account to authenticate the CLI before running commands that access private diagrams or team resources.

## 2. Create a diagram

```sh
merfolk diagrams create --title "My first diagram"
```

The CLI returns the new diagram's ID and a link to view it at [app.merfolk.io](https://app.merfolk.io).

You can also provide Mermaid source when you create the diagram:

```sh
merfolk diagrams create \
  --title "My first diagram" \
  --content "graph TD\n  Browser --> API\n  API --> Database"
```

## 3. List your diagrams

```sh
merfolk diagrams list
```

Or get structured output for scripting:

```sh
merfolk diagrams list --json
```

## 4. Get a diagram

```sh
merfolk diagrams get <id>
```

This prints the diagram's Mermaid source to stdout.

## 5. Edit a diagram

```sh
merfolk diagrams edit <id> --content "graph TD\n  Browser --> API\n  API --> Queue"
```

Or pipe content from a file:

```sh
cat diagram.mmd | merfolk diagrams edit <id>
```

Open the diagram in the [web app](https://app.merfolk.io) to review the rendered result, share it, or collect comments from collaborators.

## What's next?

- Browse the full [CLI reference](/cli/overview) for all flags and options.
- Read about [comments and collaboration](/web/diagrams/comments) to review feedback on the diagram.
- Read the [Agents guide](/agents/overview) to use Merfolk from coding agents.

Source: https://docs.merfolk.io/cli/quickstart/index.mdx
