Created
January 20, 2026 21:26
-
-
Save pagelab/3bd2dbf38f6c7da6d00e8df8119fa3c2 to your computer and use it in GitHub Desktop.
Sync all Claude Code commands with Google Antigravity workflows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # --- Sync commands from all subfolders in .claude/commands --- | |
| GEMINI_WORKFLOWS="/Users/mac/.gemini/antigravity/global_workflows" | |
| CLAUDE_COMMANDS="/Users/mac/.claude/commands" | |
| if [ -d "$CLAUDE_COMMANDS" ]; then | |
| # Iterate through each subfolder (1 level deep) | |
| for cmd_dir in "$CLAUDE_COMMANDS"/*/; do | |
| [ -d "$cmd_dir" ] || continue | |
| prefix=$(basename "$cmd_dir") | |
| [[ "$prefix" == .* ]] && continue | |
| # Find all .md files in this subfolder (including nested subdirectories) | |
| find "$cmd_dir" -name "*.md" -type f | while read -r command_file; do | |
| # Get the relative path from cmd_dir | |
| rel_path="${command_file#$cmd_dir}" | |
| # Get directory part (empty if file is directly in subfolder) | |
| dir_part=$(dirname "$rel_path") | |
| file_name=$(basename "$rel_path") | |
| # Build symlink name with prefix | |
| if [ "$dir_part" = "." ]; then | |
| # File is directly in subfolder, prefix with "{subfolder}-" | |
| symlink_name="${prefix}-${file_name}" | |
| else | |
| # File is in nested subfolder, prefix with "{subfolder}-{nested}-" | |
| nested=$(echo "$dir_part" | tr '/' '-') | |
| symlink_name="${prefix}-${nested}-${file_name}" | |
| fi | |
| ln -sf "$command_file" "$GEMINI_WORKFLOWS/$symlink_name" | |
| echo "Created: $symlink_name -> $command_file" | |
| done | |
| done | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment