shotgun-sh 0.1.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.

Potentially problematic release.


This version of shotgun-sh might be problematic. Click here for more details.

Files changed (131) hide show
  1. shotgun_sh-0.1.0/.gitignore +212 -0
  2. shotgun_sh-0.1.0/LICENSE +21 -0
  3. shotgun_sh-0.1.0/PKG-INFO +466 -0
  4. shotgun_sh-0.1.0/README.md +413 -0
  5. shotgun_sh-0.1.0/hatch_build.py +84 -0
  6. shotgun_sh-0.1.0/pyproject.toml +161 -0
  7. shotgun_sh-0.1.0/src/shotgun/__init__.py +5 -0
  8. shotgun_sh-0.1.0/src/shotgun/agents/__init__.py +1 -0
  9. shotgun_sh-0.1.0/src/shotgun/agents/agent_manager.py +651 -0
  10. shotgun_sh-0.1.0/src/shotgun/agents/common.py +549 -0
  11. shotgun_sh-0.1.0/src/shotgun/agents/config/__init__.py +13 -0
  12. shotgun_sh-0.1.0/src/shotgun/agents/config/constants.py +17 -0
  13. shotgun_sh-0.1.0/src/shotgun/agents/config/manager.py +294 -0
  14. shotgun_sh-0.1.0/src/shotgun/agents/config/models.py +185 -0
  15. shotgun_sh-0.1.0/src/shotgun/agents/config/provider.py +206 -0
  16. shotgun_sh-0.1.0/src/shotgun/agents/conversation_history.py +106 -0
  17. shotgun_sh-0.1.0/src/shotgun/agents/conversation_manager.py +105 -0
  18. shotgun_sh-0.1.0/src/shotgun/agents/export.py +96 -0
  19. shotgun_sh-0.1.0/src/shotgun/agents/history/__init__.py +5 -0
  20. shotgun_sh-0.1.0/src/shotgun/agents/history/compaction.py +85 -0
  21. shotgun_sh-0.1.0/src/shotgun/agents/history/constants.py +19 -0
  22. shotgun_sh-0.1.0/src/shotgun/agents/history/context_extraction.py +108 -0
  23. shotgun_sh-0.1.0/src/shotgun/agents/history/history_building.py +104 -0
  24. shotgun_sh-0.1.0/src/shotgun/agents/history/history_processors.py +426 -0
  25. shotgun_sh-0.1.0/src/shotgun/agents/history/message_utils.py +84 -0
  26. shotgun_sh-0.1.0/src/shotgun/agents/history/token_counting.py +429 -0
  27. shotgun_sh-0.1.0/src/shotgun/agents/history/token_estimation.py +138 -0
  28. shotgun_sh-0.1.0/src/shotgun/agents/messages.py +35 -0
  29. shotgun_sh-0.1.0/src/shotgun/agents/models.py +275 -0
  30. shotgun_sh-0.1.0/src/shotgun/agents/plan.py +98 -0
  31. shotgun_sh-0.1.0/src/shotgun/agents/research.py +108 -0
  32. shotgun_sh-0.1.0/src/shotgun/agents/specify.py +98 -0
  33. shotgun_sh-0.1.0/src/shotgun/agents/tasks.py +96 -0
  34. shotgun_sh-0.1.0/src/shotgun/agents/tools/__init__.py +34 -0
  35. shotgun_sh-0.1.0/src/shotgun/agents/tools/codebase/__init__.py +28 -0
  36. shotgun_sh-0.1.0/src/shotgun/agents/tools/codebase/codebase_shell.py +256 -0
  37. shotgun_sh-0.1.0/src/shotgun/agents/tools/codebase/directory_lister.py +141 -0
  38. shotgun_sh-0.1.0/src/shotgun/agents/tools/codebase/file_read.py +144 -0
  39. shotgun_sh-0.1.0/src/shotgun/agents/tools/codebase/models.py +252 -0
  40. shotgun_sh-0.1.0/src/shotgun/agents/tools/codebase/query_graph.py +67 -0
  41. shotgun_sh-0.1.0/src/shotgun/agents/tools/codebase/retrieve_code.py +81 -0
  42. shotgun_sh-0.1.0/src/shotgun/agents/tools/file_management.py +218 -0
  43. shotgun_sh-0.1.0/src/shotgun/agents/tools/user_interaction.py +37 -0
  44. shotgun_sh-0.1.0/src/shotgun/agents/tools/web_search/__init__.py +60 -0
  45. shotgun_sh-0.1.0/src/shotgun/agents/tools/web_search/anthropic.py +144 -0
  46. shotgun_sh-0.1.0/src/shotgun/agents/tools/web_search/gemini.py +85 -0
  47. shotgun_sh-0.1.0/src/shotgun/agents/tools/web_search/openai.py +98 -0
  48. shotgun_sh-0.1.0/src/shotgun/agents/tools/web_search/utils.py +20 -0
  49. shotgun_sh-0.1.0/src/shotgun/build_constants.py +20 -0
  50. shotgun_sh-0.1.0/src/shotgun/cli/__init__.py +1 -0
  51. shotgun_sh-0.1.0/src/shotgun/cli/codebase/__init__.py +5 -0
  52. shotgun_sh-0.1.0/src/shotgun/cli/codebase/commands.py +202 -0
  53. shotgun_sh-0.1.0/src/shotgun/cli/codebase/models.py +21 -0
  54. shotgun_sh-0.1.0/src/shotgun/cli/config.py +275 -0
  55. shotgun_sh-0.1.0/src/shotgun/cli/export.py +81 -0
  56. shotgun_sh-0.1.0/src/shotgun/cli/models.py +10 -0
  57. shotgun_sh-0.1.0/src/shotgun/cli/plan.py +73 -0
  58. shotgun_sh-0.1.0/src/shotgun/cli/research.py +85 -0
  59. shotgun_sh-0.1.0/src/shotgun/cli/specify.py +69 -0
  60. shotgun_sh-0.1.0/src/shotgun/cli/tasks.py +78 -0
  61. shotgun_sh-0.1.0/src/shotgun/cli/update.py +152 -0
  62. shotgun_sh-0.1.0/src/shotgun/cli/utils.py +25 -0
  63. shotgun_sh-0.1.0/src/shotgun/codebase/__init__.py +12 -0
  64. shotgun_sh-0.1.0/src/shotgun/codebase/core/__init__.py +46 -0
  65. shotgun_sh-0.1.0/src/shotgun/codebase/core/change_detector.py +358 -0
  66. shotgun_sh-0.1.0/src/shotgun/codebase/core/code_retrieval.py +243 -0
  67. shotgun_sh-0.1.0/src/shotgun/codebase/core/ingestor.py +1497 -0
  68. shotgun_sh-0.1.0/src/shotgun/codebase/core/language_config.py +297 -0
  69. shotgun_sh-0.1.0/src/shotgun/codebase/core/manager.py +1662 -0
  70. shotgun_sh-0.1.0/src/shotgun/codebase/core/nl_query.py +331 -0
  71. shotgun_sh-0.1.0/src/shotgun/codebase/core/parser_loader.py +128 -0
  72. shotgun_sh-0.1.0/src/shotgun/codebase/models.py +111 -0
  73. shotgun_sh-0.1.0/src/shotgun/codebase/service.py +206 -0
  74. shotgun_sh-0.1.0/src/shotgun/logging_config.py +227 -0
  75. shotgun_sh-0.1.0/src/shotgun/main.py +167 -0
  76. shotgun_sh-0.1.0/src/shotgun/posthog_telemetry.py +158 -0
  77. shotgun_sh-0.1.0/src/shotgun/prompts/__init__.py +5 -0
  78. shotgun_sh-0.1.0/src/shotgun/prompts/agents/__init__.py +1 -0
  79. shotgun_sh-0.1.0/src/shotgun/prompts/agents/export.j2 +350 -0
  80. shotgun_sh-0.1.0/src/shotgun/prompts/agents/partials/codebase_understanding.j2 +87 -0
  81. shotgun_sh-0.1.0/src/shotgun/prompts/agents/partials/common_agent_system_prompt.j2 +37 -0
  82. shotgun_sh-0.1.0/src/shotgun/prompts/agents/partials/content_formatting.j2 +65 -0
  83. shotgun_sh-0.1.0/src/shotgun/prompts/agents/partials/interactive_mode.j2 +26 -0
  84. shotgun_sh-0.1.0/src/shotgun/prompts/agents/plan.j2 +144 -0
  85. shotgun_sh-0.1.0/src/shotgun/prompts/agents/research.j2 +69 -0
  86. shotgun_sh-0.1.0/src/shotgun/prompts/agents/specify.j2 +51 -0
  87. shotgun_sh-0.1.0/src/shotgun/prompts/agents/state/codebase/codebase_graphs_available.j2 +19 -0
  88. shotgun_sh-0.1.0/src/shotgun/prompts/agents/state/system_state.j2 +31 -0
  89. shotgun_sh-0.1.0/src/shotgun/prompts/agents/tasks.j2 +143 -0
  90. shotgun_sh-0.1.0/src/shotgun/prompts/codebase/__init__.py +1 -0
  91. shotgun_sh-0.1.0/src/shotgun/prompts/codebase/cypher_query_patterns.j2 +223 -0
  92. shotgun_sh-0.1.0/src/shotgun/prompts/codebase/cypher_system.j2 +28 -0
  93. shotgun_sh-0.1.0/src/shotgun/prompts/codebase/enhanced_query_context.j2 +10 -0
  94. shotgun_sh-0.1.0/src/shotgun/prompts/codebase/partials/cypher_rules.j2 +24 -0
  95. shotgun_sh-0.1.0/src/shotgun/prompts/codebase/partials/graph_schema.j2 +30 -0
  96. shotgun_sh-0.1.0/src/shotgun/prompts/codebase/partials/temporal_context.j2 +21 -0
  97. shotgun_sh-0.1.0/src/shotgun/prompts/history/__init__.py +1 -0
  98. shotgun_sh-0.1.0/src/shotgun/prompts/history/incremental_summarization.j2 +53 -0
  99. shotgun_sh-0.1.0/src/shotgun/prompts/history/summarization.j2 +46 -0
  100. shotgun_sh-0.1.0/src/shotgun/prompts/loader.py +140 -0
  101. shotgun_sh-0.1.0/src/shotgun/py.typed +0 -0
  102. shotgun_sh-0.1.0/src/shotgun/sdk/__init__.py +13 -0
  103. shotgun_sh-0.1.0/src/shotgun/sdk/codebase.py +219 -0
  104. shotgun_sh-0.1.0/src/shotgun/sdk/exceptions.py +17 -0
  105. shotgun_sh-0.1.0/src/shotgun/sdk/models.py +189 -0
  106. shotgun_sh-0.1.0/src/shotgun/sdk/services.py +23 -0
  107. shotgun_sh-0.1.0/src/shotgun/sentry_telemetry.py +87 -0
  108. shotgun_sh-0.1.0/src/shotgun/telemetry.py +93 -0
  109. shotgun_sh-0.1.0/src/shotgun/tui/__init__.py +0 -0
  110. shotgun_sh-0.1.0/src/shotgun/tui/app.py +116 -0
  111. shotgun_sh-0.1.0/src/shotgun/tui/commands/__init__.py +76 -0
  112. shotgun_sh-0.1.0/src/shotgun/tui/components/prompt_input.py +69 -0
  113. shotgun_sh-0.1.0/src/shotgun/tui/components/spinner.py +86 -0
  114. shotgun_sh-0.1.0/src/shotgun/tui/components/splash.py +25 -0
  115. shotgun_sh-0.1.0/src/shotgun/tui/components/vertical_tail.py +13 -0
  116. shotgun_sh-0.1.0/src/shotgun/tui/screens/chat.py +782 -0
  117. shotgun_sh-0.1.0/src/shotgun/tui/screens/chat.tcss +43 -0
  118. shotgun_sh-0.1.0/src/shotgun/tui/screens/chat_screen/__init__.py +0 -0
  119. shotgun_sh-0.1.0/src/shotgun/tui/screens/chat_screen/command_providers.py +219 -0
  120. shotgun_sh-0.1.0/src/shotgun/tui/screens/chat_screen/hint_message.py +40 -0
  121. shotgun_sh-0.1.0/src/shotgun/tui/screens/chat_screen/history.py +221 -0
  122. shotgun_sh-0.1.0/src/shotgun/tui/screens/directory_setup.py +113 -0
  123. shotgun_sh-0.1.0/src/shotgun/tui/screens/provider_config.py +221 -0
  124. shotgun_sh-0.1.0/src/shotgun/tui/screens/splash.py +31 -0
  125. shotgun_sh-0.1.0/src/shotgun/tui/styles.tcss +10 -0
  126. shotgun_sh-0.1.0/src/shotgun/tui/utils/__init__.py +5 -0
  127. shotgun_sh-0.1.0/src/shotgun/tui/utils/mode_progress.py +257 -0
  128. shotgun_sh-0.1.0/src/shotgun/utils/__init__.py +5 -0
  129. shotgun_sh-0.1.0/src/shotgun/utils/env_utils.py +35 -0
  130. shotgun_sh-0.1.0/src/shotgun/utils/file_system_utils.py +36 -0
  131. shotgun_sh-0.1.0/src/shotgun/utils/update_checker.py +375 -0
