feat/002_init-remote
Raw Download raw file

tissue search / tissue grep

Search through issues for specific content.

Tissue Commands

# Search all issue content
tissue search "memory leak"

# Search specific fields
tissue search "auth" --in title,tags

# Grep with regex
tissue grep "TODO|FIXME" --body-only

Manual Workflow (bash + git)

# Search in all issues
cd ../issues
grep -r "memory leak" *.md

# Case-insensitive search
grep -ri "memory leak" *.md

# Show line numbers
grep -rn "memory leak" *.md

Search with context

# Show lines before and after match
cd ../issues
grep -B 2 -A 2 "memory leak" *.md

# Search and show filename only
grep -l "memory leak" *.md

Search in specific parts of issues

# Search only in titles using yq
search_titles() {
    SEARCH_TERM="$1"
    cd ../issues

    for file in *.md; do
        [ -f "$file" ] || continue
        [ "$file" = "README.md" ] && continue

        # Extract title using yq and check for match
        TITLE=$(yq --front-matter '.title // ""' "$file" 2>/dev/null)
        if echo "$TITLE" | grep -qi "$SEARCH_TERM"; then
            echo "${file}: ${TITLE}"
        fi
    done
}

search_titles "auth"

Search in issue body only

# Search body content (skip frontmatter)
search_body() {
    SEARCH_TERM="$1"
    cd ../issues

    for file in *.md; do
        [ -f "$file" ] || continue
        [ "$file" = "README.md" ] && continue

        # Extract body (everything after frontmatter)
        # Note: yq processes frontmatter, so we use sed to get body
        BODY=$(sed -n '/^---$/,/^---$/d; p' "$file")

        if echo "$BODY" | grep -qi "$SEARCH_TERM"; then
            echo "=== ${file} ==="
            echo "$BODY" | grep -i --color=auto "$SEARCH_TERM"
            echo ""
        fi
    done
}

search_body "TODO"

Search in tags

# Search for issues with specific tags using yq
search_by_tag() {
    TAG="$1"
    cd ../issues

    for file in *.md; do
        [ -f "$file" ] || continue
        [ "$file" = "README.md" ] && continue

        # Check if tag exists using yq
        HAS_TAG=$(yq --front-matter '.tags // [] | contains(["'"$TAG"'"])' "$file" 2>/dev/null)

        if [ "$HAS_TAG" = "true" ]; then
            TITLE=$(yq --front-matter '.title // ""' "$file")
            TAGS=$(yq --front-matter '.tags | join(", ") // ""' "$file")
            echo "${file}: ${TITLE} [${TAGS}]"
        fi
    done
}

search_by_tag "bug"
# Using extended regex
cd ../issues
grep -E "(TODO|FIXME|HACK|XXX)" *.md

# Search for patterns
grep -E "^[[:space:]]*- \[ \]" *.md  # Find unchecked checkboxes
grep -E "^## (Problem|Solution)" *.md # Find sections

Full-text search with ripgrep

# If ripgrep is installed (much faster)
cd ../issues
rg "memory leak"

# Search with type filtering
rg -t md "memory leak"

# Search with pretty output
rg --pretty "memory leak"

Search across multiple fields

# Combined search function using yq
search_issues() {
    local search_term="$1"
    local search_in="${2:-all}"  # Default to all

    cd ../issues

    for file in *.md; do
        [ -f "$file" ] || continue
        [ "$file" = "README.md" ] && continue

        local found=false
        local matches=""

        case "$search_in" in
            title|titles)
                TITLE=$(yq --front-matter '.title // ""' "$file" 2>/dev/null)
                if echo "$TITLE" | grep -qi "$search_term"; then
                    found=true
                    matches="Title: $TITLE"
                fi
                ;;

            tags|tag)
                TAGS=$(yq --front-matter '.tags | join(", ") // ""' "$file" 2>/dev/null)
                if echo "$TAGS" | grep -qi "$search_term"; then
                    found=true
                    matches="Tags: $TAGS"
                fi
                ;;

            body)
                BODY=$(sed -n '/^---$/,/^---$/d; p' "$file")
                if echo "$BODY" | grep -qi "$search_term"; then
                    found=true
                    matches=$(echo "$BODY" | grep -i "$search_term" | head -3)
                fi
                ;;

            all|*)
                # Search everywhere
                if grep -qi "$search_term" "$file"; then
                    found=true
                    matches=$(grep -i "$search_term" "$file" | head -3)
                fi
                ;;
        esac

        if $found; then
            echo "=== $file ==="
            echo "$matches"
            echo ""
        fi
    done
}

# Usage examples
search_issues "auth" "title"
search_issues "bug" "tags"
search_issues "TODO" "body"

What tissue does for you:

  1. Indexes issues for instant searching
  2. Provides ranked/scored results
  3. Supports complex query syntax
  4. Searches across fields intelligently
  5. Highlights matches in output
  6. Provides search history
  7. Integrates with fuzzy finding
  8. Caches search results
  9. Supports saved searches
  10. Provides search suggestions