api2cli-publish-to-github
SKILL.md
Publish to GitHub
Push an api2cli-generated CLI (from ~/.cli/<app>-cli/) to a new GitHub repository.
Phase 1: Pre-flight
Auth
Run gh auth status. If not logged in, tell the user to run gh auth login first. Stop and wait.
Note the GitHub username from the output (e.g. Logged in to github.com account <username>).
Resolve the CLI
If the user didn't specify which CLI, check ~/.cli/ and ask which one. Read package.json to get the package name.
Phase 2: Prepare the repo
From the CLI directory (~/.cli/<app>-cli/):
-
Ensure
.gitignoreexists with at least:node_modules/ dist/ -
Init or check git:
- If no
.git/: rungit init && git add -A && git commit -m "Initial commit: <app>-cli" - If already a git repo: stage and commit any uncommitted changes.
- If no
-
Never commit
node_modules/ordist/. If already tracked,git rm -r --cachedthem and rewrite history so secrets in dependencies don't trigger GitHub push protection.
Phase 3: Create the repo and push
gh repo create <app>-cli --public --source=. --push --description "<description from package.json>"
- If
gh repo createsucceeds but push fails (e.g. push protection), fix the issue per Phase 2 and rungit push -u origin <branch> --force. - If
gh repo createsays "unable to add remote" (remote already exists), just push:git push -u origin <branch>. - If the repo name is taken, ask the user for an alternative name.
Phase 4: Done
Report:
- Repo URL:
https://github.com/<username>/<app>-cli - What was pushed (file count, branch name)
Do NOT
- Do not commit
node_modules/,dist/,.env, or token files. - Do not force-push to an existing repo with other contributors without asking.
- Do not change the git user config.
Weekly Installs
2
Repository
melvynx/api2cliGitHub Stars
4
First Seen
7 days ago
Security Audits
Installed on
amp2
cline2
opencode2
cursor2
kimi-cli2
codex2