# generate_langgraph_json

> **Function** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/server/generate_langgraph_json)

Generate a `langgraph.json` config file for `langgraph dev`.

## Signature

```python
generate_langgraph_json(
    output_dir: str | Path,
    *,
    graph_ref: str = './server_graph.py:graph',
    env_file: str | None = None,
    checkpointer_path: str | None = None,
) -> Path
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `output_dir` | `str \| Path` | Yes | Directory to write the config file. |
| `graph_ref` | `str` | No | Python module:variable reference to the graph. (default: `'./server_graph.py:graph'`) |
| `env_file` | `str \| None` | No | Optional path to an env file. (default: `None`) |
| `checkpointer_path` | `str \| None` | No | Import path to an async context manager that yields a `BaseCheckpointSaver`. When set, the server persists checkpoint data to disk instead of in-memory. (default: `None`) |

## Returns

`Path`

Path to the generated config file.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/0b13f3e0e2726fdb7bbe1e0cf88dac76dbd43b01/libs/cli/deepagents_cli/server.py#L85)