sx is a local-first semantic and lexical code explorer built in Rust. It indexes
code and configuration files from a project and supports fast search workflows from
the terminal or interactive TUI.
- Discover repository context and initialize a local
.sxworkspace. - Build and update indexed content with incremental indexing.
- Run BM25 text search, semantic search, and hybrid query modes.
- Inspect referenced chunks and trace results into working directory guidance.
- Interact from CLI subcommands and default TUI mode.
- Rust 1.75+ for source builds.
SQLiteand internet access when using remote embedding providers.
brew tap BrainBuzzer/sx
brew install sxcurl -fsSL https://raw.githubusercontent.com/BrainBuzzer/sx/main/install.sh | shcargo install --path .The onboarding entry point is:
sx onboardThis launches the interactive configuration flow for embedding provider/model credentials used by sx.
Use non-interactive mode only when needed:
sx onboard --defaults
sx onboard --skip-check
sx onboard --defaults --skip-checkCurrent available onboarding flags:
--defaultsto skip prompts and use current defaults.--skip-checkto skip provider connectivity checks during onboarding.
For provider credentials, use the auth command directly:
sx auth zhipu --api-key <KEY>
sx auth voyage --from-env
sx auth statussx is a terminal-first code exploration workflow built around a project-local index.
- Initialize workspace and database:
sx initThis sets up .sx/, resolves root config (.sx/config.toml), and migrates .sx/index.sqlite.
- Build search index:
sx index
sx index --fullCreates chunked, BM25-ready local indexes from project files.
- Search text:
sx search "<query>" --limit 20
sx search "<query>" --fts
sx search "<query>" --json- Build embedding vectors (optional but required for semantic modes):
sx embed
sx embed --full
sx embed --provider openai --model <model>- Run semantic / hybrid searches:
sx vsearch "<query>"
sx query "<query>"- Navigate findings:
sx get "<result-id>"
sx open "<result-id>"
sx cd "<query>"
sx guide "<query>"
sx trace "<query>"- Environment checks:
sx doctorsx opens directly into the interactive TUI when no subcommand is provided:
sx# initialize workspace, index, and search
sx init
sx index
sx search "semantic search" --limit 20
# open and inspect by reference
sx get "<result-id>"
sx open "<result-id>"
# launch TUI mode
sxsrc/cli.rsdefines available commands and flags..sx/config.tomlis the generated project configuration..sx/index.sqlitestores local index data.
MIT License. See LICENSE.