@bemoje/bsilver
v0.3.0
Published
Fast and configurable file content search.
Readme
@bemoje/bsilver
Fast and configurable file content search.
Warning: Private package. Do not expect it to work. Use at own risk.
Installation
# install
npm install @bemoje/bsilver -g
# uninstall
npm uninstall @bemoje/bsilver -g
# help
bsilver --helpHelp
Usage: bsilver [passthrough...] [options]
Version: 0.3.0
Description:
Fast and configurable file content search.
This is a wrapper for 'ag', the silver searcher:
https://github.com/JFLarvoire/the_silver_searcher
To see ag help, run 'ag -h'.
Usage Examples:
bsilver --ext ts REGEX Search ts files with regex
pattern.
bsilver --ext ts --literal STRING Literal string.
bsilver --ignore node_modules --filter "src" REGEX Ignore and filter paths
bsilver --path-to-ignore FILEPATH REGEX Load .ignore file if not in
cwd -> root.
bsilver --ext ts --dryRun Outputs the rendered ag
command that would have been run.
Config:
IDE: code -w
Arguments:
[passthrough...] Args are passed through to the ag command
(default: [])
Search Options:
-m, --match <PATTERN...> File content search patterns. At least one must
match file contents.
-l, --literal Don't parse PATTERN as a regular expression
-i, --ignore-case Match case insensitively
-s, --case-sensitive Match case sensitively
-M, --smart-case Match case insensitively unless PATTERN contains
uppercase characters (Enabled by default)
-v, --invert-match
-w, --word-regexp Only match whole words
File Options:
-e, --ext <exts...> Include file extension.
-H, --hidden Search hidden files (obeys .*ignore files)
-b, --binary Search binary files for matches
-a, --all-types Search all files (doesn't include hidden files or
patterns from ignore files)
-t, --all-text Search all text files (doesn't include hidden
files)
-u, --unrestricted Search all files (ignore .ignore, .gitignore,
etc.; searches binary and hidden files as well)
Traversal Options:
-d, --dir [dirpath] Root directory to search (default: ".")
-I, --ignore <PATTERN...> Ignore files/directories matching PATTERN
(literal file/directory names also allowed)
(default: [])
-f, --filter <PATTERN> Limit search to filepaths matching PATTERN
-F, --depth <NUM> Search up to NUM directories deep (Default: 25)
-p, --path-to-ignore <path> Use .ignore file at path
-U, --skip-vcs-ignores Ignore VCS ignore files (.gitignore, .hgignore;
still obey .ignore)
Output Options:
-L, --files-with-matches Only print filenames that contain matches.
-C, --count print the number of matches in each file.
(default: true)
-S, --silent Suppress all log messages, including errors
-T, --stats Print stats (files scanned, time taken, etc.)
-A, --stats-only Print stats and nothing else.
Extensions Presets:
-B, --batch .bat .cmd
-c, --cc .c .h .xs
-G, --cpp .cpp .cc .C .cxx .m .hpp .hh .h .H .hxx .tpp
-K, --css .css
-n, --html .htm .html .shtml .xhtml
-j, --java .java .properties
-J, --js .es6 .js .jsx .vue
-o, --json .json
-g, --log .log
-k, --make .Makefiles .mk .mak
-N, --md .markdown .mdown .mdwn .mkdn .mkd .md
-q, --php .php .phpt .php3 .php4 .php5 .phtml
-1, --ps1 .ps1
-y, --python .py
-r, --rust .rs
-Q, --shell .sh .bash .csh .tcsh .ksh .zsh .fish
-W, --ts .ts .tsx
-x, --xml .xml .dtd .xsl .xslt .xsd .ent .tld .plist .wsdl
-Y, --yaml .yaml .yml
-P, --presets <names...> Apply preset(s).
Global Options:
-V, --version output the version number
-R, --dryRun Print the command that would be run, but do not
execute it.
-D, --debug Output debugging information.
-h, --help display help for command
Commands:
u |util Utilities (presets, etc.)
Presets:
zip archives
pkgdep find dependency in package.json giles
bintext pdf, word, etc
bin archive and bin text files (zip, pdf, docx, etc)
Subcommands:
Subcommand Usage
bsilver [-m,-l,-i,...] [passthrough...]
bsilver util
bsilver util config
bsilver util config edit
bsilver util config list
bsilver util config get [key]
bsilver util config set <key> <value>
bsilver util config reset [key]
bsilver util presets
bsilver util presets edit
bsilver util presets list
bsilver util presets reset [key]
bsilver util presets delete [key]
bsilver util list [-X,-z]
bsilver util usage
bsilver util filepathLicense
Released under the MIT License.
