create checks what it needs first and goes on where it stopped¶
- Status: accepted
- Date: 2026-10-25
Context¶
blueprint.py create is the first command that a new user runs (decision 0050). It checked nothing before its first step: git init ran, and only then did git commit --signoff fail without user.name and user.email. A GitHub CLI that was missing or too old, a sign-in that was missing, a token without the scope workflow, which GitHub needs for a push of .github/workflows/, an account that may not create repositories of the owner, and a name that was taken all failed midway with the raw message of gh. Once gh repo create had added origin, a push or settings that failed left a folder that create refused the next time, as one that "pushes to origin already", so the user finished by hand (issue 453).
Options¶
- Better messages for each failure as it happens. The folder would still be half made, and the user would learn of the next problem only after fixing the first.
- A preflight before the first step, which only asks, and a
createthat goes on from the first step that is left in a folder that it made. - A
createthat undoes what it made when a step fails, such as deleting the repository on GitHub. Deleting needs the scopedelete_repo, whichgh auth logindoesn't grant, and undoing a push or settings that GitHub accepted in part loses work.
Decision¶
Option 2.
- The preflight asks for Python 3.12 or later, Git, the identity of the first commit through
git var GIT_AUTHOR_IDENTandGIT_COMMITTER_IDENT(which take the variables such asGIT_AUTHOR_EMAILinto account, as the commit does) when a commit is to be made, GitHub CLI 2.48 or later, the sign-in and its scopes withgh api --include user, the owner withgh api users/OWNERand, for an organization, the role withgh api user/memberships/orgs/OWNER, and the name withgh api repos/OWNER/NAME. The scopes arerepoandworkflow, andread:orgfor an organization, whichwrite:organdadmin:orginclude;workflowonly where gh's git protocol is HTTPS, as an SSH key pushes workflows without it. A Python before 3.11, which can't import the package, is named byblueprint.pyitself before the import. - A finding is ✔, ✘ or ·. A ✘ stops
createbefore anything is made and names what fixes it, a command where one does, such asgh auth refresh --hostname github.com --scopes workflow; every ✘ shows at once, not only the first. A · is what the preflight can't tell, such as a fine-grained token, which names no scopes, a member of an organization who isn't an owner, which works where the organization lets its members create repositories, or an answer that GitHub didn't give: it stops nothing, as the step itself still says what went wrong. --dry-runshows the preflight with the commands, andblueprint.py doctorruns the preflight alone, with the exit code 1 when a finding would stopcreate.- Going on: a folder whose
originpushes to the repository of the answers, in any form of address of GitHub, and that GitHub has, is one thatcreatemade.createthen pushesmainwhen GitHub has no branchmainyet, with gh's credential helper asgh repo create --pushdoes, so that it needs nogh auth setup-git, and the command line applies the settings and shows the checklist, which change only what differs. A folder whoseoriginpushes to another repository, or that has remotes but noorigin, is still refused, and anoriginwhose repository GitHub doesn't have is a ✘ that namesgit remote remove origin.
Consequences¶
A new user learns everything that would stop create at once, before anything is made, and a run that stopped midway ends with the same command that started it. The preflight costs a few requests to GitHub and calls of git and gh, about a second, and changes nothing. create doesn't undo a repository that it made; the troubleshooting names git remote add origin for a repository that a run made before gh could add origin, so that the next run goes on with it.