Skip to content

Instantly share code, notes, and snippets.

@7shi
Created June 26, 2026 08:16
Show Gist options
  • Select an option

  • Save 7shi/3c442c39d31f0995622493ef87c9872a to your computer and use it in GitHub Desktop.

Select an option

Save 7shi/3c442c39d31f0995622493ef87c9872a to your computer and use it in GitHub Desktop.
[sh] A shell script to search for Antigravity CLI artifacts

Overview

This shell script searches for files (artifacts) within the Antigravity CLI brain directory (${HOME}/.gemini/antigravity-cli/brain).

Usage

agyfind [PATTERN]

Behavior

  1. No arguments (agyfind):

    • Searches for all Markdown files (*.md) in the target directory.
    • Outputs their absolute paths sorted by modification time in descending order (newest first).
  2. One argument (agyfind PATTERN):

    • Searches for files matching the specified PATTERN (e.g., *.json or specific_file.md) and outputs their paths (unsorted).
  3. Invalid arguments (More than one argument):

    • Prints usage information to standard error (usage: agyfind [PATTERN]) and exits with status 1.
#!/bin/sh
set -eu
base_dir="${HOME}/.gemini/antigravity-cli/brain"
if [ "$#" -eq 0 ]; then
pattern='*.md'
find "$base_dir" -type f -name "$pattern" -printf '%T@ %P\0' \
| sort -z -k1,1nr \
| while IFS= read -r -d '' entry; do
path=${entry#* }
printf '%s\n' "$base_dir/$path"
done
exit 0
fi
if [ "$#" -ne 1 ]; then
echo "usage: agyfind [PATTERN]" >&2
exit 1
fi
find "$base_dir" -type f -name "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment