Loading...
Loading...
A CLI tool that searches inside class and className attributes and matches against each class name individually. Use this instead of grep when searching or replacing class names.
npx skill4agent add yuichiroharai/classname-search classname-searchecho --%--%--% '^flex$'npx -y node -e "console.log(process.argv[1])" "^test"test^test^^^^flex$^^flex$[!WARNING]
AI manual counting is unreliable. Always use this command to count class names.
npx classname-search stats 'src/**/*.jsx' 'text-'src/components/Header.jsx: 3 matches
src/components/Main.jsx: 4 matches
Total: 7 matches in 2 files[!NOTE]
By default, only files containing matched class names are listed.
Use theoption if you want to include files with 0 matches in the output.--verbose
npx classname-search search 'src/components/**/*.jsx' 'flex'{"file":"src/components/Header.jsx","line":3,"matched":"flex","className":"flex","classValue":"flex flex-col"}
{"file":"src/components/Header.jsx","line":3,"matched":"flex","className":"flex-col","classValue":"flex flex-col"}
{"file":"src/components/Header.jsx","line":4,"matched":"flex","className":"inline-flex","classValue":"inline-flex"}[!IMPORTANT]
is the regex match;matchedis the full class name containing that match.className
npx classname-search search 'src/components/**/*.jsx' 'flex' > 'filename.jsonl'npx classname-search replace 'src/components/**/*.jsx' -- '-slate-(\d+)$' '-neutral-$1'Replaced 8 matches of "-slate-(\d+)$" with "-neutral-$1" in 3 files.npx classname-search remove 'src/components/**/*.jsx' '^font-normal$'Removed 5 matches of "^font-normal$" with "" in 2 files.https://raw.githubusercontent.com/yuichiroharai/classname-search/main/README.md