Scut

CLI Reference

scut format

formatting

Format source files through scut's formatter integrations.

scut format is the formatter surface used by hooks and direct agent commands. With no file arguments it is a stdin-to-stdout filter; input that the formatter declines is passed through unchanged. Named files are formatted atomically in place and do not write their contents to stdout.

Each changed file is written to a sibling temporary file, assigned the original mode, synchronized, and renamed over the target. Symbolic links remain links and their resolved targets are replaced. Atomicity is per file: if a later file fails, earlier successful replacements remain committed.

Use --check with one or more named files to perform the same formatting and ignore checks without writing. The command succeeds when every selected file is already formatted and otherwise fails with the changed paths in argument order. Repeated paths are reported once. --force includes paths excluded by .prettierignore or .scutignore in either write or check mode.

Markdown formatting preserves leading Hugo front matter verbatim in YAML, TOML, and JSON forms. If scut cannot safely identify a complete leading front matter block, it leaves the document unchanged rather than risk modifying metadata.

The Markdown formatter uses Goldmark v2 with table, strikethrough, task-list, footnote, and definition-list parsing. It preserves the document’s existing prose wrapping and Setext heading style; aggregate GFM linkification is not enabled.

The direct Markdown command accepts these formatting options:

OptionDefaultBehavior
--prose-wrappreservepreserve retains source prose line breaks, always wraps prose to the print width, and never joins prose lines.
--print-width80Sets the positive target width used by prose wrapping and compact tables.
--tab-width2Sets the positive indentation width used to align list content.
--single-quotedisabledUses single quotes instead of double quotes for link and image titles.

These options apply only to the current direct command invocation. Agent hooks continue to use the stable defaults and do not read persistent formatter configuration.

Generated help

Generated from scut format --help.

Usage: scut format <command> [flags]

Format source code files.

Commands:
  format go          Format Go source files. Reads from stdin if no files
                     specified.
  format markdown    Format Markdown files. Reads from stdin if no files
                     specified.

Flags:
  -h, --help       Show context-sensitive help.
  -v, --version    Print version and exit.

Generated from scut format go --help.

Usage: scut format go [<file> ...] [flags]

Format Go source files. Reads from stdin if no files specified.

Arguments:
  [<file> ...]    Files to format in place. If omitted, reads from stdin and
                  writes to stdout.

Flags:
  -h, --help       Show context-sensitive help.
  -v, --version    Print version and exit.

      --force      Format files even when ignored by .prettierignore or
                   .scutignore.
      --check      Check whether named files are formatted without writing
                   changes.

Generated from scut format markdown --help.

Usage: scut format markdown [<file> ...] [flags]

Format Markdown files. Reads from stdin if no files specified.

Arguments:
  [<file> ...]    Files to format in place. If omitted, reads from stdin and
                  writes to stdout.

Flags:
  -h, --help                     Show context-sensitive help.
  -v, --version                  Print version and exit.

      --force                    Format files even when ignored by
                                 .prettierignore or .scutignore.
      --check                    Check whether named files are formatted without
                                 writing changes.
      --prose-wrap="preserve"    How to wrap prose: preserve, always, or never.
      --print-width=80           Target line width for prose wrapping and
                                 compact tables.
      --tab-width=2              Tab width used for list indentation alignment.
      --single-quote             Use single quotes for link and image titles.