gityo 1.0.15 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -214
- package/dist/{handle-error-BfzsPJhM.js → index.js} +13486 -6106
- package/dist/{token-JJJQxCwS.js → token-Ch3pWfUV.js} +1 -1
- package/dist/token-util-DzZvXcg5.js +3 -0
- package/dist/{v2-C8kCuQRG.js → v2-e3v6C-ce.js} +1 -1
- package/package.json +2 -4
- package/dist/commit.js +0 -27
- package/dist/local-changes-DaP0s52z.js +0 -7240
- package/dist/pr-create.js +0 -33
- package/dist/pr-merge.js +0 -40
- package/dist/token-util-DQfBgRnZ.js +0 -3
- /package/dist/{defineProperty-DZ5JLFN4.js → defineProperty-DXo2ZDb8.js} +0 -0
- /package/dist/{token-util-CV7QlXpE.js → token-util-Cx8VuowB.js} +0 -0
package/README.md
CHANGED
|
@@ -1,82 +1,18 @@
|
|
|
1
1
|
# gityo
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
AI-generated commit messages and GitHub pull requests from your changes.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- Review generated commit messages, commit, and push.
|
|
6
|
+
- Generate PR titles and descriptions, create PRs, and merge them.
|
|
7
|
+
- Choose from 31 provider SDKs through the [Vercel AI SDK](https://ai-sdk.dev).
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
npm install -g gityo
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Or run it without a global install:
|
|
9
|
+
## Setup
|
|
12
10
|
|
|
13
11
|
```bash
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
gityo needs a model in its config before the first run. See [AI setup](#ai-setup).
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
Run it inside a git repository:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
gityo
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Here's what happens:
|
|
28
|
-
|
|
29
|
-
1. gityo reads your changes. If you staged files, it reads only those. Otherwise it reads every change, including untracked files.
|
|
30
|
-
2. The model writes a commit message. You accept it or ask for a new one.
|
|
31
|
-
3. If nothing was staged, gityo runs `git add -A`.
|
|
32
|
-
4. gityo commits.
|
|
33
|
-
5. gityo asks whether to run the post-commit command, which is `git push` by default.
|
|
34
|
-
|
|
35
|
-
If you staged some files before running `gityo`, it commits only those and leaves the rest of your changes alone.
|
|
36
|
-
|
|
37
|
-
Flags change how much it asks:
|
|
38
|
-
|
|
39
|
-
- `gityo --generate` commits the generated message without asking you to review it.
|
|
40
|
-
- `gityo --input "fix login redirect bug"` commits your own message instead.
|
|
41
|
-
- `gityo --post` runs the post-commit command without asking.
|
|
42
|
-
- `gityo --yolo` does both `--generate` and `--post`. No questions.
|
|
43
|
-
- `gityo --model fast` uses the `fast` model from your config.
|
|
44
|
-
- `gityo --style concise` uses a different message style. See [Commit message styles](#commit-message-styles).
|
|
45
|
-
|
|
46
|
-
## Pull requests
|
|
47
|
-
|
|
48
|
-
Two more commands work with GitHub pull requests. Both need the [GitHub CLI](https://cli.github.com) (`gh`) installed and logged in. They read the commits and diff from GitHub's compare API, not from your working tree, so push your branch first.
|
|
49
|
-
|
|
50
|
-
`gityo-pr-create` opens a pull request with a generated title and body:
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
gityo-pr-create
|
|
54
|
-
gityo-pr-create main feature/login
|
|
55
|
-
gityo-pr-create --yolo
|
|
56
|
-
gityo-pr-create --web
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
With no arguments, the base is the repository's default branch and the head is your current branch. Pass two branch names to set both. `--yolo` creates the pull request without showing you the title and body first. `--web` opens the pull request in your browser afterward. If one already exists for those branches, `--web` opens that one.
|
|
60
|
-
|
|
61
|
-
`gityo-pr-merge` merges a pull request and creates it first if it doesn't exist:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
gityo-pr-merge
|
|
65
|
-
gityo-pr-merge main feature/login
|
|
66
|
-
gityo-pr-merge --yolo
|
|
12
|
+
npm install -g gityo
|
|
67
13
|
```
|
|
68
14
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
Both commands also take `--model`, `--title-style`, and `--body-style`.
|
|
72
|
-
|
|
73
|
-
The body says what the change does and why. It doesn't list changed files or commits, because GitHub already shows those on the Changes tab.
|
|
74
|
-
|
|
75
|
-
## AI setup
|
|
76
|
-
|
|
77
|
-
gityo won't run without a model, and the model's API key must be set in your environment. This applies even when you pass `--input`.
|
|
78
|
-
|
|
79
|
-
Put models in the `models` map of your config. Each key is a name you can pass to `--model`. Without `--model`, gityo uses `default`.
|
|
15
|
+
Create `~/.config/gityo.json` with your model:
|
|
80
16
|
|
|
81
17
|
```json
|
|
82
18
|
{
|
|
@@ -86,164 +22,88 @@ Put models in the `models` map of your config. Each key is a name you can pass t
|
|
|
86
22
|
"npm": "@openrouter/ai-sdk-provider",
|
|
87
23
|
"apiKeyEnv": "OPENROUTER_API_KEY",
|
|
88
24
|
"model": "openai/gpt-oss-120b:nitro"
|
|
89
|
-
},
|
|
90
|
-
"fast": {
|
|
91
|
-
"npm": "@ai-sdk/openai",
|
|
92
|
-
"apiKeyEnv": "OPENAI_API_KEY",
|
|
93
|
-
"model": "gpt-5-mini"
|
|
94
25
|
}
|
|
95
|
-
}
|
|
96
|
-
"style": "concise"
|
|
97
|
-
}
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
Each model has these fields:
|
|
101
|
-
|
|
102
|
-
- `model` is the model ID.
|
|
103
|
-
- `apiKeyEnv` is the environment variable that holds the API key.
|
|
104
|
-
- `npm` is the provider package. It defaults to `@ai-sdk/openai-compatible`.
|
|
105
|
-
- `apiUrl` is the provider's base URL. You need it for `@ai-sdk/openai-compatible`.
|
|
106
|
-
- `options` is passed to the provider's create function, such as `createOpenAI()`.
|
|
107
|
-
|
|
108
|
-
`apiKeyEnv` can also be a list. gityo uses the first variable that's set:
|
|
109
|
-
|
|
110
|
-
```json
|
|
111
|
-
"apiKeyEnv": ["GITYO_API_KEY", "OPENROUTER_API_KEY"]
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
For any OpenAI-compatible endpoint, leave out `npm` and set `apiUrl`:
|
|
115
|
-
|
|
116
|
-
```json
|
|
117
|
-
"local": {
|
|
118
|
-
"apiKeyEnv": "MY_API_KEY",
|
|
119
|
-
"model": "my-model",
|
|
120
|
-
"apiUrl": "https://my-endpoint.example.com/v1"
|
|
26
|
+
}
|
|
121
27
|
}
|
|
122
28
|
```
|
|
123
29
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
The Vercel AI SDK packages are `@ai-sdk/openai`, `@ai-sdk/openai-compatible`, `@ai-sdk/anthropic`, `@ai-sdk/google`, `@ai-sdk/google-vertex`, `@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`, and `@ai-sdk/deepinfra`.
|
|
127
|
-
|
|
128
|
-
The other packages are `@openrouter/ai-sdk-provider`, `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`.
|
|
129
|
-
|
|
130
|
-
## Config
|
|
131
|
-
|
|
132
|
-
gityo reads three files. You edit them by hand.
|
|
133
|
-
|
|
134
|
-
- `~/.config/gityo.json` is your global config.
|
|
135
|
-
- `.gityo.json` in the repository root is the project config. Its keys override the global ones.
|
|
136
|
-
- `.gityo.md` in the repository root holds writing instructions for that project. It replaces the `instructions` key from both JSON files.
|
|
137
|
-
|
|
138
|
-
The override is shallow. A `models` map in `.gityo.json` replaces your global `models` entirely instead of adding to it. The same goes for `styles`.
|
|
139
|
-
|
|
140
|
-
To print the config paths, run:
|
|
30
|
+
Set the API key in your shell:
|
|
141
31
|
|
|
142
32
|
```bash
|
|
143
|
-
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
Set `$schema` in your config for autocomplete and validation in your editor:
|
|
147
|
-
|
|
148
|
-
```text
|
|
149
|
-
https://github.com/NazmusSayad/gityo/raw/refs/heads/schema/schema.json
|
|
33
|
+
export OPENROUTER_API_KEY="your-api-key"
|
|
150
34
|
```
|
|
151
35
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
- `
|
|
185
|
-
- `
|
|
186
|
-
- `
|
|
187
|
-
- `
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
A style is the base commit convention gityo asks the model to follow. There are five built in:
|
|
200
|
-
|
|
201
|
-
- `default` uses conventional commits. It adds a body only for large changes with several parts.
|
|
202
|
-
- `concise` uses conventional commits and adds a body only when the subject can't carry the change alone.
|
|
203
|
-
- `explanatory` uses conventional commits and usually adds a body explaining the change.
|
|
204
|
-
- `plain` writes one short imperative subject line with no conventional prefix.
|
|
205
|
-
- `gitmoji` puts a gitmoji in front of a conventional subject.
|
|
206
|
-
|
|
207
|
-
gityo picks the style from `--style`, then the `style` key, then falls back to `default`:
|
|
36
|
+
## Supported SDKs
|
|
37
|
+
|
|
38
|
+
Set your model's `npm` field to one of these packages:
|
|
39
|
+
|
|
40
|
+
### Vercel provider packages
|
|
41
|
+
|
|
42
|
+
- `@ai-sdk/openai`
|
|
43
|
+
- `@ai-sdk/openai-compatible`
|
|
44
|
+
- `@ai-sdk/anthropic`
|
|
45
|
+
- `@ai-sdk/google`
|
|
46
|
+
- `@ai-sdk/google-vertex`
|
|
47
|
+
- `@ai-sdk/xai`
|
|
48
|
+
- `@ai-sdk/azure`
|
|
49
|
+
- `@ai-sdk/amazon-bedrock`
|
|
50
|
+
- `@ai-sdk/groq`
|
|
51
|
+
- `@ai-sdk/mistral`
|
|
52
|
+
- `@ai-sdk/togetherai`
|
|
53
|
+
- `@ai-sdk/cohere`
|
|
54
|
+
- `@ai-sdk/fireworks`
|
|
55
|
+
- `@ai-sdk/deepseek`
|
|
56
|
+
- `@ai-sdk/cerebras`
|
|
57
|
+
- `@ai-sdk/perplexity`
|
|
58
|
+
- `@ai-sdk/fal`
|
|
59
|
+
- `@ai-sdk/deepinfra`
|
|
60
|
+
- `@ai-sdk/luma`
|
|
61
|
+
|
|
62
|
+
### Community provider packages
|
|
63
|
+
|
|
64
|
+
- `@openrouter/ai-sdk-provider`
|
|
65
|
+
- `ollama-ai-provider-v2`
|
|
66
|
+
- `ai-sdk-ollama`
|
|
67
|
+
- `vercel-minimax-ai-provider`
|
|
68
|
+
- `@aihubmix/ai-sdk-provider`
|
|
69
|
+
- `ai-gateway-provider`
|
|
70
|
+
- `workers-ai-provider`
|
|
71
|
+
- `@friendliai/ai-provider`
|
|
72
|
+
- `@helicone/ai-sdk-provider`
|
|
73
|
+
- `ai-sdk-provider-opencode-sdk`
|
|
74
|
+
- `sambanova-ai-provider`
|
|
75
|
+
- `zhipu-ai-provider`
|
|
76
|
+
|
|
77
|
+
For an OpenAI-compatible endpoint, use `@ai-sdk/openai-compatible` and set `apiUrl` to its base URL.
|
|
78
|
+
|
|
79
|
+
## Commits
|
|
80
|
+
|
|
81
|
+
Run inside a git repository:
|
|
208
82
|
|
|
209
83
|
```bash
|
|
210
|
-
gityo
|
|
84
|
+
gityo
|
|
211
85
|
```
|
|
212
86
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
87
|
+
- Review the generated message before committing.
|
|
88
|
+
- Commit staged files, or all changes if nothing is staged.
|
|
89
|
+
- Choose whether to push afterward.
|
|
90
|
+
- Use `--yolo` to skip confirmations.
|
|
216
91
|
|
|
217
|
-
Pull
|
|
218
|
-
|
|
219
|
-
Title styles:
|
|
220
|
-
|
|
221
|
-
- `default` is a short, specific imperative title.
|
|
222
|
-
- `conventional` uses the conventional commits format, `type(scope): subject`.
|
|
223
|
-
|
|
224
|
-
Body styles:
|
|
225
|
-
|
|
226
|
-
- `default` explains what the pull request does and why.
|
|
227
|
-
- `concise` uses a few short sentences or bullets.
|
|
228
|
-
- `verbose` goes into detail and adds headings when the change has separate parts.
|
|
229
|
-
|
|
230
|
-
Set defaults with `prTitleStyle` and `prBodyStyle`, or pick per run:
|
|
231
|
-
|
|
232
|
-
```bash
|
|
233
|
-
gityo-pr-create --title-style conventional --body-style concise
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
Custom styles go under `prTitleStyles` and `prBodyStyles`. They work like commit `styles`.
|
|
92
|
+
## Pull requests
|
|
237
93
|
|
|
238
|
-
|
|
94
|
+
Requires [GitHub CLI](https://cli.github.com) with `gh auth login` completed.
|
|
239
95
|
|
|
240
|
-
gityo
|
|
96
|
+
- `gityo pr create` generates a title and body for review, then creates the PR.
|
|
97
|
+
- `gityo pr merge` merges the PR, creating it first if needed.
|
|
98
|
+
- Both use the current branch and the repository's default base branch unless you specify branches.
|
|
99
|
+
- PRs use pushed commits. For uncommitted changes on the current head branch, gityo offers to commit and push first.
|
|
241
100
|
|
|
242
|
-
|
|
101
|
+
## Customization
|
|
243
102
|
|
|
244
|
-
-
|
|
245
|
-
- It drops lock files, minified JS and CSS, and source maps.
|
|
246
|
-
- It cuts each file's patch to `perFileCap` lines, which defaults to 400.
|
|
247
|
-
- It adds a list of every changed file with its line counts, so the model still knows what the whole change touches.
|
|
103
|
+
Styles control how commit messages, PR titles, and PR bodies are written. Choose a built-in style or supply your own writing instructions, with separate defaults for each.
|
|
248
104
|
|
|
249
|
-
|
|
105
|
+
- Run `gityo config styles` to view commit, PR title, and PR body styles.
|
|
106
|
+
- Add `.gityo.json` to a repository for project-specific settings.
|
|
107
|
+
- Add `.gityo.md` for project-specific commit instructions.
|
|
108
|
+
- Run `gityo config` to see config locations.
|
|
109
|
+
- Use the config schema for available settings and `--help` on each command for its options.
|