Usage


In general, the usage can be reduced to:

tnt [option]... pattern [directory]

Let's see this in action. For example, if you want to search for redis in the config directory, you would write:

tnt redis config

In case you write

tnt redis it will search within the current directory, just like you were writing tnt redis .

Searching template files

Sometimes, you only want to search a pattern in laravel blade templates files. For example you want all files that have a mailto link:

tnt --blade "mailto:"

Searching PHP files

Just like searching blade files, sometimes you only want to include PHP files:

tnt --php "Controller"

Searching JS files

You can also search for javascript files only

tnt --js "router"

Searching CSS files

You can also search for css files only

tnt --css "float"

Ingoring case sensitivity

By default, TNT Code Search is case sensitive, if you don't know with which case a pattern is written, you might do a case insensitive search:

tnt -i "controller"

Including the vendor folder

TNT Code Search skips the vendor folder, because most of the time, you only need result from your code. In case you still need results form the vendor, you use the vendor flag

tnt --vendor "tntsearch"

Regex

TNT Code Search also supports regular expressions, so if you need to search for a regex pattern you can

tnt "tnt(.*)"