Sag

Search and Grep - powerful code search across repositories and file systems. Use when this capability is needed.

tomevault-io Updated

File contents

SAG (Search and Grep)

Fast code search using ripgrep.

Basic Search

rg "pattern" /path/to/search

Search by File Type

rg "function" --type ts
rg "class" --type py

Search with Context

rg "TODO" -C 3

Search and Replace

rg "old_name" --files-with-matches | xargs sed -i '' 's/old_name/new_name/g'

Useful Flags

  • -i — case insensitive
  • -w — whole word match
  • -l — files only
  • -c — count matches
  • --hidden — include hidden files
  • --glob '!node_modules' — exclude patterns

Converted and distributed by TomeVault — claim your Tome and manage your conversions.

tomevault-io/skills-registry/tree/main/kody-w--openrappter--sag commit db7ae29139

Frequently asked questions

npx skillmds@latest add tomevault-io/sag-8