GitHub & Git Operations (Codex)
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 — prints the modified file list and exits 1. You must specify which files to include.
# Single modified file — auto-stages
tl push "feat: add caching"
# Multiple modified files — MUST specify files
tl push "fix: resolve race" src/worker.mjs src/queue.mjs
# Include untracked (new) files
tl push "feat: new tool" bin/tl-new.mjs -A
# Commit without pushing
tl push "wip: checkpoint" src/foo.mjs --no-push
# Preview first
tl push "test" --dry-run
tl commit-prep
Pre-commit context: git status + diff stat + recent log. Use before tl push to decide which files to include.
tl commit-prep
tl push "fix: typo" README.md
GitHub Operations — tl gh
Wraps multi-step GitHub API calls into single commands. Always pass -R owner/repo.
Issue commands
tl gh issue read -R owner/repo 434 # with sub-issues
tl gh issue read -R owner/repo 434 --no-body # compact
echo '[{"title":"A"},{"title":"B"}]' | tl gh issue create-batch -R owner/repo
tl gh issue add-sub -R owner/repo --parent 10 42 43
tl gh issue close -R owner/repo 1 2 3 -c "Done"
tl gh issue label-batch -R owner/repo --add "bug" 1 2 3
PR commands
tl gh pr digest -R owner/repo 123 # full status
tl gh pr comments -R owner/repo 123 --unresolved # unresolved threads
tl gh pr land -R owner/repo 123 # CI wait + merge + cleanup
Release commands
tl gh release notes -R owner/repo --tag v1.2.0
When to use which
- Issue read with sub-issues or issue close with comment:
tl gh issue read/tl gh issue close - Bulk operations:
tl gh(create-batch, close, label-batch) - Full PR readiness check:
tl gh pr digest - Merge + cleanup:
tl gh pr land
Tips
- Always use
tl pushinstead of raw git sequences - Run
tl commit-prepfirst when unsure what changed - Use
--dry-runontl pushandtl gh pr landto preview safely
Source: edimuj/tokenlean — distributed by TomeVault.