Automic VaultAutomic Vault

brew

Install topfew with Homebrew, MacPorts, Nix

Finds the field values which appear most often in a stream of records. Version 2.0.0 via Homebrew; verified from local package data.

install

Additional install commands

macOS

Homebrewverified · 100%
brew install topfew

local Homebrew formula metadata

MacPortsverified · 94%
sudo port install topfew

MacPorts ports tree · textproc/topfew/Portfile · source: api.github.com

Linux

Nixverified · 92%
nix profile install nixpkgs#topfew

nixpkgs package indexes · pkgs/by-name/to/topfew/package.nix · source: api.github.com

overview

Package summary

Finds the field values which appear most often in a stream of records

Commands and aliases

  • topfew

history

Project history and usage

topfew is a Go command-line utility for finding the most frequent records or field combinations in text streams and files. It packages a familiar Unix analysis pattern into a faster, purpose-built binary.

Project history

Tim Bray created Topfew as a utility for counting common values in streams of records, with the README crediting his version 0.1 and later work toward 1.0 to ideas from Dirkjan Ochtman and Simon Fell. The project reached a documented 1.0 release in April 2024, and the current README describes release 2.0.

The design is explicitly close to traditional shell composition: the README states that its result can be duplicated with awk, grep, sed, sort, uniq, and head, but argues that Topfew is for cases where performance matters on large inputs. The examples are package-nerd friendly: Apache logs, quoted fields, grep/vgrep filters, sed-style cleanups, and multi-threaded file processing.

Adoption history

topfew is niche but packaged beyond its source repository. The input package metadata lists Homebrew, MacPorts, and Nix package names, matching its role as a small single-purpose CLI that is useful enough to show up in Unix package collections.

How it is used

The basic form is `topfew --fields 1 access_log`, which finds the most common first field in an Apache log. More advanced use combines field selection, regex separators, grep and inverse-grep filters, sed-style transformations, quoted-field parsing, output limits, and worker counts.

Why package nerds care

topfew matters to package nerds because it is a performance-oriented replacement for a shell pipeline they already know. It is the sort of small binary people install from Homebrew or Nix when a log-analysis one-liner becomes too slow or too hard to repeat.

Timeline

  • 2020: Author blog posts describe Topfew as a small utility replacing the `sort | uniq -c | sort -rn | head` pattern.
  • 2024: Tim Bray announced Topfew 1.0.
  • Current: README describes release 2.0 and documents Homebrew-friendly CLI usage.

Related projects

  • awk, grep, sed, sort, uniq, head, Apache httpd logs, Go runtime.

security posture

Risk level: blue

broad file, network, media, or database tool signal.

Risk classifier

blue risk · medium confidence · tool

Why

  • broad file, network, media, or database tool signal

Signals

  • text:stream,record

Install behavior

  • No Homebrew post-install hook is recorded in formula metadata.
  • Homebrew bottle metadata is available for 10 platform targets.
  • Build metadata lists 1 build dependencies.

Recommended review

Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.

executables

Installed executables

CommandKindExposureNote
topfewcliglobal executable

freshness

Version and freshness

These signals separate page generation age, package-manager activity, and upstream release comparison. Version lag is warned only when an evidence URL and comparable versions are present.

page generated2026-07-08
manager version2.0.0
manager updated
local dataok
upstreamcurrent
latest detectedv2.0.0

https://github.com/timbray/topfew

  • infoNo package-manager update timestamp was available.low confidence

install metadata

Package metadata

Package keybrew:topfew
Version2.0.0
Package managerHomebrew
Package manager pagehttps://formulae.brew.sh/formula/topfew
Homepagehttps://github.com/timbray/topfew
Repositoryhttps://github.com/timbray/topfew
Upstream docshttps://github.com/timbray/topfew#readme
LicenseGPL-3.0-or-later
Source archivehttps://github.com/timbray/topfew/archive/refs/tags/v2.0.0.tar.gz
Build dependenciesgo
Bottleavailable (on arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, monterey, sonoma, ventura, x86_64_linux)
Homebrew post-installnot defined
Servicenone declared

registry facts

Source database details

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Nametopfew
Version Scheme0
Revision0
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyno
URL Keys
  • stable

source database matches

Other package-manager records

Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.

Nix95%

topfew

nix profile install nixpkgs#topfew
  • normalized package name match
  • Matched by: Topfew
nixpkgs package indexes · api.github.com · nixpkgs package indexes: pkgs/by-name/to/topfew/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
MacPorts95%

topfew

sudo port install topfew
  • normalized package name match
  • Matched by: Topfew
MacPorts ports tree · api.github.com · MacPorts ports tree: textproc/topfew/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

source trail

Generated from repository data

This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.

Used sources

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