Skip to content

[Feature]: Native session search/grep functionality #75

@manoj-pillay-10gen

Description

@manoj-pillay-10gen

What would you like to be added?

As a user, search functionality in old sessions is a major feature gap. I am assuming you might already be working on solving this natively within the CLI, but I wanted to share a workaround I’ve been using in my .zsh to bridge the gap until then:

auggieFind() {
  local search_term=""
  local show_all=false

  # Parse arguments
  while [[ "$#" -gt 0 ]]; do
    case $1 in
      -a|--all) show_all=true ;;
      *) search_term="$1" ;;
    esac
    shift
  done

  if [[ -z "$search_term" ]]; then
    echo "Usage: auggieFind [-a] <search_term>"
    return 1
  fi

  # Find unique files containing the term
  local files=($(grep -l "$search_term" ~/.augment/sessions/*.json 2>/dev/null))

  if [ ${#files[@]} -eq 0 ]; then
    echo "No sessions found containing: $search_term"
    return
  fi

  for file in "${files[@]}"; do
    local id=$(basename "$file" .json)
    echo -e "\033[1;32mID: $id\033[0m"

    if [ "$show_all" = true ]; then
      # Show every match in the file centered around the term
      grep -o ".\{0,50\}$search_term.\{0,70\}" "$file" | sed 's/\\n/ /g'
    else
      # Show only the first match for a quick preview
      grep -m 1 -o ".\{0,50\}$search_term.\{0,70\}" "$file" | sed 's/\\n/ /g'
    fi
    echo -e "\033[0;90m--------------------------------------------------\033[0m"
  done
}

Now I can just run auggieFind 23492 to instantly see when I last talked about that PR and grab the ID to resume the session.

The code is just for illustration to show how I’m currently digging through the JSON logs. Just wanted to report how a user who is grateful for this awesome CLI tool thinks it could be even better.

Why is this needed?

Context switching is the biggest productivity killer. When I'm deep in a repo and need to reference a previous discussion about a specific PR or a specific architectural decision, I shouldn't have to scroll through a generic session list and guess which one it was. Native search makes the "long-term memory" of the CLI actually accessible and actionable.

Possible solution or alternatives

A native auggie search <query> command that:

  • Scans the content fields of local session JSON files.
  • Returns a list of Session IDs with a "snippet" preview of the match.

Ideally, allows for an interactive selection (like the current --resume picker) to jump straight into the chosen session.

Additional context

The current session storage is local JSON, which is great for privacy and grep-ability, but the "wall of text" structure makes standard terminal searches messy. A specialized parser within the CLI would solve this perfectly. I'm currently using a custom .zsh function to clean up the output, but having this "out of the box" would be a huge win for the developer experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions