# Prisma CLI Format

> prisma format. Reference when using this Prisma feature.

- Skill: `prisma/prisma-cli-format` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add prisma/prisma-cli-format`
- Raw SKILL.md: https://api.skillmd.com/api/skills/prisma/prisma-cli-format/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: prisma (https://skillmd.com/u/prisma)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/prisma/prisma-cli-format

---


# prisma format

Formats your Prisma schema file.

## Command

```bash
prisma format [options]
```

## What It Does

- Fixes formatting (indentation, spacing)
- Adds missing back-relations (e.g., adds the other side of a relation)
- Adds missing relation arguments (e.g., `fields`, `references`)
- Sorts fields and attributes (opinionated)

## Options

| Option | Description |
|--------|-------------|
| `--schema` | Path to schema file |
| `--config` | Custom path to your Prisma config file |

## Examples

### Format default schema

```bash
prisma format
```

### Format specific schema

```bash
prisma format --schema=./custom/schema.prisma
```

## Behavior

`prisma format` modifies the file in place. It is equivalent to "Prettier for Prisma schemas" but also has semantic understanding to fix/add missing schema definitions.

## Use in Editor

Most Prisma editor extensions (VS Code, WebStorm) run `prisma format` automatically on save. This command is useful for:
- CI pipelines (check formatting)
- CLI-based workflows
- Fixing large schema refactors

