devnarrate 0.1.0a1__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.
@@ -0,0 +1,97 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*' # Trigger on version tags like v0.1.0, v0.1.0a1, etc.
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build:
13
+ name: Build distribution
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: "3.12"
23
+
24
+ - name: Install build dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install build
28
+
29
+ - name: Build package
30
+ run: python -m build
31
+
32
+ - name: Store the distribution packages
33
+ uses: actions/upload-artifact@v4
34
+ with:
35
+ name: python-package-distributions
36
+ path: dist/
37
+
38
+ publish-to-pypi:
39
+ name: Publish to PyPI
40
+ needs:
41
+ - build
42
+ runs-on: ubuntu-latest
43
+ environment:
44
+ name: pypi
45
+ url: https://pypi.org/p/devnarrate
46
+ permissions:
47
+ id-token: write # IMPORTANT: mandatory for trusted publishing
48
+
49
+ steps:
50
+ - name: Download all the dists
51
+ uses: actions/download-artifact@v4
52
+ with:
53
+ name: python-package-distributions
54
+ path: dist/
55
+
56
+ - name: Publish to PyPI
57
+ uses: pypa/gh-action-pypi-publish@release/v1
58
+
59
+ github-release:
60
+ name: Create GitHub Release
61
+ needs:
62
+ - publish-to-pypi
63
+ runs-on: ubuntu-latest
64
+ permissions:
65
+ contents: write # IMPORTANT: mandatory for making GitHub Releases
66
+ id-token: write # IMPORTANT: mandatory for sigstore
67
+
68
+ steps:
69
+ - name: Download all the dists
70
+ uses: actions/download-artifact@v4
71
+ with:
72
+ name: python-package-distributions
73
+ path: dist/
74
+
75
+ - name: Sign the dists with Sigstore
76
+ uses: sigstore/gh-action-sigstore-python@v3.0.0
77
+ with:
78
+ inputs: >-
79
+ ./dist/*.tar.gz
80
+ ./dist/*.whl
81
+
82
+ - name: Create GitHub Release
83
+ env:
84
+ GITHUB_TOKEN: ${{ github.token }}
85
+ run: >-
86
+ gh release create
87
+ '${{ github.ref_name }}'
88
+ --repo '${{ github.repository }}'
89
+ --notes ""
90
+
91
+ - name: Upload artifact signatures to GitHub Release
92
+ env:
93
+ GITHUB_TOKEN: ${{ github.token }}
94
+ run: >-
95
+ gh release upload
96
+ '${{ github.ref_name }}' dist/**
97
+ --repo '${{ github.repository }}'
@@ -0,0 +1,207 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 K Man
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.
@@ -0,0 +1,166 @@
1
+ Metadata-Version: 2.4
2
+ Name: devnarrate
3
+ Version: 0.1.0a1
4
+ Summary: MCP server that narrates your code changes, from commits to deployments.
5
+ Author: K Man
6
+ Maintainer: K Man
7
+ License: MIT
8
+ License-File: LICENSE
9
+ Keywords: ai,claude,commit,git,mcp,pr
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
+ Classifier: Topic :: Software Development :: Version Control :: Git
17
+ Requires-Python: >=3.12
18
+ Requires-Dist: mcp[cli]>=1.20.0
19
+ Requires-Dist: tiktoken>=0.5.0
20
+ Description-Content-Type: text/markdown
21
+
22
+ # DevNarrate
23
+ MCP server that narrates your code changes, from commits to deployments.
24
+
25
+ ## Features
26
+
27
+ - **Smart Commit Messages**: Generate conventional commit messages from staged changes with full user control
28
+ - **PR Descriptions**: Create detailed pull request descriptions with customizable templates
29
+ - **Multi-Platform**: Supports GitHub and GitLab
30
+ - **Token-Aware**: Handles large diffs with automatic pagination
31
+ - **Template System**: Use custom PR templates or built-in defaults
32
+ - **Safety First**: Only works with staged changes to prevent accidental commits
33
+
34
+ ## Installation
35
+
36
+ ### Option 1: Install from PyPI (Recommended)
37
+
38
+ 1. **Install the package:**
39
+ ```bash
40
+ pip install devnarrate
41
+
42
+ # Or for pre-release versions:
43
+ pip install --pre devnarrate
44
+ ```
45
+
46
+ 2. **Configure with Claude Code:**
47
+ ```bash
48
+ # Add MCP server using your Python path
49
+ claude mcp add DevNarrate -- python -m devnarrate.server
50
+
51
+ # Verify it's connected
52
+ claude mcp list
53
+ ```
54
+
55
+ 3. **Configure with Cursor:**
56
+
57
+ Edit `~/.cursor/mcp.json`:
58
+ ```json
59
+ {
60
+ "mcpServers": {
61
+ "DevNarrate": {
62
+ "command": "python",
63
+ "args": ["-m", "devnarrate.server"]
64
+ }
65
+ }
66
+ }
67
+ ```
68
+
69
+ Then restart Cursor.
70
+
71
+ ### Option 2: Install from Source (Development)
72
+
73
+ 1. **Prerequisites:** Install [uv](https://docs.astral.sh/uv/getting-started/installation/):
74
+ ```bash
75
+ curl -LsSf https://astral.sh/uv/install.sh | sh
76
+ ```
77
+
78
+ 2. **Clone and setup:**
79
+ ```bash
80
+ git clone https://github.com/krishnamandanapu/DevNarrate.git
81
+ cd DevNarrate
82
+ uv sync
83
+ ```
84
+
85
+ 3. **Configure with Claude Code:**
86
+ ```bash
87
+ claude mcp add DevNarrate -- uv --directory /path/to/DevNarrate run python -m devnarrate.server
88
+ ```
89
+
90
+ 4. **Configure with Cursor:**
91
+ ```json
92
+ {
93
+ "mcpServers": {
94
+ "DevNarrate": {
95
+ "command": "uv",
96
+ "args": ["--directory", "/path/to/DevNarrate", "run", "python", "-m", "devnarrate.server"]
97
+ }
98
+ }
99
+ }
100
+ ```
101
+
102
+ ## Usage
103
+
104
+ ### Commit Messages
105
+
106
+ **Important:** DevNarrate only works with **staged changes** to ensure you have full control over what gets committed. This prevents accidental commits of unintended files.
107
+
108
+ 1. First, stage the files you want to commit:
109
+ ```bash
110
+ git add <file1> <file2>
111
+ # or for all tracked files with changes:
112
+ git add -u
113
+ ```
114
+
115
+ 2. Ask Claude to generate the commit message:
116
+ ```
117
+ Ask Claude: "Generate a commit message for my changes"
118
+ ```
119
+
120
+ 3. Claude will analyze your staged changes, show you the proposed commit message, and ask for approval before committing.
121
+
122
+ If you haven't staged any changes, Claude will prompt you to stage them first.
123
+
124
+ ### PR Descriptions
125
+
126
+ 1. Ask Claude: "Create a PR to main from my current branch"
127
+ 2. Claude will analyze the diff and ask which template to use (if you have custom templates)
128
+ 3. Claude generates the PR description and shows it to you
129
+ 4. Review and approve, then Claude creates the PR
130
+
131
+ ### PR Templates (Optional)
132
+ Create custom templates in `.devnarrate/pr-templates/`:
133
+
134
+ ```bash
135
+ mkdir -p .devnarrate/pr-templates
136
+ ```
137
+
138
+ Example template (`.devnarrate/pr-templates/feature.md`):
139
+ ```markdown
140
+ ## Summary
141
+ [What does this PR do?]
142
+
143
+ ## Changes
144
+ -
145
+ -
146
+
147
+ ## Testing
148
+ [How to test]
149
+
150
+ ## Related Issues
151
+ [Links]
152
+ ```
153
+
154
+ If no templates exist, a default template will be used.
155
+
156
+ ## Platform Support
157
+
158
+ **Commits:** Works everywhere (uses git)
159
+
160
+ **PRs:** Requires platform CLI:
161
+ - GitHub: Install [gh](https://cli.github.com/) and run `gh auth login`
162
+ - GitLab: Install [glab](https://gitlab.com/gitlab-org/cli) and run `glab auth login`
163
+
164
+ ## Development
165
+
166
+ For maintainers: See [RELEASING.md](RELEASING.md) for instructions on publishing releases to PyPI.
@@ -0,0 +1,145 @@
1
+ # DevNarrate
2
+ MCP server that narrates your code changes, from commits to deployments.
3
+
4
+ ## Features
5
+
6
+ - **Smart Commit Messages**: Generate conventional commit messages from staged changes with full user control
7
+ - **PR Descriptions**: Create detailed pull request descriptions with customizable templates
8
+ - **Multi-Platform**: Supports GitHub and GitLab
9
+ - **Token-Aware**: Handles large diffs with automatic pagination
10
+ - **Template System**: Use custom PR templates or built-in defaults
11
+ - **Safety First**: Only works with staged changes to prevent accidental commits
12
+
13
+ ## Installation
14
+
15
+ ### Option 1: Install from PyPI (Recommended)
16
+
17
+ 1. **Install the package:**
18
+ ```bash
19
+ pip install devnarrate
20
+
21
+ # Or for pre-release versions:
22
+ pip install --pre devnarrate
23
+ ```
24
+
25
+ 2. **Configure with Claude Code:**
26
+ ```bash
27
+ # Add MCP server using your Python path
28
+ claude mcp add DevNarrate -- python -m devnarrate.server
29
+
30
+ # Verify it's connected
31
+ claude mcp list
32
+ ```
33
+
34
+ 3. **Configure with Cursor:**
35
+
36
+ Edit `~/.cursor/mcp.json`:
37
+ ```json
38
+ {
39
+ "mcpServers": {
40
+ "DevNarrate": {
41
+ "command": "python",
42
+ "args": ["-m", "devnarrate.server"]
43
+ }
44
+ }
45
+ }
46
+ ```
47
+
48
+ Then restart Cursor.
49
+
50
+ ### Option 2: Install from Source (Development)
51
+
52
+ 1. **Prerequisites:** Install [uv](https://docs.astral.sh/uv/getting-started/installation/):
53
+ ```bash
54
+ curl -LsSf https://astral.sh/uv/install.sh | sh
55
+ ```
56
+
57
+ 2. **Clone and setup:**
58
+ ```bash
59
+ git clone https://github.com/krishnamandanapu/DevNarrate.git
60
+ cd DevNarrate
61
+ uv sync
62
+ ```
63
+
64
+ 3. **Configure with Claude Code:**
65
+ ```bash
66
+ claude mcp add DevNarrate -- uv --directory /path/to/DevNarrate run python -m devnarrate.server
67
+ ```
68
+
69
+ 4. **Configure with Cursor:**
70
+ ```json
71
+ {
72
+ "mcpServers": {
73
+ "DevNarrate": {
74
+ "command": "uv",
75
+ "args": ["--directory", "/path/to/DevNarrate", "run", "python", "-m", "devnarrate.server"]
76
+ }
77
+ }
78
+ }
79
+ ```
80
+
81
+ ## Usage
82
+
83
+ ### Commit Messages
84
+
85
+ **Important:** DevNarrate only works with **staged changes** to ensure you have full control over what gets committed. This prevents accidental commits of unintended files.
86
+
87
+ 1. First, stage the files you want to commit:
88
+ ```bash
89
+ git add <file1> <file2>
90
+ # or for all tracked files with changes:
91
+ git add -u
92
+ ```
93
+
94
+ 2. Ask Claude to generate the commit message:
95
+ ```
96
+ Ask Claude: "Generate a commit message for my changes"
97
+ ```
98
+
99
+ 3. Claude will analyze your staged changes, show you the proposed commit message, and ask for approval before committing.
100
+
101
+ If you haven't staged any changes, Claude will prompt you to stage them first.
102
+
103
+ ### PR Descriptions
104
+
105
+ 1. Ask Claude: "Create a PR to main from my current branch"
106
+ 2. Claude will analyze the diff and ask which template to use (if you have custom templates)
107
+ 3. Claude generates the PR description and shows it to you
108
+ 4. Review and approve, then Claude creates the PR
109
+
110
+ ### PR Templates (Optional)
111
+ Create custom templates in `.devnarrate/pr-templates/`:
112
+
113
+ ```bash
114
+ mkdir -p .devnarrate/pr-templates
115
+ ```
116
+
117
+ Example template (`.devnarrate/pr-templates/feature.md`):
118
+ ```markdown
119
+ ## Summary
120
+ [What does this PR do?]
121
+
122
+ ## Changes
123
+ -
124
+ -
125
+
126
+ ## Testing
127
+ [How to test]
128
+
129
+ ## Related Issues
130
+ [Links]
131
+ ```
132
+
133
+ If no templates exist, a default template will be used.
134
+
135
+ ## Platform Support
136
+
137
+ **Commits:** Works everywhere (uses git)
138
+
139
+ **PRs:** Requires platform CLI:
140
+ - GitHub: Install [gh](https://cli.github.com/) and run `gh auth login`
141
+ - GitLab: Install [glab](https://gitlab.com/gitlab-org/cli) and run `glab auth login`
142
+
143
+ ## Development
144
+
145
+ For maintainers: See [RELEASING.md](RELEASING.md) for instructions on publishing releases to PyPI.