# Install ktfmt with Homebrew, Nix

Kotlin code formatter. Version 0.64 via Homebrew; verified 2026-06-24.

## Install

```sh
sudo av install brew:ktfmt
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install ktfmt
```

  Evidence: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#ktfmt
```

  Evidence: nixpkgs package indexes: pkgs/by-name/kt/ktfmt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:ktfmt
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/ktfmt>
- **Version:** 0.64
- **Source summary:** Kotlin code formatter
- **Homepage:** <https://facebook.github.io/ktfmt/>
- **Repository:** <https://github.com/facebook/ktfmt>
- **Upstream docs:** <https://facebook.github.io/ktfmt>
- **License:** Apache-2.0
- **Source archive:** <https://github.com/facebook/ktfmt/archive/refs/tags/v0.64.tar.gz>
- **Last updated:** 2026-06-24T03:35:16Z
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- ktfmt (cli)
- ktfmt (alias)

## Dependencies

- openjdk@17

## Build dependencies

- gradle

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 0.64
- Package-manager updated: 2026-06-24
- Local data: ok
- Upstream repository: https://github.com/facebook/ktfmt
- Upstream latest detected: v0.64 (current)
## Project history and usage

ktfmt is Meta's Kotlin formatter, built to pretty-print Kotlin code deterministically and with minimal style choice. The project describes itself as based on google-java-format and intentionally non-customizable to promote consistency.

### Project history

The repository README describes ktfmt as a formatter that reformats Kotlin source code and compares its output with ktlint and IntelliJ formatting. Its website emphasizes that the same input always receives the same output, regardless of initial layout, so developers can avoid style debates.

### Adoption history

ktfmt is consumed both as a command-line jar and through integrations: a JetBrains IDE plugin, Gradle and Maven examples, Spotless integration, Maven Central artifacts, and Homebrew packaging. That puts it in the same culture as gofmt and google-java-format, where a formatter's value is partly social: teams agree to stop arguing about layout.

### How it is used

Users run ktfmt from the command line, through build tooling, through Spotless, or through the IntelliJ and Android Studio plugin. The README documents editorconfig use for approximating ktfmt behavior in IDE editing and command-line options for whole-file or partial formatting.

### Why package nerds care

ktfmt matters to package people because it packages style as an executable policy. It is a Kotlin example of formatter distribution via Maven Central, IDE plugins, build plugins, jars, and Homebrew, with very little configuration surface by design.

### Timeline

- 2024-10-30: The v0.53 tag was published in the GitHub tag history.
- 2025-06-25: The v0.56 tag was published in the GitHub tag history.
- 2026-03-17: The v0.62 tag was published in the GitHub tag history.
- 2026-06-24: Release 0.64 was published on GitHub.

### Related projects

- Related projects include google-java-format, ktlint, IntelliJ IDEA formatting, Android Studio, Spotless, Gradle, Maven, and Kotlin coding conventions.

### Sources

- <https://facebook.github.io/ktfmt/>
- <https://github.com/facebook/ktfmt>
- <https://github.com/facebook/ktfmt/releases>
- <https://github.com/facebook/ktfmt/tags>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: .editorconfig
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** ktfmt
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## Other Package-Manager Records

- Nix - ktfmt: normalized package name match | nixpkgs package indexes: pkgs/by-name/kt/ktfmt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [openjdk@17](https://www.automicvault.com/pkg/brew/openjdk-17/) - Runtime dependency declared by Homebrew.
- [gradle](https://www.automicvault.com/pkg/brew/gradle/) - Build dependency declared by Homebrew.
- [scalariform](https://www.automicvault.com/pkg/brew/scalariform/) - Shares av.db curated category or tags: cli, code-formatting, code-style, developer-tools, formatter.
- [black](https://www.automicvault.com/pkg/brew/black/) - Shares av.db curated category or tags: cli, code-formatting, code-style, developer-tools, formatter.
- [gersemi](https://www.automicvault.com/pkg/brew/gersemi/) - Shares av.db curated category or tags: cli, code-formatting, code-style, developer-tools, formatter.
- [ktlint](https://www.automicvault.com/pkg/brew/ktlint/) - Shares av.db curated category or tags: cli, developer-tools, formatter, kotlin.
- [swiftformat](https://www.automicvault.com/pkg/brew/swiftformat/) - Shares av.db curated category or tags: cli, code-formatting, code-style, developer-tools, formatter.
- [air](https://www.automicvault.com/pkg/brew/air/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, formatter.
- [alejandra](https://www.automicvault.com/pkg/brew/alejandra/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, formatter.
- [astyle](https://www.automicvault.com/pkg/brew/astyle/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, formatter.

## Combined YAML source

View the package source record on GitHub. [combined/ktfmt.yml](https://github.com/automic-vault/db/blob/main/combined/ktfmt.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
