.TH GIT-CA 1 "2026-05-03" "git-ca 0.2.0" "User Commands"
.SH NAME
git-ca \- draft git commit messages with GitHub Copilot or OpenAI Codex
.SH SYNOPSIS
.B git ca
.RI [ OPTIONS ]
.RI [ COMMAND ]
.br
.B git-ca
.RI [ OPTIONS ]
.RI [ COMMAND ]
.SH DESCRIPTION
.B git-ca
is a Git subcommand that drafts commit messages for staged changes using
either GitHub Copilot or the OpenAI Codex (ChatGPT) backend. It reads the
staged diff, asks the active backend for a Conventional Commits message,
writes the draft to Git's commit message file, and runs
.BR git-commit (1).
.PP
Git handles
.B git ca \--help
by opening this manual page. For clap-generated command help, use
.B git ca \-h
or
.BR "git-ca \--help" .
.SH OPTIONS
.TP
.BR \-n , " \--no-verify"
Skip pre-commit and commit-msg hooks.
.TP
.BI "\-m, \--model " MODEL
Use a specific model id for drafting. The id must be valid for the active
account's backend. Overrides the persisted default model.
.TP
.BR \-y , " \--yes" , " \--auto-accept"
Commit the generated message without opening the editor.
.TP
.BR \-h , " \--help"
Print command help when the binary is invoked directly or through
.BR "git ca \-h" .
.TP
.BR \-V , " \--version"
Print version information.
.SH COMMANDS
.TP
.BI "auth login [\--provider " PROVIDER "] [" ACCOUNT "]"
Log in via the chosen backend's OAuth flow. PROVIDER is
.B copilot
(GitHub device flow) or
.B codex
(ChatGPT OAuth via PKCE with a localhost callback on :1455 / :1457). When
.BI \--provider
is omitted on an interactive terminal,
.B auth login
prompts for a choice; when stdin is not a TTY (CI, piped input) it defaults
to
.BR copilot .
When ACCOUNT is provided, store credentials for that named account and make
it active.
.TP
.BI "auth set-token [--account " ACCOUNT "] " TOKEN
Store a GitHub token manually for a Copilot account and make it active.
The Codex backend is OAuth-only and not supported here. If ACCOUNT is not
provided, the token is stored under the default account.
.TP
.BI "auth use " ACCOUNT
Select the named account; the backend is determined by which provider that
account was logged in with.
.TP
.BI "auth logout [" ACCOUNT "]"
Delete locally stored tokens. When ACCOUNT is provided, only that named account
is removed.
.TP
.B auth status
Show local auth state, the active account's provider, all linked accounts, and
provider-specific token state (Copilot token TTL or ChatGPT account/last
refresh).
.TP
.B models
List available models for the active account's backend. For Copilot this hits
the live model-listing endpoint; for Codex (which has no listing endpoint)
this prints the known accepted slugs.
.TP
.B config list
Print all persisted config values.
.TP
.BI "config set-model " MODEL
Persist the default model. For Copilot accounts the id is validated against
the live model list; for Codex it is accepted verbatim because the backend
has no listing endpoint.
.TP
.B config get-model
Print the persisted default model, if any.
.TP
.BI "config set-auto-accept " true|false
Persist whether generated messages commit without opening the editor.
.TP
.B config get-auto-accept
Print the persisted auto-accept setting.
.SH EXAMPLES
.TP
Draft a commit message and open the editor:
.B git ca
.TP
Draft with a specific model:
.B git ca \-m gpt-4o
.TP
Commit the generated message directly:
.B git ca \--yes
.TP
Show clap-generated help instead of this manual page:
.B git ca \-h
.SH FILES
.TP
.I ~/.config/git-ca/config.json
User preferences, including default model and auto-accept behavior.
.TP
.I ~/.config/git-ca/auth.json
Local credential cache. Each account is tagged with its provider; Copilot
accounts hold a GitHub token plus a cached Copilot API token, Codex accounts
hold ChatGPT access/refresh/id tokens and the linked account id.
.SH SEE ALSO
.BR git (1),
.BR git-commit (1)