Metadata-Version: 2.4
Name: flowmd
Version: 0.1.0
Summary: Convert API flows (curl commands or DSL) into Mermaid diagrams in Markdown
License: MIT
Project-URL: Homepage, https://github.com/nerd-sphere/flowmd
Project-URL: Repository, https://github.com/nerd-sphere/flowmd
Keywords: mermaid,diagram,api,documentation,cli
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Documentation
Classifier: Topic :: Software Development :: Documentation
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# flowmd

Convert API flows into Mermaid diagrams in Markdown. Zero config.

Paste real curl commands or write a simple DSL — get a `.md` file you can drop
into GitHub, Notion, Confluence, or any Markdown-based doc tool.

## Install

```bash
pip install flowmd
```

## Usage

### From a DSL file

Create a `.flow` file:

```
user -> auth-service: POST /login
  body: { email, password }
  response: 200 { token }

user -> api-gateway: GET /profile
  headers: Authorization: Bearer {token}
  response: 200 { name, email }

api-gateway -> user-service: GET /users/{id}
  response: 200 { name, email }
```

Run:

```bash
flowmd api.flow
```

Output (`flow.md`):

```mermaid
sequenceDiagram
    participant user
    participant auth-service
    participant api-gateway
    participant user-service
    user->>auth-service: POST /login { email, password }
    auth-service-->>user: 200 { token }
    user->>api-gateway: GET /profile
    api-gateway-->>user: 200 { name, email }
    api-gateway->>user-service: GET /users/{id}
    user-service-->>api-gateway: 200 { name, email }
```

### From curl commands

```bash
cat requests.txt | flowmd
# or
flowmd requests.txt
```

### Flow graph format

```bash
flowmd api.flow --format graph
```

Output:

```mermaid
graph LR
    user -->|POST /login| auth-service
    user -->|GET /profile| api-gateway
    api-gateway -->|GET /users/id| user-service
```

### Options

| Flag | Description |
|------|-------------|
| `-o, --output` | Output file path (default: `flow.md`) |
| `--format` | `sequence` (default) or `graph` |

## DSL Reference

```
<from> -> <to>: <METHOD> <path>
  body: <anything>           # optional
  headers: <anything>        # optional
  response: <status> <body>  # optional
```

## License

MIT
