Created
May 13, 2026 17:23
-
-
Save mattppal/b3c03f67c8d3d8e306879566c4ea9c19 to your computer and use it in GitHub Desktop.
zsh helper for publishing Codex skills
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
| # Publish a Codex skill to a skills repository. | |
| # | |
| # Usage: | |
| # skill-push # publish the skill in the current directory | |
| # skill-push <name> # publish the installed skill named <name> | |
| # skill-push <path> # publish the skill at <path> | |
| # | |
| # Optional configuration: | |
| # export SKILLS_REPO_URL="https://github.com/YOUR_GITHUB_USERNAME/skills" | |
| # export SKILLS_REPO="$HOME/Developer/git-repos/skills" | |
| skills_push() { | |
| emulate -L zsh | |
| set -euo pipefail | |
| local skills_repo_url="${SKILLS_REPO_URL:-https://github.com/YOUR_GITHUB_USERNAME/skills}" | |
| local skills_repo="${SKILLS_REPO:-$HOME/Developer/git-repos/skills}" | |
| local target | |
| if (( $# == 0 )); then | |
| target="the skill in the current working directory ($PWD)" | |
| else | |
| target="$*" | |
| fi | |
| local prompt | |
| prompt=$(cat <<EOF | |
| Publish $target to $skills_repo_url. | |
| Use the local checkout at $skills_repo. Follow the existing repository convention: | |
| - skills live under skills/<skill-name>/ | |
| - each skill has a SKILL.md file with YAML frontmatter | |
| - preserve any supporting files in the skill directory | |
| Resolve a bare skill name by checking common installed-skill locations such as ~/.agents/skills, ~/.claude/skills, and ~/.codex/skills. Copy or update only the target skill directory in $skills_repo/skills, then commit only the relevant skill files and push the skills repo. Do not include unrelated dirty or untracked files from that checkout. | |
| EOF | |
| ) | |
| codex "$prompt" | |
| } | |
| alias skill-push='skills_push' | |
| alias skills-push='skills_push' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment