Stay non-interactive
grit does not open an external editor for commit messages. grit commit requires a message on the command line (positional or -m); there is no $GIT_EDITOR path.
Commands and flows that can block on a person:
| Area |
Behavior |
How to avoid blocking |
grit auth |
OAuth device flow: instructions on stderr, then polls GitHub until you authorize in a browser. |
Run grit auth once in an interactive session before automation. Store the token via credential.helper (see below). |
grit fetch / grit push / grit pull |
On HTTPS github.com auth failure, if stdin is a TTY, grit may ask Sign in to GitHub now? [Y/n] and run the device flow. |
Use a stored token from grit auth, or ensure stdin is not a TTY so grit prints a hint and exits without prompting. |
grit clone / grit fetch / grit pull / grit push over SSH |
Grit runs ssh with protocol stdin/stdout piped but stderr inherited, so the SSH child can still talk to /dev/tty (host-key confirmation, passphrase prompts, ssh-askpass, and similar). --json does not disable this. |
Preconfigure keys and known hosts; for unattended jobs set GIT_SSH_COMMAND='ssh -o BatchMode=yes' so SSH fails fast instead of prompting (grit resolves SSH from GIT_SSH_COMMAND, then GIT_SSH, then ssh on PATH — not core.sshCommand). |
grit update |
Runs the release installer (curl | sh on Unix). |
Do not invoke in unattended jobs unless you intend to upgrade the binary. |
There is no global --yes flag. For commits, always pass -m / a message argument.
grit auth logout is non-interactive and reports whether a helper had a token to erase:
Plumbing commands (not JSON)
These speak binary or line protocols on stdin/stdout and have no --json mode: grit manager, grit upload-pack, grit receive-pack. Agents should not wrap them as JSON commands.
-V / --version prints a version string and does not emit JSON even if --json is passed: