gityo
v1.0.11
Published
`gityo` is a CLI that writes or generates a commit message for your changes, stages them, creates the commit, and optionally runs a post-commit git action.
Readme
gityo
gityo is a CLI that writes or generates a commit message for your changes, stages them, creates the commit, and optionally runs a post-commit git action.
It is built for people who want a faster commit flow without turning git into a wall of commands.
Install
npm install -g gityoOr run it without installing globally:
npx gityoWhat it does
- writes or generates a commit message based on your current git state
- stages everything when nothing is staged yet
- creates the commit for you
- can run a post-commit action like
git push
Quick use
Run it inside a git repository:
gityoTypical flow:
- Write a commit message or generate one (from staged files if any, otherwise all changes)
- Stage everything if nothing is staged
- Create the commit
- Optionally run the configured post-commit action
If you already staged files before running gityo, only those are used for the message and committed — your other changes are left alone.
Common commands
gityo
gityo --generate
gityo --model fast --generate
gityo --message "fix login redirect bug"
gityo --yoloAI setup
A configured model is required — gityo won't run without one, and the API key must be resolvable from your environment even when you pass --message. Models live in a models map in your config file. Each key is a name you can pick with --model; the default key is used when you don't pass --model:
{
"$schema": "https://github.com/NazmusSayad/gityo/raw/refs/heads/schema/schema.json",
"models": {
"default": {
"npm": "@openrouter/ai-sdk-provider",
"apiKeyEnv": "OPENROUTER_API_KEY",
"model": "openai/gpt-oss-120b:nitro"
},
"fast": {
"npm": "@ai-sdk/openai",
"apiKeyEnv": "OPENAI_API_KEY",
"model": "gpt-5-mini"
}
}
}Each model config:
npm— the provider package, one of 30 supported AI SDK providers (autocompleted by the schema). Optional; defaults to@ai-sdk/openai-compatibleapiKeyEnv— environment variable(s) holding the API key, tried in ordermodel— the model IDapiUrl— optional base URL (required whennpmis@ai-sdk/openai-compatible)options— extra provider options passed to the provider factory
apiKeyEnv accepts a single variable name or an array of names:
"apiKeyEnv": ["GITYO_API_KEY", "OPENROUTER_API_KEY"]OpenAI-compatible example without npm:
"local": {
"apiKeyEnv": "MY_API_KEY",
"model": "my-model",
"apiUrl": "https://my-endpoint.example.com/v1"
}Then use:
gityo --generate
gityo --model fast --generateProviders are the official Vercel AI SDK packages: @ai-sdk/openai, @ai-sdk/openai-compatible, @ai-sdk/anthropic, @ai-sdk/google, @ai-sdk/xai, @ai-sdk/azure, @ai-sdk/amazon-bedrock, @ai-sdk/groq, @ai-sdk/mistral, @ai-sdk/deepseek, @ai-sdk/togetherai, @ai-sdk/fireworks, @ai-sdk/perplexity, @ai-sdk/cohere, @ai-sdk/cerebras, @ai-sdk/luma, @ai-sdk/fal, @ai-sdk/deepinfra, @ai-sdk/google-vertex, @openrouter/ai-sdk-provider, plus ai-sdk-ollama, ollama-ai-provider-v2, workers-ai-provider, zhipu-ai-provider, sambanova-ai-provider, vercel-minimax-ai-provider, @aihubmix/ai-sdk-provider, ai-gateway-provider, @friendliai/ai-provider, @helicone/ai-sdk-provider, and ai-sdk-provider-opencode-sdk.
Config
Show where your config files live:
gityo configConfig is edited by hand in a JSON file. Project config goes in:
.gityo.config.jsonGlobal config goes in:
~/.config/gityo.jsonYou can also add repo-specific writing instructions in:
.gityo.mdThat file is useful when you want commit messages in a certain tone or format for one project.
Set $schema in your config file for editor autocomplete and validation:
https://github.com/NazmusSayad/gityo/raw/refs/heads/schema/schema.jsonExample:
{
"$schema": "https://github.com/NazmusSayad/gityo/raw/refs/heads/schema/schema.json",
"models": {
"default": {
"npm": "@ai-sdk/openai",
"apiKeyEnv": "OPENAI_API_KEY",
"model": "gpt-5-nano"
}
},
"autoAcceptMessage": false,
"postCommand": "push",
"autoRunPostCommand": false,
"instructions": "Write short, clear commit messages.",
"maxDiffTokens": 24000,
"perFileCap": 400
}Large changes
When the diff is small, it is sent to the model as-is. When it is too large for one request, gityo minimizes it first:
- regenerates the diff with minimal context lines
- drops lock files and minified/generated files from the payload
- caps each file's patch and lists every changed file with its line counts so the model still sees the full picture
If the minimized diff is still too large, each remaining part is summarized in parallel and a final commit message is generated from those summaries.
Two optional config knobs control this:
maxDiffTokens— estimated token budget for the diff sent to the model (default24000)perFileCap— max diff lines kept per file when minimizing (default400)
Example instructions file:
Use imperative commit messages.
Mention the user-facing change first.
Keep the subject line under 72 characters.Priority is simple:
.gityo.mdfor repo-specific instructions.gityo.config.jsonfor project config~/.config/gityo.jsonfor your defaults
