npx githits@latest init handles authentication automatically. You only need this page for CI, headless machines, custom credential storage, or troubleshooting.
- Browser OAuth (recommended)
- API token
Browser OAuth is the recommended method for local development. It opens a secure login flow in your browser and stores the resulting credentials in your system keychain so they refresh automatically.Log inThis opens your browser to the GitHits OAuth page. Sign in or create an account, authorize the app, and your browser redirects back. The CLI confirms when authentication is complete.Useful flagsThe CLI prints a URL you can open on any device. After you complete login there, the CLI in your headless session receives the token automatically.
Example: headless login
Keychain storage
When you use browser OAuth, GitHits stores your credentials in the system keychain by default. The keychain used depends on your operating system:
GitHits reads from the keychain only when it actually needs the token — for example, during a tool call, a token refresh, or when you run
npx githits@latest auth status. A small non-secret metadata file is written alongside credentials so routine startup checks do not need to hit the keychain.
On macOS you may see a prompt: “githits wants to access … in your keychain”. Choose Always Allow if you trust the installed githits CLI. This is a macOS system prompt that GitHits cannot customize.
File storage mode
If keychain prompts keep appearing even after choosing Always Allow, or if you are on a system without a keychain backend, you can switch OAuth credential storage to file mode. Option 1: Config file (persistent) Setstorage = "file" in your GitHits config file:
config.toml. Create it if it does not already exist.
Option 2: Environment variable (one session)
Check authentication status
At any time, you can inspect your current auth setup:Log out
To remove stored credentials:npx githits@latest init to configure your coding tools, logout removes credentials only — your MCP configuration is preserved. Run npx githits@latest init uninstall separately if you want to remove the MCP configuration as well.