Skip to content

st find

b2o2i edited this page Apr 13, 2026 · 2 revisions

st-find — Search for keywords in story containers and prompts

Searches all .json containers in a directory tree for stories matching a keyword. Prints matching titles and file paths.

Examples

st-find keyword                     # search all fields in current dir  
st-find "bicycle*" -t               # search titles for bicycle* (quotes for wildcards)
st-find "*bike*" -t -r              # search titles recursively
st-find "pizza*" template -p        # search prompts in template dir
st-find "AI*" -s                    # search story text
st-find "report*" file.json         # search specific file
st-find "*guide*" ../other -r -v    # recursive verbose search

st-find +pizza +dough -t            # both pizza AND dough required (no quotes!)
st-find +bike ^electric -s          # bike required, electric excluded
st-find +report "AI*" OpenAI -s     # report required, AI* or OpenAI optional
st-find bike bicycle -t             # either bike OR bicycle
st-find +camping ^RV ^electric -t   # camping, but not RV or electric

st-find "deep learning" -t          # exact phrase
st-find "bike*" -t                  # wildcards (* ?) must be quoted
st-find "+pizza +dough" -t          # can quote boolean operators too

Options: -t/--title -p/--prompt -s/--story -a/--all -r/--recursive -v/--verbose

Related: st-ls · st-cat


For developers

Searches for keywords (with wildcards) in titles, prompts, and story content stored in .json containers and .prompt files.

Simple searches:

Boolean Search (combine keywords - no quotes needed for AND/OR/NOT):

Quoted patterns (when needed):

Boolean Operators: +keyword - REQUIRED (must be present, AND logic) ^keyword - EXCLUDED (must not be present, NOT logic) keyword - OPTIONAL (at least one must match, OR logic)

Wildcards:

  • matches any sequence of characters (e.g., "bike*" matches "bicycle", "bike shop") ? matches any single character (e.g., "AI?" matches "AIs", "AIR")

Note: Wildcards (* ?) must be quoted to prevent shell expansion: st-find "bike*" -t # correct st-find bike* -t # incorrect - shell expands * first

Search is case-insensitive by default.

Path Detection: The last argument is treated as a file/directory path if it:

  • Ends in .json or .prompt
  • Contains a / (path separator)
  • Is an existing file or directory Otherwise all arguments are treated as search keywords.

Clone this wiki locally