TOI Git is a PowerShell workflow assistant for modern Git. It keeps raw Git visible, adds typed branch workflows, and gives you practical guidance for daily branch, review, release, automation, and local install work.
The examples below use .\toi.ps1 ..., which works from the repo root in PowerShell. If you want bare commands like toi status, use the built-in install flow described below. The repo-local toi.cmd launcher is still available for cmd.exe and compatibility.
Recommended for PowerShell:
.\toi.ps1 install profileThat adds a small toi function to your PowerShell profile and registers TOI tab completion for future PowerShell sessions, so you can run:
toi status
toi dashboard
toi publishIf you prefer wrapper scripts in a directory on PATH:
.\toi.ps1 install user-binIf you want TOI available as a PowerShell module:
.\toi.ps1 install module
Import-Module TOIGit -Force
toi statusUseful install options:
install profile -DryRun: preview the profile snippet without changing your profileinstall profile -ProfilePath <path>: write to a specific profile fileinstall user-bin -DryRun: preview the wrapper installinstall user-bin -TargetDir <path>: install wrappers to a specific directoryinstall module -DryRun: preview the module bundle installinstall module -TargetDir <path>: install the module bundle to a specific module rootinstall update [profile|user-bin|module]: refresh an existing install in placeinstall status: show the current profile, user-bin, and module install stateinstall uninstall profile|user-bin|module: remove a specific install mode
For the current shell only:
.\toi.ps1 completion registerTo inspect or print the registration snippet:
.\toi.ps1 completion status
.\toi.ps1 completion scriptThe module package files live at TOIGit.psd1 and TOIGit.psm1. The module exports Invoke-Toi and the toi alias.
The shortest useful flow looks like this:
.\\toi.ps1 start feature login-form
.\\toi.ps1 status
.\\toi.ps1 ship
.\\toi.ps1 publish
.\\toi.ps1 open prThat covers the core TOI path:
- create a typed branch
- inspect local state
- check whether the branch is ready
- publish it to the remote
- open the PR path
If gh.exe is available on PATH, TOI will prefer GitHub-native PR open/create flows for publish -Pr and open pr.
Run TOI Git from inside a Git repository.
.\\toi.ps1 status
.\\toi.ps1 dashboard
.\\toi.ps1 nextIf you are starting new work:
.\\toi.ps1 start feature login-form
.\\toi.ps1 note set "Prepare login form PR"
.\\toi.ps1 save
.\\toi.ps1 ship
.\\toi.ps1 publishIf you just want a fast repo check:
.\\toi.ps1 doctor
.\\toi.ps1 report
.\\toi.ps1 self-checkIf TOI detects an in-progress rebase, merge, cherry-pick, revert, detached HEAD, or active bisect session, doctor, ship, next, and sync now surface recovery guidance instead of treating the repo as a normal clean state.
start: create a typed branch likefeature/loginstatus: compact branch and working tree summarysummary: recent commit history plus working tree overviewsave: stage everything and create a checkpoint commitcommit: create a commit with a messageundo: undo the last commit with a safe reset modesync: fetch remotes and show branch tracking statenext: show the most likely next action
doctor: inspect repo state and suggest next actionsship: assess whether a branch is ready for push or PRpublish: push the current branch and print or open the PR pathpr: inspect, gate, ready, and merge the current pull request withghreview: summarize review pressure, requested reviewers, and next actionopen: open the repo, branch, compare view, or PR path in a browser or withghnote: store a local branch note in.git
stack: create or restack dependent branchesrelease: start releases, scaffold notes, create tags, and publish GitHub releaseshotfix: create hotfix branches from the default branchworktree: list or add Git worktreesbranch-clean: list merged local branches and optionally delete them
dashboard: consolidated workflow overviewversion: module, tag, and current commit version infoincoming: show commits available from upstream without pullingoutgoing: show commits ready to push upstreamsync -Push: refresh a stale PR branch by fetching, updating, and pushing when safesync -DryRun: preview fetch/update/push behavior without touching refs or the networkbisect: guidedgit bisectworkflow with TOI state and reportingreport: workflow report in markdown or JSONschema: JSON contract summary for automation consumersself-check: lightweight local verification for TOI Gitinstall: manage profile, user-bin, and module installationcompletion: register or inspect PowerShell completion
.\\toi.ps1 start feature login-form
.\\toi.ps1 note set "Prepare login form PR"
.\\toi.ps1 status.\\toi.ps1 ship
.\\toi.ps1 publish
.\\toi.ps1 open pr.\\toi.ps1 pr status
.\\toi.ps1 pr gate
.\\toi.ps1 pr checks
.\\toi.ps1 review
.\\toi.ps1 sync -DryRun
.\\toi.ps1 pr ready -DryRun
.\\toi.ps1 pr merge -DryRunpr gate now includes a suggested next action and a TOI command to run, so it can answer "merge", "wait-for-review", "wait-for-checks", or "sync-branch" instead of only listing blockers.
When a PR branch is stale relative to its base branch, pr gate and review now steer you toward toi sync -Push.
When the current branch has no PR, the PR-oriented commands now report that as normal informational state instead of throwing raw gh errors.
.\\toi.ps1 release start 1.4.0
.\\toi.ps1 release notes 1.4.0
.\\toi.ps1 release tag 1.4.0
.\\toi.ps1 release publish 1.4.0If gh.exe is installed, release publish uses gh release create with your generated notes file.
To refresh CHANGELOG.md from the current repo state before any release tag exists:
.\\toi.ps1 release notes current-state.\\toi.ps1 status -Json
.\\toi.ps1 report -Json
.\\toi.ps1 schema -Json
.\\toi.ps1 self-check -JsonThese commands support -Json:
status -Jsondashboard -Jsonnext -Jsondoctor -Jsonship -Jsonpublish -Jsonpr status -Jsonpr gate -Jsonpr checks -Jsonpr ready -Jsonpr merge -Jsonreview -Jsonrelease ... -Jsonself-check -Jsonreport -Jsonschema -Json
Use them this way:
status -Jsonfor lightweight branch and working tree statedashboard -Jsonfor a richer workflow snapshot plus next actionsreport -Jsonfor a CI-friendly workflow summaryschema -Jsonfor the current JSON contract surfaceschema -Json -Snapshotfor the stable committed contract form without timestampsschema -CheckSnapshotto verify that the committed snapshot is currentschema -WriteSnapshotto intentionally refreshcontracts/toi-schema.jsonschema -BumpVersion patch|minor|majorto update the contract version and refresh the snapshot togetherself-check -Jsonfor machine-readable local verification results
The built-in self-check validates core JSON outputs against the declared contracts from schema, so automation drift is caught locally before CI.
The contract version is tracked in contracts/contract-version.txt, and the committed schema baseline lives in contracts/toi-schema.json.
GitHub Actions currently does this on pushes to main and on pull requests:
- runs the built-in self-check
- uploads the self-check JSON artifact
- uploads workflow report artifacts in markdown and JSON
- uploads the stable JSON contract artifact from
schema -Json -Snapshot - publishes the markdown workflow report as the job summary
Local reproduction for those capture steps:
.\tests\ci-artifacts.ps1TOI Git reads toi.json from the repository root.
Default shape:
{
"defaultBranch": "main",
"branchTypes": ["feature", "fix", "hotfix", "release", "chore"],
"syncStrategy": "rebase",
"protectBranches": ["main"],
"commitConvention": "optional",
"commitScopes": [],
"branchNoteRequired": false,
"qualityGateMode": "warn",
"validationCommands": [],
"requirePublishedForPr": true,
"dashboardSections": ["branch", "publish", "stack", "pr", "gates", "contract", "next"],
"releaseTagPrefix": "v",
"releaseNotesFile": "CHANGELOG.md",
"releaseVersionPattern": "^\\d+\\.\\d+\\.\\d+$",
"releaseBranches": true,
"stackedBranches": true
}Important fields:
qualityGateMode:warnorblockcommitConvention:off,optional, orrequiredcommitScopes: allowed scopes for conventional commitsbranchNoteRequired: require a local note on non-default branchesvalidationCommands: PowerShell commands to run beforeshipandpublishrequirePublishedForPr: require the branch to be pushed beforeopen prdashboardSections: controls which sections appear indashboardreleaseTagPrefix: prefix used for release tags likev1.2.3releaseNotesFile: file generated byrelease notesreleaseVersionPattern: regex used to validate release versions
Example with blocking validation:
{
"defaultBranch": "main",
"branchTypes": ["feature", "fix", "hotfix", "release", "chore"],
"syncStrategy": "rebase",
"protectBranches": ["main"],
"qualityGateMode": "block",
"validationCommands": [
".\\toi.ps1 summary"
],
"requirePublishedForPr": true,
"releaseBranches": true,
"stackedBranches": true
}More examples:
.\\toi.ps1 publish -DryRun
.\\toi.ps1 publish -Pr
.\\toi.ps1 pr status
.\\toi.ps1 pr gate
.\\toi.ps1 pr checks -Required
.\\toi.ps1 review
.\\toi.ps1 pr ready
.\\toi.ps1 pr ready -Undo
.\\toi.ps1 pr merge -Squash -DeleteBranch
.\\toi.ps1 pr merge -Auto
.\\toi.ps1 dashboard
.\\toi.ps1 version
.\\toi.ps1 next
.\\toi.ps1 branch-clean
.\\toi.ps1 branch-clean -Apply
.\\toi.ps1 undo -Soft
.\\toi.ps1 open
.\\toi.ps1 open branch
.\\toi.ps1 open compare
.\\toi.ps1 worktree list
.\\toi.ps1 worktree add ..\Toi-feature feature/demo
.\\toi.ps1 stack new api-client
.\\toi.ps1 stack restack
.\\toi.ps1 stack parent
.\\toi.ps1 hotfix start payment-timeout
.\\toi.ps1 release publish 1.4.0 -DryRunIf you run pr status, pr checks, pr gate, or review on main or another branch without an open PR, TOI reports that there is no PR for the current branch and points you back to .\toi.ps1 publish -Pr or gh pr create --fill --web.
TOI Git stores stack parent metadata and branch notes under the local .git directory so this workflow state does not pollute tracked files.
There is also a lightweight wrapper at tests/self-check.ps1 for running the built-in verification flow. Maintainer notes live in CONTRIBUTING.md.