ai-cr 3.2.1__tar.gz → 3.3.0__tar.gz

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.
Files changed (40) hide show
  1. {ai_cr-3.2.1 → ai_cr-3.3.0}/LICENSE +21 -21
  2. {ai_cr-3.2.1 → ai_cr-3.3.0}/PKG-INFO +1 -1
  3. {ai_cr-3.2.1 → ai_cr-3.3.0}/README.md +205 -205
  4. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/__main__.py +4 -4
  5. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/bootstrap.py +90 -90
  6. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/cli.py +255 -244
  7. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/cli_base.py +104 -94
  8. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/commands/__init__.py +1 -1
  9. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/commands/deploy.py +138 -138
  10. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/commands/fix.py +160 -160
  11. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/commands/gh_post_review_comment.py +111 -111
  12. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/commands/gh_react_to_comment.py +217 -217
  13. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/commands/linear_comment.py +53 -53
  14. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/commands/repl.py +30 -30
  15. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/commands/version.py +8 -8
  16. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/config.toml +450 -448
  17. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/constants.py +15 -14
  18. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/context.py +19 -19
  19. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/core.py +520 -508
  20. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/env.py +8 -7
  21. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/gh_api.py +116 -116
  22. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/issue_trackers.py +50 -50
  23. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/pipeline.py +83 -83
  24. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/pipeline_steps/jira.py +62 -62
  25. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/pipeline_steps/linear.py +85 -85
  26. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/project_config.py +85 -85
  27. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/report_struct.py +136 -136
  28. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/tpl/answer.j2 +25 -25
  29. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/tpl/github_workflows/components/env-vars.j2 +11 -11
  30. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/tpl/github_workflows/components/installs.j2 +23 -23
  31. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/tpl/github_workflows/gito-code-review.yml.j2 +32 -32
  32. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/tpl/github_workflows/gito-react-to-comments.yml.j2 +70 -70
  33. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/tpl/partial/aux_files.j2 +8 -8
  34. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/tpl/questions/changes_summary.j2 +55 -55
  35. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/tpl/questions/release_notes.j2 +26 -26
  36. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/tpl/questions/test_cases.j2 +37 -37
  37. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/utils.py +267 -242
  38. {ai_cr-3.2.1 → ai_cr-3.3.0}/pyproject.toml +60 -60
  39. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/__init__.py +0 -0
  40. {ai_cr-3.2.1 → ai_cr-3.3.0}/gito/pipeline_steps/__init__.py +0 -0
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Vitalii Stepanenko
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Vitalii Stepanenko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ai-cr
3
- Version: 3.2.1
3
+ Version: 3.3.0
4
4
  Summary: AI code review tool that works with any language model provider. It detects issues in GitHub pull requests or local changes—instantly, reliably, and without vendor lock-in.
5
5
  License: MIT
6
6
  Keywords: static code analysis,code review,code quality,ai,coding,assistant,llm,github,automation,devops,developer tools,github actions,workflows,git
@@ -1,205 +1,205 @@
1
- <h1 align="center"><a href="#"><img alt="Gito: AI Code Reviewer" src="https://raw.githubusercontent.com/Nayjest/Gito/main/press-kit/logo/gito-ai-code-reviewer_logo-180.png" align="center" width="180"></a></h1>
2
- <p align="center">
3
- <a href="https://pypi.org/project/gito.bot/" target="_blank"><img src="https://img.shields.io/pypi/v/gito.bot" alt="PYPI Release"></a>
4
- <a href="https://github.com/Nayjest/Gito/actions/workflows/code-style.yml" target="_blank"><img src="https://github.com/Nayjest/Gito/actions/workflows/code-style.yml/badge.svg" alt="PyLint"></a>
5
- <a href="https://github.com/Nayjest/Gito/actions/workflows/tests.yml" target="_blank"><img src="https://github.com/Nayjest/Gito/actions/workflows/tests.yml/badge.svg" alt="Tests"></a>
6
- <img src="https://raw.githubusercontent.com/Nayjest/Gito/main/coverage.svg" alt="Code Coverage">
7
- <a href="https://github.com/Nayjest/Gito/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/static/v1?label=license&message=MIT&color=d08aff" alt="License"></a>
8
- </p>
9
-
10
- **Gito** is an open-source **AI code reviewer** that works with any language model provider.
11
- It detects issues in GitHub pull requests or local codebase changes—instantly, reliably, and without vendor lock-in.
12
-
13
- Get consistent, thorough code reviews in seconds—no waiting for human availability.
14
-
15
- ## 📋 Table of Contents
16
- - [Why Gito?](#-why-gito)
17
- - [Perfect For](#-perfect-for)
18
- - [Quickstart](#-quickstart)
19
- - [1. Review Pull Requests via GitHub Actions](#1-review-pull-requests-via-github-actions)
20
- - [2. Running Code Analysis Locally](#2-running-code-analysis-locally)
21
- - [Configuration](#-configuration)
22
- - [Documentation](#-documentation)
23
- - [Development Setup](#-development-setup)
24
- - [Contributing](#-contributing)
25
- - [License](#-license)
26
-
27
- ## ✨ Why Gito?
28
-
29
- - [⚡] **Lightning Fast:** Get detailed code reviews in seconds, not days — powered by parallelized LLM processing
30
- - [🔧] **Vendor Agnostic:** Works with any language model provider (OpenAI, Anthropic, Google, local models, etc.)
31
- - [🌐] **Universal:** Supports all major programming languages and frameworks
32
- - [🔍] **Comprehensive Analysis:** Detect issues across security, performance, maintainability, best practices, and much more
33
- - [📈] **Consistent Quality:** Never tired, never biased—consistent review quality every time
34
- - [🚀] **Easy Integration:** Automatically reviews pull requests via GitHub Actions and posts results as PR comments
35
- - [🎛️] **Infinitely Flexible:** Adapt to any project's standards—configure review rules, severity levels, and focus areas, build custom workflows
36
-
37
- ## 🎯 Perfect For
38
-
39
- - Solo developers who want expert-level code review without the wait
40
- - Teams looking to catch issues before human review
41
- - Open source projects maintaining high code quality at scale
42
- - CI/CD pipelines requiring automated quality gates
43
-
44
- ✨ See [code review in action](https://github.com/Nayjest/Gito/pull/99) ✨
45
-
46
- ## 🚀 Quickstart
47
-
48
- ### 1. Review Pull Requests via GitHub Actions
49
-
50
- Create a `.github/workflows/gito-code-review.yml` file:
51
-
52
- ```yaml
53
- name: "Gito: AI Code Review"
54
- on:
55
- pull_request:
56
- types: [opened, synchronize, reopened]
57
- workflow_dispatch:
58
- inputs:
59
- pr_number:
60
- description: "Pull Request number"
61
- required: true
62
- jobs:
63
- review:
64
- runs-on: ubuntu-latest
65
- permissions: { contents: read, pull-requests: write } # 'write' for leaving the summary comment
66
- steps:
67
- - uses: actions/checkout@v4
68
- with: { fetch-depth: 0 }
69
- - name: Set up Python
70
- uses: actions/setup-python@v5
71
- with: { python-version: "3.13" }
72
- - name: Install AI Code Review tool
73
- run: pip install gito.bot~=3.0
74
- - name: Run AI code analysis
75
- env:
76
- LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
77
- LLM_API_TYPE: openai
78
- MODEL: "gpt-4.1"
79
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80
- PR_NUMBER_FROM_WORKFLOW_DISPATCH: ${{ github.event.inputs.pr_number }}
81
- run: |
82
- gito --verbose review
83
- gito github-comment --token ${{ secrets.GITHUB_TOKEN }}
84
- - uses: actions/upload-artifact@v4
85
- with:
86
- name: ai-code-review-results
87
- path: |
88
- code-review-report.md
89
- code-review-report.json
90
- ```
91
-
92
- > ⚠️ Make sure to add `LLM_API_KEY` to your repository's GitHub secrets.
93
-
94
- 💪 Done!
95
- PRs to your repository will now receive AI code reviews automatically. ✨
96
- See [GitHub Setup Guide](https://github.com/Nayjest/Gito/blob/main/documentation/github_setup.md) for more details.
97
-
98
- ### 2. Running Code Analysis Locally
99
-
100
- #### Initial Local Setup
101
-
102
- **Prerequisites:** [Python](https://www.python.org/downloads/) 3.11 / 3.12 / 3.13
103
-
104
- **Step1:** Install [gito.bot](https://github.com/Nayjest/Gito) using [pip](https://en.wikipedia.org/wiki/Pip_(package_manager)).
105
- ```bash
106
- pip install gito.bot
107
- ```
108
-
109
- > **Troubleshooting:**
110
- > pip may be also available via cli as `pip3` depending on your Python installation.
111
-
112
- **Step2:** Perform initial setup
113
-
114
- The following command will perform one-time setup using an interactive wizard.
115
- You will be prompted to enter LLM configuration details (API type, API key, etc).
116
- Configuration will be saved to `~/.gito/.env`.
117
-
118
- ```bash
119
- gito setup
120
- ```
121
-
122
- > **Troubleshooting:**
123
- > On some systems, `gito` command may not became available immediately after installation.
124
- > Try restarting your terminal or running `python -m gito` instead.
125
-
126
-
127
- #### Perform your first AI code review locally
128
-
129
- **Step1:** Navigate to your repository root directory.
130
- **Step2:** Switch to the branch you want to review.
131
- **Step3:** Run following command
132
- ```bash
133
- gito review
134
- ```
135
-
136
- > **Note:** This will analyze the current branch against the repository main branch by default.
137
- > Files that are not staged for commit will be ignored.
138
- > See `gito --help` for more options.
139
-
140
- **Reviewing remote repository**
141
-
142
- ```bash
143
- gito remote git@github.com:owner/repo.git <FEATURE_BRANCH>..<MAIN_BRANCH>
144
- ```
145
- Use interactive help for details:
146
- ```bash
147
- gito remote --help
148
- ```
149
-
150
- ## 🔧 Configuration
151
-
152
- Change behavior via `.gito/config.toml`:
153
-
154
- - Prompt templates, filtering and post-processing using Python code snippets
155
- - Tagging, severity, and confidence settings
156
- - Custom AI awards for developer brilliance
157
- - Output customization
158
-
159
- You can override the default config by placing `.gito/config.toml` in your repo root.
160
-
161
-
162
- See default configuration [here](https://github.com/Nayjest/Gito/blob/main/gito/config.toml).
163
-
164
- More details can be found in [📖 Configuration Cookbook](https://github.com/Nayjest/Gito/blob/main/documentation/config_cookbook.md)
165
-
166
- ## 📚 Documentation
167
-
168
- - [Command Line Reference](https://github.com/Nayjest/Gito/blob/main/documentation/command_line_reference.md)
169
- - [Configuration Cookbook](https://github.com/Nayjest/Gito/blob/main/documentation/config_cookbook.md)
170
- - [GitHub Setup Guide](https://github.com/Nayjest/Gito/blob/main/documentation/github_setup.md)
171
- - [Troubleshooting](https://github.com/Nayjest/Gito/blob/main/documentation/troubleshooting.md)
172
-
173
-
174
- ## 💻 Development Setup
175
-
176
- Install dependencies:
177
-
178
- ```bash
179
- make install
180
- ```
181
-
182
- Format code and check style:
183
-
184
- ```bash
185
- make black
186
- make cs
187
- ```
188
-
189
- Run tests:
190
-
191
- ```bash
192
- pytest
193
- ```
194
-
195
- ## 🤝 Contributing
196
-
197
- **Looking for a specific feature or having trouble?**
198
- Contributions are welcome! ❤️
199
- See [CONTRIBUTING.md](https://github.com/Nayjest/Gito/blob/main/CONTRIBUTING.md) for details.
200
-
201
- ## 📝 License
202
-
203
- Licensed under the [MIT License](https://github.com/Nayjest/Gito/blob/main/LICENSE).
204
-
205
- © 2025 [Vitalii Stepanenko](mailto:mail@vitaliy.in)
1
+ <h1 align="center"><a href="#"><img alt="Gito: AI Code Reviewer" src="https://raw.githubusercontent.com/Nayjest/Gito/main/press-kit/logo/gito-ai-code-reviewer_logo-180.png" align="center" width="180"></a></h1>
2
+ <p align="center">
3
+ <a href="https://pypi.org/project/gito.bot/" target="_blank"><img src="https://img.shields.io/pypi/v/gito.bot" alt="PYPI Release"></a>
4
+ <a href="https://github.com/Nayjest/Gito/actions/workflows/code-style.yml" target="_blank"><img src="https://github.com/Nayjest/Gito/actions/workflows/code-style.yml/badge.svg" alt="PyLint"></a>
5
+ <a href="https://github.com/Nayjest/Gito/actions/workflows/tests.yml" target="_blank"><img src="https://github.com/Nayjest/Gito/actions/workflows/tests.yml/badge.svg" alt="Tests"></a>
6
+ <img src="https://raw.githubusercontent.com/Nayjest/Gito/main/coverage.svg" alt="Code Coverage">
7
+ <a href="https://github.com/Nayjest/Gito/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/static/v1?label=license&message=MIT&color=d08aff" alt="License"></a>
8
+ </p>
9
+
10
+ **Gito** is an open-source **AI code reviewer** that works with any language model provider.
11
+ It detects issues in GitHub pull requests or local codebase changes—instantly, reliably, and without vendor lock-in.
12
+
13
+ Get consistent, thorough code reviews in seconds—no waiting for human availability.
14
+
15
+ ## 📋 Table of Contents
16
+ - [Why Gito?](#-why-gito)
17
+ - [Perfect For](#-perfect-for)
18
+ - [Quickstart](#-quickstart)
19
+ - [1. Review Pull Requests via GitHub Actions](#1-review-pull-requests-via-github-actions)
20
+ - [2. Running Code Analysis Locally](#2-running-code-analysis-locally)
21
+ - [Configuration](#-configuration)
22
+ - [Documentation](#-documentation)
23
+ - [Development Setup](#-development-setup)
24
+ - [Contributing](#-contributing)
25
+ - [License](#-license)
26
+
27
+ ## ✨ Why Gito?
28
+
29
+ - [⚡] **Lightning Fast:** Get detailed code reviews in seconds, not days — powered by parallelized LLM processing
30
+ - [🔧] **Vendor Agnostic:** Works with any language model provider (OpenAI, Anthropic, Google, local models, etc.)
31
+ - [🌐] **Universal:** Supports all major programming languages and frameworks
32
+ - [🔍] **Comprehensive Analysis:** Detect issues across security, performance, maintainability, best practices, and much more
33
+ - [📈] **Consistent Quality:** Never tired, never biased—consistent review quality every time
34
+ - [🚀] **Easy Integration:** Automatically reviews pull requests via GitHub Actions and posts results as PR comments
35
+ - [🎛️] **Infinitely Flexible:** Adapt to any project's standards—configure review rules, severity levels, and focus areas, build custom workflows
36
+
37
+ ## 🎯 Perfect For
38
+
39
+ - Solo developers who want expert-level code review without the wait
40
+ - Teams looking to catch issues before human review
41
+ - Open source projects maintaining high code quality at scale
42
+ - CI/CD pipelines requiring automated quality gates
43
+
44
+ ✨ See [code review in action](https://github.com/Nayjest/Gito/pull/99) ✨
45
+
46
+ ## 🚀 Quickstart
47
+
48
+ ### 1. Review Pull Requests via GitHub Actions
49
+
50
+ Create a `.github/workflows/gito-code-review.yml` file:
51
+
52
+ ```yaml
53
+ name: "Gito: AI Code Review"
54
+ on:
55
+ pull_request:
56
+ types: [opened, synchronize, reopened]
57
+ workflow_dispatch:
58
+ inputs:
59
+ pr_number:
60
+ description: "Pull Request number"
61
+ required: true
62
+ jobs:
63
+ review:
64
+ runs-on: ubuntu-latest
65
+ permissions: { contents: read, pull-requests: write } # 'write' for leaving the summary comment
66
+ steps:
67
+ - uses: actions/checkout@v4
68
+ with: { fetch-depth: 0 }
69
+ - name: Set up Python
70
+ uses: actions/setup-python@v5
71
+ with: { python-version: "3.13" }
72
+ - name: Install AI Code Review tool
73
+ run: pip install gito.bot~=3.0
74
+ - name: Run AI code analysis
75
+ env:
76
+ LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
77
+ LLM_API_TYPE: openai
78
+ MODEL: "gpt-4.1"
79
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80
+ PR_NUMBER_FROM_WORKFLOW_DISPATCH: ${{ github.event.inputs.pr_number }}
81
+ run: |
82
+ gito --verbose review
83
+ gito github-comment --token ${{ secrets.GITHUB_TOKEN }}
84
+ - uses: actions/upload-artifact@v4
85
+ with:
86
+ name: ai-code-review-results
87
+ path: |
88
+ code-review-report.md
89
+ code-review-report.json
90
+ ```
91
+
92
+ > ⚠️ Make sure to add `LLM_API_KEY` to your repository's GitHub secrets.
93
+
94
+ 💪 Done!
95
+ PRs to your repository will now receive AI code reviews automatically. ✨
96
+ See [GitHub Setup Guide](https://github.com/Nayjest/Gito/blob/main/documentation/github_setup.md) for more details.
97
+
98
+ ### 2. Running Code Analysis Locally
99
+
100
+ #### Initial Local Setup
101
+
102
+ **Prerequisites:** [Python](https://www.python.org/downloads/) 3.11 / 3.12 / 3.13
103
+
104
+ **Step1:** Install [gito.bot](https://github.com/Nayjest/Gito) using [pip](https://en.wikipedia.org/wiki/Pip_(package_manager)).
105
+ ```bash
106
+ pip install gito.bot
107
+ ```
108
+
109
+ > **Troubleshooting:**
110
+ > pip may be also available via cli as `pip3` depending on your Python installation.
111
+
112
+ **Step2:** Perform initial setup
113
+
114
+ The following command will perform one-time setup using an interactive wizard.
115
+ You will be prompted to enter LLM configuration details (API type, API key, etc).
116
+ Configuration will be saved to `~/.gito/.env`.
117
+
118
+ ```bash
119
+ gito setup
120
+ ```
121
+
122
+ > **Troubleshooting:**
123
+ > On some systems, `gito` command may not became available immediately after installation.
124
+ > Try restarting your terminal or running `python -m gito` instead.
125
+
126
+
127
+ #### Perform your first AI code review locally
128
+
129
+ **Step1:** Navigate to your repository root directory.
130
+ **Step2:** Switch to the branch you want to review.
131
+ **Step3:** Run following command
132
+ ```bash
133
+ gito review
134
+ ```
135
+
136
+ > **Note:** This will analyze the current branch against the repository main branch by default.
137
+ > Files that are not staged for commit will be ignored.
138
+ > See `gito --help` for more options.
139
+
140
+ **Reviewing remote repository**
141
+
142
+ ```bash
143
+ gito remote git@github.com:owner/repo.git <FEATURE_BRANCH>..<MAIN_BRANCH>
144
+ ```
145
+ Use interactive help for details:
146
+ ```bash
147
+ gito remote --help
148
+ ```
149
+
150
+ ## 🔧 Configuration
151
+
152
+ Change behavior via `.gito/config.toml`:
153
+
154
+ - Prompt templates, filtering and post-processing using Python code snippets
155
+ - Tagging, severity, and confidence settings
156
+ - Custom AI awards for developer brilliance
157
+ - Output customization
158
+
159
+ You can override the default config by placing `.gito/config.toml` in your repo root.
160
+
161
+
162
+ See default configuration [here](https://github.com/Nayjest/Gito/blob/main/gito/config.toml).
163
+
164
+ More details can be found in [📖 Configuration Cookbook](https://github.com/Nayjest/Gito/blob/main/documentation/config_cookbook.md)
165
+
166
+ ## 📚 Documentation
167
+
168
+ - [Command Line Reference](https://github.com/Nayjest/Gito/blob/main/documentation/command_line_reference.md)
169
+ - [Configuration Cookbook](https://github.com/Nayjest/Gito/blob/main/documentation/config_cookbook.md)
170
+ - [GitHub Setup Guide](https://github.com/Nayjest/Gito/blob/main/documentation/github_setup.md)
171
+ - [Troubleshooting](https://github.com/Nayjest/Gito/blob/main/documentation/troubleshooting.md)
172
+
173
+
174
+ ## 💻 Development Setup
175
+
176
+ Install dependencies:
177
+
178
+ ```bash
179
+ make install
180
+ ```
181
+
182
+ Format code and check style:
183
+
184
+ ```bash
185
+ make black
186
+ make cs
187
+ ```
188
+
189
+ Run tests:
190
+
191
+ ```bash
192
+ pytest
193
+ ```
194
+
195
+ ## 🤝 Contributing
196
+
197
+ **Looking for a specific feature or having trouble?**
198
+ Contributions are welcome! ❤️
199
+ See [CONTRIBUTING.md](https://github.com/Nayjest/Gito/blob/main/CONTRIBUTING.md) for details.
200
+
201
+ ## 📝 License
202
+
203
+ Licensed under the [MIT License](https://github.com/Nayjest/Gito/blob/main/LICENSE).
204
+
205
+ © 2025 [Vitalii Stepanenko](mailto:mail@vitaliy.in)
@@ -1,4 +1,4 @@
1
- from .cli import main
2
-
3
- if __name__ == "__main__":
4
- main()
1
+ from .cli import main
2
+
3
+ if __name__ == "__main__":
4
+ main()
@@ -1,90 +1,90 @@
1
- import os
2
- import sys
3
- import io
4
- import logging
5
- from datetime import datetime
6
- from pathlib import Path
7
-
8
- import microcore as mc
9
-
10
- from .utils import is_running_in_github_action
11
- from .constants import HOME_ENV_PATH, EXECUTABLE, PROJECT_GITO_FOLDER
12
- from .env import Env
13
-
14
-
15
- def setup_logging(log_level: int = logging.INFO):
16
- class CustomFormatter(logging.Formatter):
17
- def format(self, record):
18
- dt = datetime.fromtimestamp(record.created).strftime("%Y-%m-%d %H:%M:%S")
19
- message, level_name = record.getMessage(), record.levelname
20
- if record.levelno == logging.WARNING:
21
- message = mc.ui.yellow(message)
22
- level_name = mc.ui.yellow(level_name)
23
- if record.levelno >= logging.ERROR:
24
- message = mc.ui.red(message)
25
- level_name = mc.ui.red(level_name)
26
- return f"{dt} {level_name}: {message}"
27
-
28
- handler = logging.StreamHandler()
29
- handler.setFormatter(CustomFormatter())
30
- logging.basicConfig(level=log_level, handlers=[handler])
31
-
32
-
33
- def bootstrap(verbosity: int = 1):
34
- """Bootstrap the application with the environment configuration."""
35
- log_levels_by_verbosity = {
36
- 0: logging.CRITICAL,
37
- 1: logging.INFO,
38
- 2: logging.INFO,
39
- 3: logging.DEBUG,
40
- }
41
- Env.verbosity = verbosity
42
- Env.logging_level = log_levels_by_verbosity.get(verbosity, logging.INFO)
43
- setup_logging(Env.logging_level)
44
- logging.info(
45
- f"Bootstrapping Gito v{Env.gito_version}... "
46
- + mc.ui.gray(f"[verbosity={verbosity}]")
47
- )
48
-
49
- # cp1251 is used on Windows when redirecting output
50
- if sys.stdout.encoding and sys.stdout.encoding.lower() != "utf-8":
51
- sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
52
-
53
- try:
54
- mc.configure(
55
- DOT_ENV_FILE=HOME_ENV_PATH,
56
- USE_LOGGING=verbosity >= 1,
57
- EMBEDDING_DB_TYPE=mc.EmbeddingDbType.NONE,
58
- PROMPT_TEMPLATES_PATH=[
59
- PROJECT_GITO_FOLDER,
60
- Path(__file__).parent / "tpl"
61
- ],
62
- )
63
- if verbosity > 1:
64
- mc.logging.LoggingConfig.STRIP_REQUEST_LINES = None
65
- else:
66
- mc.logging.LoggingConfig.STRIP_REQUEST_LINES = [300, 15]
67
-
68
- except mc.LLMConfigError as e:
69
- msg = str(e)
70
- if is_running_in_github_action():
71
- ref = os.getenv("GITHUB_WORKFLOW_REF", "")
72
- if ref:
73
- # example value: 'owner/repo/.github/workflows/ai-code-review.yml@refs/pull/1/merge'
74
- ref = ref.split("@")[0]
75
- ref = ref.split(".github/workflows/")[-1]
76
- ref = f" (.github/workflows/{ref})"
77
- msg += (
78
- f"\nPlease check your GitHub Action Secrets "
79
- f"and `env` configuration section of the corresponding workflow step{ref}."
80
- )
81
- else:
82
- msg += (
83
- f"\nPlease run '{EXECUTABLE} setup' "
84
- "to configure LLM API access (API keys, model, etc)."
85
- )
86
- print(mc.ui.red(msg))
87
- raise SystemExit(2)
88
- except Exception as e:
89
- logging.error(f"Unexpected configuration error: {e}")
90
- raise SystemExit(3)
1
+ import os
2
+ import sys
3
+ import io
4
+ import logging
5
+ from datetime import datetime
6
+ from pathlib import Path
7
+
8
+ import microcore as mc
9
+
10
+ from .utils import is_running_in_github_action
11
+ from .constants import HOME_ENV_PATH, EXECUTABLE, PROJECT_GITO_FOLDER
12
+ from .env import Env
13
+
14
+
15
+ def setup_logging(log_level: int = logging.INFO):
16
+ class CustomFormatter(logging.Formatter):
17
+ def format(self, record):
18
+ dt = datetime.fromtimestamp(record.created).strftime("%Y-%m-%d %H:%M:%S")
19
+ message, level_name = record.getMessage(), record.levelname
20
+ if record.levelno == logging.WARNING:
21
+ message = mc.ui.yellow(message)
22
+ level_name = mc.ui.yellow(level_name)
23
+ if record.levelno >= logging.ERROR:
24
+ message = mc.ui.red(message)
25
+ level_name = mc.ui.red(level_name)
26
+ return f"{dt} {level_name}: {message}"
27
+
28
+ handler = logging.StreamHandler()
29
+ handler.setFormatter(CustomFormatter())
30
+ logging.basicConfig(level=log_level, handlers=[handler])
31
+
32
+
33
+ def bootstrap(verbosity: int = 1):
34
+ """Bootstrap the application with the environment configuration."""
35
+ log_levels_by_verbosity = {
36
+ 0: logging.CRITICAL,
37
+ 1: logging.INFO,
38
+ 2: logging.INFO,
39
+ 3: logging.DEBUG,
40
+ }
41
+ Env.verbosity = verbosity
42
+ Env.logging_level = log_levels_by_verbosity.get(verbosity, logging.INFO)
43
+ setup_logging(Env.logging_level)
44
+ logging.info(
45
+ f"Bootstrapping Gito v{Env.gito_version}... "
46
+ + mc.ui.gray(f"[verbosity={verbosity}]")
47
+ )
48
+
49
+ # cp1251 is used on Windows when redirecting output
50
+ if sys.stdout.encoding and sys.stdout.encoding.lower() != "utf-8":
51
+ sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
52
+
53
+ try:
54
+ mc.configure(
55
+ DOT_ENV_FILE=HOME_ENV_PATH,
56
+ USE_LOGGING=verbosity >= 1,
57
+ EMBEDDING_DB_TYPE=mc.EmbeddingDbType.NONE,
58
+ PROMPT_TEMPLATES_PATH=[
59
+ PROJECT_GITO_FOLDER,
60
+ Path(__file__).parent / "tpl"
61
+ ],
62
+ )
63
+ if verbosity > 1:
64
+ mc.logging.LoggingConfig.STRIP_REQUEST_LINES = None
65
+ else:
66
+ mc.logging.LoggingConfig.STRIP_REQUEST_LINES = [300, 15]
67
+
68
+ except mc.LLMConfigError as e:
69
+ msg = str(e)
70
+ if is_running_in_github_action():
71
+ ref = os.getenv("GITHUB_WORKFLOW_REF", "")
72
+ if ref:
73
+ # example value: 'owner/repo/.github/workflows/ai-code-review.yml@refs/pull/1/merge'
74
+ ref = ref.split("@")[0]
75
+ ref = ref.split(".github/workflows/")[-1]
76
+ ref = f" (.github/workflows/{ref})"
77
+ msg += (
78
+ f"\nPlease check your GitHub Action Secrets "
79
+ f"and `env` configuration section of the corresponding workflow step{ref}."
80
+ )
81
+ else:
82
+ msg += (
83
+ f"\nPlease run '{EXECUTABLE} setup' "
84
+ "to configure LLM API access (API keys, model, etc)."
85
+ )
86
+ print(mc.ui.red(msg))
87
+ raise SystemExit(2)
88
+ except Exception as e:
89
+ logging.error(f"Unexpected configuration error: {e}")
90
+ raise SystemExit(3)