api2cli-publish-to-github
Original:🇺🇸 English
Translated
Publishes an api2cli-generated CLI to a GitHub repository. Handles git init, .gitignore, committing, and gh repo create. Use when user asks to "push to github", "publish to github", "create a github repo", "add to github", or "put this on github".
2installs
Sourcemelvynx/api2cli
Added on
NPX Install
npx skill4agent add melvynx/api2cli api2cli-publish-to-githubTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Publish to GitHub
Push an api2cli-generated CLI (from ) to a new GitHub repository.
~/.cli/<app>-cli/Phase 1: Pre-flight
Auth
Run . If not logged in, tell the user to run first. Stop and wait.
gh auth statusgh auth loginNote 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 and ask which one. Read to get the package name.
~/.cli/package.jsonPhase 2: Prepare the repo
From the CLI directory ():
~/.cli/<app>-cli/-
Ensureexists with at least:
.gitignorenode_modules/ dist/ -
Init or check git:
- If no : run
.git/git 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 commitor
node_modules/. If already tracked,dist/them and rewrite history so secrets in dependencies don't trigger GitHub push protection.git rm -r --cached
Phase 3: Create the repo and push
bash
gh repo create <app>-cli --public --source=. --push --description "<description from package.json>"- If succeeds but push fails (e.g. push protection), fix the issue per Phase 2 and run
gh repo create.git push -u origin <branch> --force - If says "unable to add remote" (remote already exists), just push:
gh repo create.git push -u origin <branch> - If the repo name is taken, ask the user for an alternative name.
Phase 3.5: Update README
After pushing, check if the README contains in the install commands. If so, replace with the actual GitHub username and commit + push the fix.
<user>/<user>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/, or token files..env - Do not force-push to an existing repo with other contributors without asking.
- Do not change the git user config.