| name | github |
| description | Git commits, pushes, and GitHub operations using tokenlean. Covers tl push (with multi-file safety guard), tl commit-prep, tl gh (bulk issue/PR/release operations), and when to use tl gh vs gh CLI vs GitHub MCP. Use when committing, pushing, creating/closing/viewing issues, managing PRs, creating releases, or any git/GitHub workflow. |
| compatibility | Requires tokenlean CLI tools (npm i -g tokenlean), git, and gh CLI |
GitHub & Git Operations
Token-efficient git and GitHub workflows via tl push, tl commit-prep, and tl gh.
Committing & Pushing
tl push
Stages, commits, and pushes in one call.
Critical: multi-file safety guard. When multiple files are modified and no explicit files are given, tl push refuses to proceed. It prints the modified file list and exits with code 1. You must specify which files to include.
tl push "feat: add caching"
tl push "fix: resolve race" src/worker.mjs src/queue.mjs
tl push "feat: new tool" bin/tl-new.mjs -A
tl push "wip: checkpoint" src/foo.mjs --no-push
tl push "fix: better msg" --amend
tl push "test" --dry-run
tl commit-prep
Pre-commit context in one call: git status + diff stat + recent log. Use before tl push when you need to see what changed.
tl commit-prep
tl push "fix: typo" README.md
Workflow
Need to commit?
โโ Know which files โ tl push "msg" file1 file2
โโ Need to see changes โ tl commit-prep, then tl push "msg" file1 file2
โโ Only one file modified โ tl push "msg" (auto-stages)
GitHub Operations โ tl gh
Wraps multi-step GitHub API calls into single commands. Requires -R owner/repo.
When to use which tool
| Scenario | Tool |
|---|
| Single issue read with sub-issues or close with comment | tl gh issue read / tl gh issue close |
| Bulk operations (create/close/label many) | tl gh |
| View issue with direct sub-issues | tl gh issue read |
| Full PR status (CI + reviews + merge readiness) | tl gh pr digest |
| Check CI โ merge โ close issues โ delete branch | tl gh pr land |
| Auto-generate release changelog | tl gh release notes |
Issue commands
tl gh issue read -R owner/repo 434
tl gh issue read -R owner/repo 434 --no-body
tl gh issue read -R owner/repo 434 --full
echo '[{"title":"Bug A","labels":["bug"]},{"title":"Bug B"}]' | tl gh issue create-batch -R owner/repo
cat tree.json | tl gh issue create-tree -R owner/repo
tl gh issue add-sub -R owner/repo --parent 10 42 43 44
tl gh issue close -R owner/repo 1 2 3 -c "Sprint complete"
tl gh issue close -R owner/repo 10 11 --reason "not planned"
tl gh issue label-batch -R owner/repo --add "bug,P0" --remove "triage" 1 2 3
PR commands
tl gh pr digest -R owner/repo 123
tl gh pr comments -R owner/repo 123
tl gh pr comments -R owner/repo 123 --unresolved
tl gh pr land -R owner/repo 123
tl gh pr land -R owner/repo 123 --method rebase --dry-run
Project commands
tl gh project add-batch -R owner/repo --project owner/1 452 453 454
Release commands
tl gh release notes -R owner/repo --tag v1.2.0
tl gh release notes -R owner/repo --tag v1.2.0 --dry-run
Global flags
All tl gh commands support: -R owner/repo (required), -j (JSON output), -q (quiet), --project owner/N (auto-add created issues to board).
Tips
- Always use
tl push instead of raw git add + git commit + git push sequences
- When multiple files are modified, run
tl commit-prep first to see the full picture, then specify files explicitly
tl gh issue read fetches sub-issues in a single API call โ much cheaper than listing + fetching individually
tl gh pr land --dry-run is safe to run โ shows what would happen without acting
- Pipe JSON into bulk commands:
tl gh issue create-batch, tl gh issue create-tree