---
layout: commands
page_title: 'Commands: Fmt'
sidebar_title: 'fmt'
description: 'Rewrite waypoint.hcl configuration to a canonical format'
---

# Waypoint Fmt

Command: `waypoint fmt`

Rewrite waypoint.hcl configuration to a canonical format

@include "commands/fmt_desc.mdx"

## Usage

Usage: `waypoint fmt [options] [FILE]`

Rewrite a waypoint.hcl file to a canonical format.

This only works for HCL-formatted Waypoint configuration files. JSON-formatted
files do not work and will result in an error.

If FILE is not specified, then the current directory will be searched
for a "waypoint.hcl" file. If FILE is "-" then the content will be read
from stdin.

This command does not validate the waypoint.hcl configuration. This will
work for older and newer configuration formats.

#### Global Options

- `-plain` - Plain output: no colors, no animation. The default is false.
- `-app=<string>` (`-a`) - App to target. Certain commands require a single app target for Waypoint configurations with multiple apps. If you have a single app, then this can be ignored.
- `-project=<string>` (`-p`) - Project to target.
- `-workspace=<string>` (`-w`) - Workspace to operate in.

#### Command Options

- `-write` - Overwrite the input file. If this is false, the formatted output will be written to STDOUT. This has no effect when formatting from STDIN. The default is true.

@include "commands/fmt_more.mdx"
