sourcefire 0.2.0__py3-none-any.whl
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.
- sourcefire/__init__.py +0 -0
- sourcefire/api/__init__.py +0 -0
- sourcefire/api/models.py +24 -0
- sourcefire/api/routes.py +166 -0
- sourcefire/chain/__init__.py +0 -0
- sourcefire/chain/prompts.py +195 -0
- sourcefire/chain/rag_chain.py +967 -0
- sourcefire/cli.py +293 -0
- sourcefire/config.py +148 -0
- sourcefire/db.py +196 -0
- sourcefire/indexer/__init__.py +0 -0
- sourcefire/indexer/embeddings.py +27 -0
- sourcefire/indexer/language_profiles.py +448 -0
- sourcefire/indexer/metadata.py +289 -0
- sourcefire/indexer/pipeline.py +406 -0
- sourcefire/init.py +189 -0
- sourcefire/prompts/system.md +28 -0
- sourcefire/retriever/__init__.py +0 -0
- sourcefire/retriever/graph.py +162 -0
- sourcefire/retriever/search.py +86 -0
- sourcefire/static/.DS_Store +0 -0
- sourcefire/static/app.js +414 -0
- sourcefire/static/index.html +102 -0
- sourcefire/static/styles.css +607 -0
- sourcefire/watcher.py +105 -0
- sourcefire-0.2.0.dist-info/METADATA +145 -0
- sourcefire-0.2.0.dist-info/RECORD +31 -0
- sourcefire-0.2.0.dist-info/WHEEL +5 -0
- sourcefire-0.2.0.dist-info/entry_points.txt +2 -0
- sourcefire-0.2.0.dist-info/licenses/LICENSE +21 -0
- sourcefire-0.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sourcefire
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: AI-powered codebase RAG from your terminal — index any project, ask questions, get answers with full source context.
|
|
5
|
+
Author-email: Athar Wani <athar@cravv.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/waniathar2/sourcefire
|
|
8
|
+
Project-URL: Repository, https://github.com/waniathar2/sourcefire
|
|
9
|
+
Project-URL: Issues, https://github.com/waniathar2/sourcefire/issues
|
|
10
|
+
Keywords: rag,codebase,ai,code-search,embeddings,chromadb,gemini
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Environment :: Web Environment
|
|
14
|
+
Classifier: Framework :: FastAPI
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Classifier: Topic :: Text Processing :: Indexing
|
|
24
|
+
Requires-Python: >=3.11
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: chromadb
|
|
28
|
+
Requires-Dist: langchain
|
|
29
|
+
Requires-Dist: langchain-google-genai
|
|
30
|
+
Requires-Dist: fastapi
|
|
31
|
+
Requires-Dist: uvicorn[standard]
|
|
32
|
+
Requires-Dist: sse-starlette
|
|
33
|
+
Requires-Dist: sentence-transformers
|
|
34
|
+
Requires-Dist: tree-sitter
|
|
35
|
+
Requires-Dist: python-dotenv
|
|
36
|
+
Requires-Dist: watchfiles
|
|
37
|
+
Requires-Dist: tomli-w
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: pytest; extra == "dev"
|
|
40
|
+
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
41
|
+
Requires-Dist: httpx; extra == "dev"
|
|
42
|
+
Dynamic: license-file
|
|
43
|
+
|
|
44
|
+
# Sourcefire
|
|
45
|
+
|
|
46
|
+
AI-powered codebase RAG from your terminal. Index any project, ask questions, get answers with full source context.
|
|
47
|
+
|
|
48
|
+
## Install
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install sourcefire
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Quick Start
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
cd your-project
|
|
58
|
+
sourcefire
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
That's it. Sourcefire will:
|
|
62
|
+
|
|
63
|
+
1. **Auto-detect** your project structure and language
|
|
64
|
+
2. **Generate** smart include/exclude patterns via LLM
|
|
65
|
+
3. **Index** your codebase into a local ChromaDB vector database
|
|
66
|
+
4. **Serve** a web UI where you can ask questions about your code
|
|
67
|
+
5. **Watch** for file changes and re-index automatically
|
|
68
|
+
|
|
69
|
+
## Requirements
|
|
70
|
+
|
|
71
|
+
- Python 3.11+
|
|
72
|
+
- A [Gemini API key](https://ai.google.dev/) (prompted on first run, saved to `.env`)
|
|
73
|
+
|
|
74
|
+
## How It Works
|
|
75
|
+
|
|
76
|
+
Sourcefire creates a `.sourcefire/` directory in your project root:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
.sourcefire/
|
|
80
|
+
├── config.toml # Project config (auto-generated, editable)
|
|
81
|
+
├── chroma/ # Vector database (local, no server needed)
|
|
82
|
+
└── graph.json # Import graph for code navigation
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
- **No PostgreSQL** — uses ChromaDB (SQLite-backed, embedded)
|
|
86
|
+
- **No external services** — everything runs locally
|
|
87
|
+
- **Per-project isolation** — each project gets its own database
|
|
88
|
+
|
|
89
|
+
## Features
|
|
90
|
+
|
|
91
|
+
- **Zero config** — first run auto-generates everything via LLM analysis
|
|
92
|
+
- **8 language profiles** — Python, JavaScript/TypeScript, Go, Rust, Java, Dart, C, C++
|
|
93
|
+
- **AST-aware chunking** — splits code at function/class boundaries using tree-sitter
|
|
94
|
+
- **Live re-indexing** — file watcher detects changes and re-indexes automatically
|
|
95
|
+
- **3 query modes** — Debug (stack traces), Feature (architecture), Explain (walkthroughs)
|
|
96
|
+
- **18 code exploration tools** — the LLM can read files, search code, trace call chains, git blame, and more
|
|
97
|
+
- **Incremental indexing** — only re-indexes files that changed since last run
|
|
98
|
+
|
|
99
|
+
## CLI Options
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
sourcefire [--port PORT] [--no-open] [--reinit] [--verbose]
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
| Flag | Description |
|
|
106
|
+
|------|-------------|
|
|
107
|
+
| `--port PORT` | Server port (default: 8000) |
|
|
108
|
+
| `--no-open` | Don't auto-open browser |
|
|
109
|
+
| `--reinit` | Regenerate include/exclude patterns via LLM |
|
|
110
|
+
| `--verbose` | Verbose logging |
|
|
111
|
+
|
|
112
|
+
## Configuration
|
|
113
|
+
|
|
114
|
+
Edit `.sourcefire/config.toml` to customize:
|
|
115
|
+
|
|
116
|
+
```toml
|
|
117
|
+
[project]
|
|
118
|
+
name = "my-project"
|
|
119
|
+
language = "auto" # or "python", "go", "rust", etc.
|
|
120
|
+
|
|
121
|
+
[indexer]
|
|
122
|
+
include = ["src/**/*.py"] # glob patterns to index
|
|
123
|
+
exclude = ["__pycache__/**", ".venv/**"]
|
|
124
|
+
chunk_size = 1000
|
|
125
|
+
chunk_overlap = 300
|
|
126
|
+
|
|
127
|
+
[llm]
|
|
128
|
+
model = "gemini-2.5-flash"
|
|
129
|
+
api_key_env = "GEMINI_API_KEY"
|
|
130
|
+
|
|
131
|
+
[server]
|
|
132
|
+
port = 8000
|
|
133
|
+
|
|
134
|
+
[retrieval]
|
|
135
|
+
top_k = 8
|
|
136
|
+
relevance_threshold = 0.3
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Subdirectory Support
|
|
140
|
+
|
|
141
|
+
Run `sourcefire` from any subdirectory — it walks up the tree to find `.sourcefire/`, just like `git` finds `.git/`.
|
|
142
|
+
|
|
143
|
+
## License
|
|
144
|
+
|
|
145
|
+
MIT — Created by [Athar Wani](https://github.com/waniathar2) / Cravv HQ
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
sourcefire/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
sourcefire/cli.py,sha256=hsFHOWdDnT_-7wEgxC9xGz5R0LYAm_4BHocnir8S7v4,9354
|
|
3
|
+
sourcefire/config.py,sha256=t2Nj1cFNzfZnuD_h_2WXIbaYKarkuHhvWaLmhVmcRB4,4387
|
|
4
|
+
sourcefire/db.py,sha256=gcWqucQiFx90E662DqkvHQhZUMZXyLWQXmGo-NyWH_w,6089
|
|
5
|
+
sourcefire/init.py,sha256=6KXPQzXx1ARZE_k9cQO4Z3f4p6YrusSXzu4YQKEZKSw,6527
|
|
6
|
+
sourcefire/watcher.py,sha256=leuhFsHtshu6WlG9dDg0a0EGLk54ktfJJkd5Gzejcfw,3421
|
|
7
|
+
sourcefire/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
sourcefire/api/models.py,sha256=9XPz2-Jv7GlAblnMBz4dQKTc7awwjV2scd8p5PmF-zM,539
|
|
9
|
+
sourcefire/api/routes.py,sha256=OW_68DfArCrG-onKJ8wofacW5S1e5yptPrtBCOB-JtM,5107
|
|
10
|
+
sourcefire/chain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
+
sourcefire/chain/prompts.py,sha256=_fWUVvCRpxVFilYUiCogzn48148ZhIBDDZ_5TcHL7K8,7095
|
|
12
|
+
sourcefire/chain/rag_chain.py,sha256=SIseSFMv7-EPPVAE65dbfSQSt_iz6TGg3Q545JMg0tc,40102
|
|
13
|
+
sourcefire/indexer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
sourcefire/indexer/embeddings.py,sha256=NHru2EemwFEKFlI1fxO6MFkylQz1_WKMdK8Q0rqs4RM,849
|
|
15
|
+
sourcefire/indexer/language_profiles.py,sha256=AS5tvcxPfLgotbih6sfGWAHTI8RWcuFm2KugLZC-rx4,17248
|
|
16
|
+
sourcefire/indexer/metadata.py,sha256=YgD2xhu7YjZllqxpbEL3L3NWPZSmdKkudJWqtpAAeSg,9944
|
|
17
|
+
sourcefire/indexer/pipeline.py,sha256=D3py7Ghzk3vnLbrX_5Jnab17Vy9rd7eIe7dLb1t6f64,14522
|
|
18
|
+
sourcefire/prompts/system.md,sha256=zhtnPXB9y6Ivogkwh2-BB1mKQRhRIpt5j9o9bsD3V9A,1894
|
|
19
|
+
sourcefire/retriever/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
+
sourcefire/retriever/graph.py,sha256=EKmiOw0nLd0rU-nIi15I14nGMZDlqhNqwOsat-75XYw,6622
|
|
21
|
+
sourcefire/retriever/search.py,sha256=Y_i-rajEOh9TKsDCZb7gFcITWGVgzYZVyEu-HVa1Rk8,2900
|
|
22
|
+
sourcefire/static/.DS_Store,sha256=lx0UQYJQ_qydBUmotG31X-8EkH-Rql37JVLT8MeArCQ,6148
|
|
23
|
+
sourcefire/static/app.js,sha256=LPyLczn_82HCULjWHTY2SpLUsmpJmzmwBIFrfZYqPMM,16594
|
|
24
|
+
sourcefire/static/index.html,sha256=cRL423bFyR6swI8swQHP3l2fUsVBVu1SnvnUt2WOvZU,4956
|
|
25
|
+
sourcefire/static/styles.css,sha256=EnqXc6CRD8GIdNXQbHJoV99SRWBngXEoI3LOmd8ZaRA,15016
|
|
26
|
+
sourcefire-0.2.0.dist-info/licenses/LICENSE,sha256=27S47ig6TxxttTerVhgHQHC49hGpjajlSQWRoppOtgg,1078
|
|
27
|
+
sourcefire-0.2.0.dist-info/METADATA,sha256=szhoR4JybNisadOtL929r5OFj1Mt6YcRm3CfzFbL7do,4510
|
|
28
|
+
sourcefire-0.2.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
29
|
+
sourcefire-0.2.0.dist-info/entry_points.txt,sha256=0lih7Cue2ZIONYmVoaCi1i6_VR-LZgUAZhg0NgL11Hc,51
|
|
30
|
+
sourcefire-0.2.0.dist-info/top_level.txt,sha256=encqOtqU02nLFojL1OVoGK21_TCoJ5Ljy-VtZ6Ou4wc,11
|
|
31
|
+
sourcefire-0.2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Athar Wani / Cravv HQ
|
|
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 @@
|
|
|
1
|
+
sourcefire
|