Description
A code search tool similar to ack and the_silver_searcher(ag). It supports multi platforms and multi encodings.
The Platinum Searcher alternatives and similar packages
Based on the "Standard CLI" category.
Alternatively, view The Platinum Searcher alternatives based on common mentions on social networks and blogs.
-
urfave/cli
A simple, fast, and fun package for building command line apps in Go -
elvish
Elvish = Expressive Programming Language + Versatile Interactive Shell -
survey
A golang library for building interactive and accessible prompts with full support for windows and posix terminals. -
kingpin
CONTRIBUTIONS ONLY: A Go (golang) command line and flag parser -
pflag
Drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags. -
readline
Readline is a pure go(golang) implementation for GNU-Readline kind library -
mitchellh/cli
A Go library for implementing command-line interfaces. -
docopt.go
A command-line arguments parser that will make you smile. -
liner
Pure Go line editor with history, inspired by linenoise -
cli-init
The easy way to build Golang command-line application. -
mow.cli
A versatile library for building CLI applications in Go -
complete
bash completion written in go + bash completion for go command -
flaggy
Idiomatic Go input parsing with subcommands, positional values, and flags at any position. No required project or package layout and no external dependencies. -
1build
Frictionless way of managing project-specific commands -
carapace-bin
multi-shell multi-command argument completer -
wmenu
An easy to use menu structure for cli applications that prompts users to make choices. -
commandeer
Automatically sets up command line flags based on struct fields and tags. -
ukautz/clif
Another CLI framework for Go. It works on my machine. -
flag
Flag is a simple but powerful command line option parsing library for Go support infinite level subcommand -
cmdr
POSIX-compliant command-line UI (CLI) parser and Hierarchical-configuration operations -
job
JOB, make your short-term command as a long-term job. 将命令行规划成任务的工具 -
carapace
command argument completion generator for spf13/cobra -
wlog
A simple logging interface that supports cross-platform color and concurrency. -
go-getoptions
Fully featured Go (golang) command line option parser with built-in auto-completion support. -
Go-Console
GoConsole: the golang component that eases the creation of beautiful command line interfaces. -
argv
A Go library to split command line string as arguments array using the bash syntax. -
flagvar
A collection of CLI argument types for the Go `flag` package. -
command-chain
A go library for easy configure and run command chains. Such like pipelining in unix shells. -
multi-tailf
watch multiple logs on local or remote servers.
Clean code begins in your IDE with SonarLint
Do you think we are missing an alternative of The Platinum Searcher or a related project?
README
The Platinum Searcher

A code search tool similar to ack
and the_silver_searcher(ag)
. It supports multi platforms and multi encodings.
Features
- It searches code about 3–5× faster than
ack
. - It searches code as fast as
the_silver_searcher(ag)
. - It ignores file patterns from your
.gitignore
. - It ignores directories with names that start with
.
, eg.config
. Use--hidden
option, if you want to search. - It searches
UTF-8
,EUC-JP
andShift_JIS
files. - It provides binaries for multi platform (macOS, Windows, Linux).
Benchmarks
cd ~/src/github.com/torvalds/linux
ack EXPORT_SYMBOL_GPL 30.18s user 2.32s system 99% cpu 32.613 total # ack
ag EXPORT_SYMBOL_GPL 1.57s user 1.76s system 311% cpu 1.069 total # ag: It's faster than ack.
pt EXPORT_SYMBOL_GPL 2.29s user 1.26s system 358% cpu 0.991 total # pt: It's faster than ag!!
Usage
$ # Recursively searches for PATTERN in current directory.
$ pt PATTERN
$ # You can specify PATH and some OPTIONS.
$ pt OPTIONS PATTERN PATH
Configuration
If you put configuration file on the following directories, pt use option in the file.
- $XDG_CONFIG_HOME/pt/config.toml
- $HOME/.ptconfig.toml
- .ptconfig.toml (current directory)
The file is TOML format like the following.
color = true
context = 3
ignore = ["dir1", "dir2"]
color-path = "1;34"
The options are same as command line options.
Editor Integration
Vim + Unite.vim
You can use pt with Unite.vim.
nnoremap <silent> ,g :<C-u>Unite grep:. -buffer-name=search-buffer<CR>
if executable('pt')
let g:unite_source_grep_command = 'pt'
let g:unite_source_grep_default_opts = '--nogroup --nocolor'
let g:unite_source_grep_recursive_opt = ''
let g:unite_source_grep_encoding = 'utf-8'
endif
Emacs + pt.el
You can use pt with pt.el, which can be installed from MELPA.
Installation
Developer
$ go get -u github.com/monochromegane/the_platinum_searcher/...
User
Download from the following url.
Or, you can use Homebrew (Only macOS).
$ brew install pt
pt
is an alias for the_platinum_searcher
in Homebrew.
Contribution
- Fork it
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the
go test ./...
command and confirm that it passes - Run
gofmt -s
- Create new Pull Request
License
Author
*Note that all licence references and agreements mentioned in the The Platinum Searcher README section above
are relevant to that project's source code only.