Skip to content

Instantly share code, notes, and snippets.

@hatappo
Last active August 6, 2025 03:24
Show Gist options
  • Select an option

  • Save hatappo/6b1e3312c7574f4ca4eb17288a025c9c to your computer and use it in GitHub Desktop.

Select an option

Save hatappo/6b1e3312c7574f4ca4eb17288a025c9c to your computer and use it in GitHub Desktop.
Convert files of custom slash commands in Claude Code to those in Gemini CLI
claude_dir=~/.claude
gemini_dir=~/.gemini
mkdir -p $gemini_dir/commands
for c in $(ls $claude_dir/commands); do
cat $claude_dir/commands/$c \
| awk '/^---$/ && !f++ {next} 1' \
| awk '/^---$/ {print "prompt = \"\"\""; next} 1' \
| sed 's/!\`\([^`]*\)\`/!{\1}/g' \
| awk '{gsub(/\$ARGUMENTS/, "{{args}}")} 1' \
| awk '{gsub(/^description:/, "description =")} 1' \
| awk '!/^(allowed-tools:|argument-hint:|model:)/' \
| awk '1; END {print "\n\"\"\""}' \
> $gemini_dir/commands/${c%.*}.toml
done
@hatappo
Copy link
Author

hatappo commented Aug 6, 2025

Use https://github.com/hatappo/agent-slash-sync instead of this humble script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment