A lightweight, privacy-first tool to explore any codebase with AI-powered semantic search and a 3D visualization in the browser.
- Drop a folder, find answers — no manual grep required.
- Privacy-first — code stays on your machine; no upload server.
- Works everywhere — browser UI + cross-platform CLI.
- Pluggable AI — local embeddings by default, or bring your own OpenAI-compatible API.
npm install
npm run devOpen http://localhost:3000, drop a project folder, and start searching.
curl -fsSL https://raw.githubusercontent.com/ankitk18/SourceSphere/main/scripts/install.sh | bashAfter installing, open a new terminal or run:
export PATH="$HOME/.sourcesphere/bin:$PATH"
sourcesphere --helpgit clone https://github.com/ankitk18/SourceSphere.git
cd SourceSphere
npm install
npx tsx src/cli/index.ts --helpThen use it from anywhere (after install):
# Interactive mode — answer the prompts, then ask as many questions as you want
sourcesphere
# One-shot mode for scripts
sourcesphere ./my-project -q "where is auth handled?"
# Skip embedding next time: load previously saved embeddings and keep asking
sourcesphere --load sourcesphere-embeddings.jsonOr from the cloned repo:
npx tsx src/cli/index.ts ./my-project -q "where is auth handled?"
npx tsx src/cli/index.ts --load sourcesphere-embeddings.jsonWhen you run the CLI without a query, it will prompt: "What would you like to ask about your code?" — type a question to search, or type exit to quit. You can ask as many follow-up questions as you want without re-embedding. Embeddings are auto-saved to sourcesphere-embeddings.json by default, so you can resume later with --load.
- Drag & drop folder upload with
webkitdirectory - Recursive parsing of code files (
.js,.ts,.py,.java,.cpp, and more) - Natural-language semantic search with similarity scores
- PCA-based 3D code graph (web UI)
- Swappable embedding providers:
- Xenova (local, free, runs in browser & Node)
- OpenAI-compatible APIs
Next.js · React · TypeScript · Tailwind CSS · Three.js · Transformers.js · Commander · Inquirer
sourcesphere [folder] [options]
-i, --interactive Run interactive setup prompts
-q, --query <text> Search query
-o, --output <file> Save embeddings JSON (default: sourcesphere-embeddings.json)
-l, --load <file> Load embeddings JSON and skip parsing/embedding
--provider <xenova|openai>
--api-key, --base-url, --model, --env-file
SOURCESPHERE_PROVIDER=openai
SOURCESPHERE_API_KEY=sk-...
SOURCESPHERE_BASE_URL=https://api.openai.com/v1
SOURCESPHERE_MODEL=text-embedding-3-small
SOURCESPHERE_QUANTIZED=true