forked from codeprysm/codeprysm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
214 lines (173 loc) · 7.55 KB
/
justfile
File metadata and controls
214 lines (173 loc) · 7.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# CodePrysm - Code Graph Generator and Semantic Search
# List available commands
default:
@just --list
##############################################################################################
# Main Commands
##############################################################################################
# Install project dependencies and setup
setup:
cargo build --workspace --release
# Initialize code search system (generate graph only, indexing happens in MCP server)
init repo_dir="." codeprysm_dir="./.codeprysm":
#!/usr/bin/env bash
echo "Initializing code graph for {{repo_dir}}..."
echo "Output: {{codeprysm_dir}} (partitioned storage)"
./target/release/codeprysm-core generate --repo {{repo_dir}} --output {{codeprysm_dir}}
# Start MCP server for interactive code analysis
mcp root="." codeprysm_dir="" qdrant_url="http://localhost:6334":
#!/usr/bin/env bash
echo "Starting MCP server..."
echo "Root: {{root}}, Qdrant: {{qdrant_url}}"
codeprysm_dir_arg=""
if [ -n "{{codeprysm_dir}}" ]; then
codeprysm_dir_arg="--codeprysm-dir {{codeprysm_dir}}"
echo "CodePrysm dir: {{codeprysm_dir}}"
fi
./target/release/codeprysm mcp --root {{root}} $codeprysm_dir_arg --qdrant-url {{qdrant_url}}
# Update graph incrementally
update repo_dir="." codeprysm_dir="./.codeprysm":
#!/usr/bin/env bash
echo "Updating code graph for {{repo_dir}}..."
./target/release/codeprysm-core update --repo {{repo_dir}} --codeprysm-dir {{codeprysm_dir}}
##############################################################################################
# Qdrant (Vector Database)
##############################################################################################
# Start Qdrant in Docker (required for search)
qdrant-start:
#!/usr/bin/env bash
echo "Starting Qdrant..."
docker run -d --name qdrant -p 6333:6333 -p 6334:6334 \
-v $(pwd)/.codeprysm/qdrant:/qdrant/storage \
qdrant/qdrant:latest
echo "Qdrant started at http://localhost:6333 (REST) and http://localhost:6334 (gRPC)"
# Stop Qdrant
qdrant-stop:
#!/usr/bin/env bash
echo "Stopping Qdrant..."
docker stop qdrant && docker rm qdrant
echo "Qdrant stopped"
# Check Qdrant status
qdrant-status:
#!/usr/bin/env bash
docker ps --filter name=qdrant --format "table {{{{.Names}}}}\t{{{{.Status}}}}\t{{{{.Ports}}}}" || echo "Qdrant not running"
##############################################################################################
# Search Commands
##############################################################################################
# Index a code graph to Qdrant for semantic search
index codeprysm_dir="./.codeprysm" root="." repo_id="":
#!/usr/bin/env bash
echo "Indexing code graph to Qdrant..."
repo_id_arg=""
if [ -n "{{repo_id}}" ]; then
repo_id_arg="--repo-id {{repo_id}}"
fi
./target/release/codeprysm-search index --codeprysm-dir {{codeprysm_dir}} --root {{root}} $repo_id_arg
# Search the indexed codebase
search query repo_id="" limit="10":
#!/usr/bin/env bash
repo_id_arg=""
if [ -n "{{repo_id}}" ]; then
repo_id_arg="--repo-id {{repo_id}}"
fi
./target/release/codeprysm-search search "{{query}}" $repo_id_arg --limit {{limit}}
# Show index status for a repository
index-status repo_id="" root=".":
#!/usr/bin/env bash
repo_id_arg=""
if [ -n "{{repo_id}}" ]; then
repo_id_arg="--repo-id {{repo_id}}"
fi
./target/release/codeprysm-search status --root {{root}} $repo_id_arg
##############################################################################################
# Graph Commands
##############################################################################################
# Generate code graph only
generate-graph repo_dir output="./.codeprysm":
#!/usr/bin/env bash
echo "Generating code graph for {{repo_dir}}..."
./target/release/codeprysm-core generate --repo {{repo_dir}} --output {{output}}
# Show graph statistics and analysis
stats codeprysm_dir="./.codeprysm":
#!/usr/bin/env bash
echo "Analyzing graph statistics for {{codeprysm_dir}}..."
./target/release/codeprysm-core stats --codeprysm-dir {{codeprysm_dir}} --detailed
# Update repository incrementally (faster than full rebuild)
update-repo repo_dir codeprysm_dir="./.codeprysm":
#!/usr/bin/env bash
echo "Performing incremental update for {{repo_dir}}..."
./target/release/codeprysm-core update --repo {{repo_dir}} --codeprysm-dir {{codeprysm_dir}}
# Force full rebuild of repository
rebuild-repo repo_dir codeprysm_dir="./.codeprysm":
#!/usr/bin/env bash
echo "Performing full rebuild for {{repo_dir}}..."
./target/release/codeprysm-core update --repo {{repo_dir}} --codeprysm-dir {{codeprysm_dir}} --force
##############################################################################################
# Docker
##############################################################################################
# Build MCP Server Docker image for local testing
docker-build:
docker build -f docker/Dockerfile -t codeprysm:local .
##############################################################################################
# Rust Development
##############################################################################################
# Check all Rust crates compile
rust-check:
cargo check --workspace
# Build all Rust crates (debug)
rust-build:
cargo build --workspace
# Build all Rust crates (release)
rust-build-release:
cargo build --workspace --release
# Build with Metal/MPS GPU acceleration (macOS)
rust-build-metal:
cargo build -p codeprysm-core --release
cargo build -p codeprysm-cli --release --features metal
# Build with CUDA GPU acceleration (Linux/Windows)
rust-build-cuda:
cargo build -p codeprysm-core --release
cargo build -p codeprysm-cli --release --features cuda
# Build with both Metal and CUDA (for distribution)
rust-build-gpu:
cargo build -p codeprysm-core --release
cargo build -p codeprysm-cli --release --features metal,cuda
# Run all Rust tests
rust-test:
cargo test --workspace
# Run Rust tests with output
rust-test-verbose:
cargo test --workspace -- --nocapture
# Format Rust code
rust-fmt:
cargo fmt --all
# Check Rust formatting
rust-fmt-check:
cargo fmt --all -- --check
# Run Rust linter (clippy)
rust-lint:
cargo clippy --workspace -- -D warnings
# Clean Rust build artifacts
rust-clean:
cargo clean
# Run integration tests for all languages
rust-test-integration:
cargo test --package codeprysm-core --test integration -- --nocapture
# Run integration tests for a specific language
rust-test-integration-lang lang:
cargo test --package codeprysm-core --test integration {{lang}} -- --nocapture
# Run integration test summary
rust-test-integration-summary:
cargo test --package codeprysm-core --test integration test_all_fixtures_summary -- --nocapture
# Run nightly integration tests (real-world repos, requires --ignored)
rust-test-integration-nightly:
cargo test --package codeprysm-core --test integration -- --ignored --nocapture
# Run real-world repo tests (Tier 2 - clones GitHub repos)
rust-test-realworld:
cargo test --package codeprysm-core --test realworld_tests -- --ignored --nocapture
# Run real-world test for a specific language
rust-test-realworld-lang lang:
cargo test --package codeprysm-core --test realworld_tests {{lang}} -- --ignored --nocapture
# Run real-world test summary
rust-test-realworld-summary:
cargo test --package codeprysm-core --test realworld_tests test_realworld_all_summary -- --ignored --nocapture