@@ -0,0 +1,212 @@
1
+ # Temp directory
2
+ tmp/
3
+
4
+ # Playground
5
+ playground/
6
+
7
+ # Output directory
8
+ .shotgun/
9
+
10
+ # Generated build files
11
+ src/shotgun/build_constants.py
12
+
13
+ # Claude code
14
+ ./claude/.claude/settings.local.json
15
+
16
+ .DS_Store
17
+
18
+ # Created by https://www.toptal.com/developers/gitignore/api/python,visualstudiocode
19
+ # Edit at https://www.toptal.com/developers/gitignore?templates=python,visualstudiocode
20
+
21
+ ### Python ###
22
+ # Byte-compiled / optimized / DLL files
23
+ __pycache__/
24
+ *.py[cod]
25
+ *$py.class
26
+
27
+ # C extensions
28
+ *.so
29
+
30
+ # Distribution / packaging
31
+ .Python
32
+ build/
33
+ develop-eggs/
34
+ dist/
35
+ downloads/
36
+ eggs/
37
+ .eggs/
38
+ lib/
39
+ lib64/
40
+ parts/
41
+ sdist/
42
+ var/
43
+ wheels/
44
+ share/python-wheels/
45
+ *.egg-info/
46
+ .installed.cfg
47
+ *.egg
48
+ MANIFEST
49
+
50
+ # PyInstaller
51
+ # Usually these files are written by a python script from a template
52
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
53
+ *.manifest
54
+ *.spec
55
+
56
+ # Installer logs
57
+ pip-log.txt
58
+ pip-delete-this-directory.txt
59
+
60
+ # Unit test / coverage reports
61
+ htmlcov/
62
+ .tox/
63
+ .nox/
64
+ .coverage
65
+ .coverage.*
66
+ .cache
67
+ nosetests.xml
68
+ coverage.xml
69
+ *.cover
70
+ *.py,cover
71
+ .hypothesis/
72
+ .pytest_cache/
73
+ cover/
74
+
75
+ # Translations
76
+ *.mo
77
+ *.pot
78
+
79
+ # Django stuff:
80
+ *.log
81
+ local_settings.py
82
+ db.sqlite3
83
+ db.sqlite3-journal
84
+
85
+ # Flask stuff:
86
+ instance/
87
+ .webassets-cache
88
+
89
+ # Scrapy stuff:
90
+ .scrapy
91
+
92
+ # Sphinx documentation
93
+ docs/_build/
94
+
95
+ # PyBuilder
96
+ .pybuilder/
97
+ target/
98
+
99
+ # Jupyter Notebook
100
+ .ipynb_checkpoints
101
+
102
+ # IPython
103
+ profile_default/
104
+ ipython_config.py
105
+
106
+ # pyenv
107
+ # For a library or package, you might want to ignore these files since the code is
108
+ # intended to run in multiple environments; otherwise, check them in:
109
+ # .python-version
110
+
111
+ # pipenv
112
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
113
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
114
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
115
+ # install all needed dependencies.
116
+ #Pipfile.lock
117
+
118
+ # poetry
119
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
120
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
121
+ # commonly ignored for libraries.
122
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
123
+ #poetry.lock
124
+
125
+ # pdm
126
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
127
+ #pdm.lock
128
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
129
+ # in version control.
130
+ # https://pdm.fming.dev/#use-with-ide
131
+ .pdm.toml
132
+
133
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
134
+ __pypackages__/
135
+
136
+ # Celery stuff
137
+ celerybeat-schedule
138
+ celerybeat.pid
139
+
140
+ # SageMath parsed files
141
+ *.sage.py
142
+
143
+ # Environments
144
+ .env
145
+ .venv
146
+ env/
147
+ venv/
148
+ ENV/
149
+ env.bak/
150
+ venv.bak/
151
+
152
+ # Spyder project settings
153
+ .spyderproject
154
+ .spyproject
155
+
156
+ # Rope project settings
157
+ .ropeproject
158
+
159
+ # mkdocs documentation
160
+ /site
161
+
162
+ # mypy
163
+ .mypy_cache/
164
+ .dmypy.json
165
+ dmypy.json
166
+
167
+ # Pyre type checker
168
+ .pyre/
169
+
170
+ # pytype static type analyzer
171
+ .pytype/
172
+
173
+ # Cython debug symbols
174
+ cython_debug/
175
+
176
+ # PyCharm
177
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
178
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
179
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
180
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
181
+ #.idea/
182
+
183
+ ### Python Patch ###
184
+ # Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
185
+ poetry.toml
186
+
187
+ # ruff
188
+ .ruff_cache/
189
+
190
+ # LSP config files
191
+ pyrightconfig.json
192
+
193
+ ### VisualStudioCode ###
194
+ .vscode/*
195
+ !.vscode/settings.json
196
+ !.vscode/tasks.json
197
+ !.vscode/launch.json
198
+ !.vscode/extensions.json
199
+ !.vscode/*.code-snippets
200
+
201
+ # Local History for Visual Studio Code
202
+ .history/
203
+
204
+ # Built Visual Studio Code Extensions
205
+ *.vsix
206
+
207
+ ### VisualStudioCode Patch ###
208
+ # Ignore all local history of files
209
+ .history
210
+ .ionide
211
+
212
+ # End of https://www.toptal.com/developers/gitignore/api/python,visualstudiocode
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Proofs.io
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,466 @@
1
+ Metadata-Version: 2.4
2
+ Name: shotgun-sh
3
+ Version: 0.1.0
4
+ Summary: AI-powered research, planning, and task management CLI tool
5
+ Project-URL: Homepage, https://shotgun.sh/
6
+ Project-URL: Repository, https://github.com/shotgun-sh/shotgun
7
+ Project-URL: Issues, https://github.com/shotgun-sh/shotgun-alpha/issues
8
+ Project-URL: Discord, https://discord.gg/5RmY6J2N7s
9
+ Author-email: "Proofs.io" <hello@proofs.io>
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Keywords: agent,ai,cli,llm,planning,productivity,pydantic-ai,research,task-management
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Topic :: Utilities
23
+ Requires-Python: >=3.11
24
+ Requires-Dist: anthropic>=0.39.0
25
+ Requires-Dist: google-generativeai>=0.8.5
26
+ Requires-Dist: httpx>=0.27.0
27
+ Requires-Dist: jinja2>=3.1.0
28
+ Requires-Dist: kuzu>=0.7.0
29
+ Requires-Dist: logfire[pydantic-ai]>=2.0.0
30
+ Requires-Dist: openai>=1.0.0
31
+ Requires-Dist: packaging>=23.0
32
+ Requires-Dist: posthog>=3.0.0
33
+ Requires-Dist: pydantic-ai>=0.0.14
34
+ Requires-Dist: rich>=13.0.0
35
+ Requires-Dist: sentry-sdk[pure-eval]>=2.0.0
36
+ Requires-Dist: textual-dev>=1.7.0
37
+ Requires-Dist: textual>=6.1.0
38
+ Requires-Dist: tiktoken>=0.7.0
39
+ Requires-Dist: tree-sitter-go>=0.23.0
40
+ Requires-Dist: tree-sitter-javascript>=0.23.0
41
+ Requires-Dist: tree-sitter-python>=0.23.0
42
+ Requires-Dist: tree-sitter-rust>=0.23.0
43
+ Requires-Dist: tree-sitter-typescript>=0.23.0
44
+ Requires-Dist: tree-sitter>=0.21.0
45
+ Requires-Dist: typer>=0.12.0
46
+ Requires-Dist: watchdog>=4.0.0
47
+ Provides-Extra: dev
48
+ Requires-Dist: commitizen>=3.13.0; extra == 'dev'
49
+ Requires-Dist: lefthook>=1.12.0; extra == 'dev'
50
+ Requires-Dist: mypy>=1.11.0; extra == 'dev'
51
+ Requires-Dist: ruff>=0.6.0; extra == 'dev'
52
+ Description-Content-Type: text/markdown
53
+
54
+ # Shotgun
55
+
56
+ A Python CLI tool for research, planning, and task management powered by AI agents.
57
+
58
+ ## Features
59
+
60
+ - **Research**: Perform research with agentic loops
61
+ - **Planning**: Generate structured plans for achieving goals
62
+ - **Tasks**: Generate prioritized task lists with agentic approaches
63
+
64
+ ## Installation
65
+
66
+ ### From PyPI (Recommended)
67
+
68
+ ```bash
69
+ pip install shotgun-sh
70
+ ```
71
+
72
+ ### From Source
73
+
74
+ ```bash
75
+ git clone https://github.com/shotgun-sh/shotgun.git
76
+ cd shotgun
77
+ uv sync --all-extras
78
+ ```
79
+
80
+ After installation from source, you can use either method:
81
+
82
+ **Method 1: Direct command (after uv sync)**
83
+ ```bash
84
+ shotgun --help
85
+ ```
86
+
87
+ **Method 2: Via uv run**
88
+ ```bash
89
+ uv run shotgun --help
90
+ ```
91
+
92
+ If installed from PyPI, simply use:
93
+ ```bash
94
+ shotgun --help
95
+ ```
96
+
97
+ ### Virtual Environment Setup (Optional)
98
+
99
+ If you prefer using a local virtual environment:
100
+
101
+ ```bash
102
+ uv venv
103
+ source .venv/bin/activate # On Windows: .venv\Scripts\activate
104
+ uv sync --all-extras
105
+ shotgun --help
106
+ ```
107
+
108
+ ## Usage
109
+
110
+ ### Using Direct Commands (after uv sync)
111
+
112
+ ```bash
113
+ # Research a topic
114
+ shotgun research "What is quantum computing?"
115
+
116
+ # Generate a plan
117
+ shotgun plan "Build a web application"
118
+ shotgun plan "build me a house"
119
+
120
+ # Generate tasks for a project
121
+ shotgun tasks "Create a machine learning model"
122
+ ```
123
+
124
+ ### Using uv run
125
+
126
+ ```bash
127
+ # Research a topic
128
+ uv run shotgun research "What is quantum computing?"
129
+
130
+ # Generate a plan
131
+ uv run shotgun plan "Build a web application"
132
+
133
+ # Generate tasks for a project
134
+ uv run shotgun tasks "Create a machine learning model"
135
+ ```
136
+
137
+ ## Auto-Updates
138
+
139
+ Shotgun automatically checks for updates to keep you on the latest version.
140
+
141
+ ### How it works
142
+
143
+ - Checks for updates on startup (runs in background, non-blocking)
144
+ - Caches results for 24 hours to minimize API calls
145
+ - Shows notification after command execution if an update is available
146
+ - Never auto-updates development versions
147
+
148
+ ### Update Commands
149
+
150
+ ```bash
151
+ # Check for available updates
152
+ shotgun update --check
153
+
154
+ # Install available updates
155
+ shotgun update
156
+
157
+ # Force update (even for dev versions with confirmation)
158
+ shotgun update --force
159
+ ```
160
+
161
+ ### Disable Update Checks
162
+
163
+ ```bash
164
+ # Disable for a single command
165
+ shotgun --no-update-check research "topic"
166
+ ```
167
+
168
+ ### Installation Methods
169
+
170
+ The update command automatically detects and uses the appropriate method:
171
+ - **pipx**: `pipx upgrade shotgun-sh`
172
+ - **pip**: `pip install --upgrade shotgun-sh`
173
+ - **venv**: Updates within the virtual environment
174
+
175
+ ## Development Setup
176
+
177
+ ### Requirements
178
+
179
+ - **Python 3.11+** (3.13 recommended)
180
+ - **uv** - Fast Python package installer and resolver
181
+ - **actionlint** (optional) - For GitHub Actions workflow validation
182
+
183
+ ### Quick Start
184
+
185
+ 1. **Clone and setup**:
186
+ ```bash
187
+ git clone https://github.com/shotgun-sh/shotgun.git
188
+ cd shotgun
189
+ ```
190
+
191
+ 2. **Install uv** (if not already installed):
192
+ ```bash
193
+ # macOS/Linux
194
+ curl -LsSf https://astral.sh/uv/install.sh | sh
195
+
196
+ # Or via brew
197
+ brew install uv
198
+ ```
199
+
200
+ 3. **Install dependencies**:
201
+ ```bash
202
+ uv sync --all-extras
203
+ ```
204
+
205
+ 4. **Install git hooks**:
206
+ ```bash
207
+ uv run lefthook install
208
+ ```
209
+
210
+ 5. **Verify setup**:
211
+ ```bash
212
+ uv run shotgun --version
213
+ ```
214
+
215
+ ### Development Commands
216
+
217
+ ```bash
218
+ # Run the CLI
219
+ uv run shotgun --help
220
+
221
+ # Run the TUI
222
+ uv run tui
223
+
224
+ # Run tests
225
+ uv run pytest
226
+
227
+ # Run tests with coverage
228
+ uv run pytest --cov=src --cov-report=term-missing --cov-report=html
229
+
230
+ # Run linting
231
+ uv run ruff check .
232
+
233
+ # Run formatting
234
+ uv run ruff format .
235
+
236
+ # Run type checking
237
+ uv run mypy src/
238
+
239
+ # Run all pre-commit hooks manually
240
+ uv run lefthook run pre-commit
241
+ ```
242
+
243
+ ### Code Coverage
244
+
245
+ To analyze test coverage and identify areas that need testing:
246
+
247
+ ```bash
248
+ # Run tests with coverage analysis
249
+ uv run pytest --cov=src --cov-report=term-missing --cov-report=html
250
+ ```
251
+
252
+ This will:
253
+ - Display coverage summary in the terminal
254
+ - Generate a detailed HTML coverage report
255
+
256
+ **Viewing the coverage report:**
257
+ Open `htmlcov/index.html` in your browser to see:
258
+ - Overall coverage percentage
259
+ - File-by-file coverage breakdown
260
+ - Line-by-line coverage highlighting
261
+ - Missing coverage areas
262
+
263
+ The coverage configuration is in `pyproject.toml` and will automatically run when you use `uv run pytest`.
264
+
265
+ ### Git Hooks (Lefthook)
266
+
267
+ This project uses [lefthook](https://github.com/evilmartians/lefthook) for git hooks. The hooks automatically run:
268
+
269
+ - **ruff** - Python linting with auto-fix
270
+ - **ruff-format** - Code formatting
271
+ - **mypy** - Type checking
272
+ - **commitizen** - Commit message validation
273
+ - **actionlint** - GitHub Actions workflow validation (if installed)
274
+
275
+ #### Installing actionlint (recommended)
276
+
277
+ ```bash
278
+ # macOS
279
+ brew install actionlint
280
+
281
+ # Linux/macOS (direct download)
282
+ curl -sSfL https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash | bash
283
+
284
+ # Go install
285
+ go install github.com/rhysd/actionlint/cmd/actionlint@latest
286
+ ```
287
+
288
+
289
+ ### Python Version Management
290
+
291
+ The project supports **Python 3.11+**. The `.python-version` file specifies Python 3.11 to ensure development against the minimum supported version.
292
+
293
+ If using **pyenv**:
294
+ ```bash
295
+ pyenv install 3.11
296
+ ```
297
+
298
+ If using **uv** (recommended):
299
+ ```bash
300
+ uv python install 3.11
301
+ uv sync --python 3.11
302
+ ```
303
+
304
+ ### Commit Message Convention
305
+
306
+ This project enforces **Conventional Commits** specification. All commit messages must follow this format:
307
+
308
+ ```
309
+ <type>[optional scope]: <description>
310
+ ```
311
+
312
+ **Required commit types:**
313
+ - `feat`: New feature
314
+ - `fix`: Bug fix
315
+ - `docs`: Documentation changes
316
+ - `style`: Code formatting changes
317
+ - `refactor`: Code restructuring without feature changes
318
+ - `perf`: Performance improvements
319
+ - `test`: Adding or updating tests
320
+ - `build`: Build system changes
321
+ - `ci`: CI/CD changes
322
+ - `chore`: Maintenance tasks
323
+ - `revert`: Reverting previous commits
324
+
325
+ **Examples:**
326
+ ```bash
327
+ feat: add user authentication system
328
+ fix: resolve memory leak in data processing
329
+ docs: update API documentation
330
+ refactor: simplify user validation logic
331
+ ```
332
+
333
+ **For interactive commit creation:**
334
+ ```bash
335
+ uv run cz commit
336
+ ```
337
+
338
+ ### Contributing
339
+
340
+ 1. Fork the repository
341
+ 2. Create a feature branch: `git checkout -b feat/feature-name`
342
+ 3. Make your changes
343
+ 4. Run the pre-commit hooks: `uv run lefthook run pre-commit`
344
+ 5. Commit with conventional format: `git commit -m "feat: add new feature"`
345
+ 6. Push to your fork: `git push origin feat/feature-name`
346
+ 7. Create a Pull Request with conventional title format
347
+
348
+ ### CI/CD
349
+
350
+ GitHub Actions automatically:
351
+ - Runs on pull requests and pushes to main
352
+ - Tests with Python 3.11
353
+ - Validates code with ruff, ruff-format, and mypy
354
+ - Ensures all checks pass before merge
355
+
356
+ ## Observability & Telemetry
357
+
358
+ Shotgun includes built-in observability with Sentry for error tracking and Logfire for logging and tracing. Both services track users anonymously using a UUID generated on first run.
359
+
360
+ ### Anonymous User Tracking
361
+
362
+ Each user gets a unique anonymous ID stored in their config:
363
+ ```bash
364
+ # Get your anonymous user ID
365
+ shotgun config get-user-id
366
+ ```
367
+
368
+ This ID is automatically included in:
369
+ - **Sentry**: Error reports and exceptions
370
+ - **Logfire**: All logs, traces, and spans
371
+
372
+ ### Logfire Queries
373
+
374
+ Logfire uses SQL for querying logs. Here are helpful queries for debugging and analysis:
375
+
376
+ #### Find all logs for a specific user
377
+ ```sql
378
+ SELECT * FROM records
379
+ WHERE attributes->>'user_id' = 'your-user-id-here'
380
+ ORDER BY timestamp DESC;
381
+ ```
382
+
383
+ #### Track user actions
384
+ ```sql
385
+ SELECT
386
+ timestamp,
387
+ span_name,
388
+ message,
389
+ attributes
390
+ FROM records
391
+ WHERE attributes->>'user_id' = 'your-user-id-here'
392
+ AND span_name LIKE '%research%'
393
+ ORDER BY timestamp DESC;
394
+ ```
395
+
396
+ #### Find slow operations for a user
397
+ ```sql
398
+ SELECT
399
+ span_name,
400
+ duration_ms,
401
+ attributes
402
+ FROM records
403
+ WHERE attributes->>'user_id' = 'your-user-id-here'
404
+ AND duration_ms > 1000
405
+ ORDER BY duration_ms DESC;
406
+ ```
407
+
408
+ #### Find errors for a user
409
+ ```sql
410
+ SELECT * FROM records
411
+ WHERE attributes->>'user_id' = 'your-user-id-here'
412
+ AND level = 'error'
413
+ ORDER BY timestamp DESC;
414
+ ```
415
+
416
+ #### Analyze user's AI provider usage
417
+ ```sql
418
+ SELECT
419
+ attributes->>'provider' as provider,
420
+ COUNT(*) as usage_count,
421
+ AVG(duration_ms) as avg_duration
422
+ FROM records
423
+ WHERE attributes->>'user_id' = 'your-user-id-here'
424
+ AND attributes->>'provider' IS NOT NULL
425
+ GROUP BY provider;
426
+ ```
427
+
428
+ #### Track feature usage by user
429
+ ```sql
430
+ SELECT
431
+ span_name,
432
+ COUNT(*) as usage_count
433
+ FROM records
434
+ WHERE attributes->>'user_id' = 'your-user-id-here'
435
+ AND span_name IN ('research', 'plan', 'tasks')
436
+ GROUP BY span_name
437
+ ORDER BY usage_count DESC;
438
+ ```
439
+
440
+ ### Setting Up Observability (Optional)
441
+
442
+ For local development with Logfire:
443
+ ```bash
444
+ # Set environment variables
445
+ export LOGFIRE_ENABLED=true
446
+ export LOGFIRE_TOKEN=your-logfire-token
447
+
448
+ # Run shotgun - will now send logs to Logfire
449
+ shotgun research "topic"
450
+ ```
451
+
452
+ For Sentry (automatically configured in production builds):
453
+ ```bash
454
+ # Set for local development
455
+ export SENTRY_DSN=your-sentry-dsn
456
+ ```
457
+
458
+ ### Privacy
459
+
460
+ - **No PII collected**: Only anonymous UUIDs are used for identification
461
+ - **Opt-in for development**: Telemetry requires explicit environment variables
462
+ - **Automatic in production**: Production builds include telemetry for error tracking
463
+
464
+ ## Support
465
+
466
+ Join our discord https://discord.gg/5RmY6J2N7s