csp โ Code Search Please
์์ด์ ํธ๋ฅผ ์ํ ๋น ๋ฅด๊ณ ์ ํํ ์ฝ๋ ๊ฒ์
grep+read ๋๋น ์ฝ 98% ์ ์ ํ ํฐ ์ฌ์ฉ
Rust ํฌํธ.
csp๋ Python์ผ๋ก ์์ฑ๋ MinishLab/semble์ Rust ํฌํธ์ ๋๋ค. ์๊ณ ๋ฆฌ์ฆ๊ณผ ์ค๊ณ์ ๋ชจ๋ ๊ณต๋ก๋ ์์ ์์๊ฒ ์์ต๋๋ค. Rust ๋ฐ์ด๋๋ฆฌ๋ Homebrew์ npm์ผ๋ก ๋ฐฐํฌ๋๋ ์์ฒด ์๊ฒฐํ ์คํ ํ์ผ์ ๋๋ค(Homebrew ๋น๋๋ ๋ฐํ์์ด ํ์ ์์).
csp๋ ์์ด์ ํธ๋ฅผ ์ํด ์ค๊ณ๋ ์ฝ๋ ๊ฒ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์
๋๋ค. ํ์ํ ์ฝ๋ ์ค๋ํซ์ ์ฆ์ ๋ฐํํ๋ฉฐ, grep + read ์กฐํฉ ๋๋น ์ฝ 98% ์ ์ ํ ํฐ๋ง ์ฌ์ฉํฉ๋๋ค. ์ ์ฒด ์ฝ๋๋ฒ ์ด์ค์ ์ธ๋ฑ์ฑ๊ณผ ๊ฒ์์ด 1์ด ์ด๋ด์ ๋๋๋ฉฐ, API ํค, GPU, ์ธ๋ถ ์๋น์ค ์์ด CPU ์์์๋ง ๋์ํฉ๋๋ค. MCP ์๋ฒ๋ก ์คํํ๊ฑฐ๋ AGENTS.md ์๋ด๋ก ์
ธ์์ ํธ์ถํ๋ฉด Claude Code, Cursor, Codex, OpenCode ๋ฑ ์ด๋ค ์์ด์ ํธ๋ผ๋ ์์์ ๋ฆฌํฌ์งํ ๋ฆฌ์ ์ฆ์ ์ ๊ทผํ ์ ์์ต๋๋ค.
์์ด์ ํธ๋ "์ธ์ฆ์ ์ด๋ป๊ฒ ์ฒ๋ฆฌ๋๋์?" ๊ฐ์ ์์ฐ์ด๋ก csp์ ์ง์ํ๊ณ , ๊ด๋ จ ์ฝ๋ ์ค๋ํซ๋ง ๋ฐ์๋ด
๋๋ค. grep ํ๊ฑฐ๋ ์ ์ฒด ํ์ผ์ ์ฝ์ ํ์๊ฐ ์์ต๋๋ค.
csp๋ ์ธ ๊ฐ์ง ๋ณด์์ ์ธ ์ฌ์ฉ ๋ฐฉ๋ฒ์ ์ ๊ณตํฉ๋๋ค. ์
๋ค ํจ๊ป ์ฐ๋ ๊ฒ์ ๊ถ์ฅํ์ง๋ง, ํ์์ ๋ฐ๋ผ ๊ณจ๋ผ ์ฐ์
๋ ๋ฉ๋๋ค.
- MCP ์๋ฒ: ์์ด์ ํธ๊ฐ ํธ์ถํ ์ ์๋ MCP ์๋ฒ.
- AGENTS.md: CLI ํธ์ถ ์ง์นจ์ ๋ด์
AGENTS.md์ค๋ํซ. - ์๋ธ ์์ด์ ํธ: ์ง์ ํ๋์ค๋ฅผ ์ํ ์ ์ฉ
csp-search์๋ธ ์์ด์ ํธ.
csp๋ฅผ MCP ๋ค์ดํฐ๋ธ ๋๊ตฌ๋ก ๋
ธ์ถ์์ผ ์์ด์ ํธ๊ฐ ์ง์ ํธ์ถํ๊ฒ ํฉ๋๋ค. Claude Code์ ๋ค์๊ณผ ๊ฐ์ด ์ถ๊ฐํฉ๋๋ค.
claude mcp add csp -s user -- bunx @pleaseai/csp mcp๋ค๋ฅธ ํ๋์ค(Cursor, Codex, OpenCode ๋ฑ)๋ ์๋ MCP ์๋ฒ ์น์ ์ ์ฐธ๊ณ ํ์ธ์.
csp๋ฅผ ์ค์ ํ๋ ๊ฐ์ฅ ๋น ๋ฅธ ๋ฐฉ๋ฒ์ ํ๋ฌ๊ทธ์ธ์
๋๋ค. MCP ์๋ฒ์ csp-search ํฌํผ๋ฅผ ํ ๋ฒ์ ๋ฑ๋กํ๋ฉฐ, ๋์ผํ ๋๋ ํฐ๋ฆฌ์์ Claude Code์ Codex ์์ชฝ์ ์ง์ํฉ๋๋ค.
Claude Code:
/plugin marketplace add pleaseai/claude-code-plugins
/plugin install csp@pleaseai
Codex:
codex plugin marketplace add pleaseai/claude-code-plugins
codex plugin add csp@pleaseaicsp MCP ์๋ฒ(search, find_related)์ ํจ๊ป csp-search ์๋ธ์์ด์ ํธ(Claude Code) / ์คํฌ(Codex)์ ๋ฒ๋คํฉ๋๋ค. ์๋ฒ๋ฅผ bunx๋ก ์คํํ๋ ค๋ฉด PATH์ Bun์ด ์์ด์ผ ํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ plugins/csp๋ฅผ ์ฐธ๊ณ ํ์ธ์.
์์ด์ ํธ์ ์ปจํ
์คํธ์ csp ์ฌ์ฉ๋ฒ์ ์ถ๊ฐํด ์ธ์ ์ด๋ป๊ฒ CLI๋ฅผ ํธ์ถํ ์ง ์ ์ ์๋๋ก ํฉ๋๋ค. ๋จผ์ csp CLI๋ฅผ ์ค์นํ ๋ค, ์๋ ์ค๋ํซ์ AGENTS.md ๋๋ CLAUDE.md์ ์ถ๊ฐํ์ธ์.
# Homebrew (macOS / Linux) โ Node/Bun ์์ด ๋์ํ๋ ๋
๋ฆฝ ์คํ ๋ฐ์ด๋๋ฆฌ
brew install pleaseai/tap/csp
# ๋๋ ๋
๋ฆฝ ์คํ ๋ฐ์ด๋๋ฆฌ๋ฅผ ์ง์ ๋ด๋ ค๋ฐ๊ธฐ (ํจํค์ง ๋งค๋์ ๋ถํ์)
curl -fsSL https://raw.githubusercontent.com/pleaseai/code-search/main/scripts/install.sh | bash
# ๋๋ JavaScript ํจํค์ง ๋งค๋์ ๋ก ์ค์น (PATH์ Bun ๋๋ Node 22+ ํ์)
bun add -g @pleaseai/csp # bun์ผ๋ก ์ค์น (๊ถ์ฅ)
npm install -g @pleaseai/csp # ๋๋ npm
pnpm add -g @pleaseai/csp # ๋๋ pnpm
# ๋๋ Cargo๋ก ์์ค์์ ์ค์น (standalone ๋ฐ์ด๋๋ฆฌ๋ฅผ ๋ก์ปฌ์์ ์ปดํ์ผ)
cargo install code-search-pleaseHomebrew formula๋ ์์ฒด ์๊ฒฐํ Rust ๋ฐ์ด๋๋ฆฌ๋ฅผ ์ ๊ณตํฉ๋๋ค(
cargo build --release; tree-sitter ๋ฌธ๋ฒยท์๋ฒ ๋ฉ ๋ฐํ์ ๋ด์ฅ)๋ฏ๋ก ๋ฐํ์์ Node/Bun์ด ํ์ ์์ต๋๋ค.install.sh์คํฌ๋ฆฝํธ๋ ํ๋ซํผ์ ๋ง๋ ๋์ผํ ๋ ๋ฆฝ ์คํ ๋ฐ์ด๋๋ฆฌ๋ฅผ GitHub ๋ฆด๋ฆฌ์ค์์ ๋ด๋ ค๋ฐ์ ์ฒดํฌ์ฌ์ ๊ฒ์ฆํ ๋ค~/.local/bin์ ์ค์นํฉ๋๋ค(CSP_INSTALL_DIR๋ก ๊ฒฝ๋ก ๋ณ๊ฒฝ,bash -s -- --version v0.1.7๋ก ๋ฒ์ ๊ณ ์ ๊ฐ๋ฅ). npm ํจํค์ง๋ ๋์ผํ ๋ฐ์ด๋๋ฆฌ๋ฅผ ์์ Node ๋ฐ์ฒ ๋ค์ ๋ด์ ๋ฐฐํฌํ๋ฏ๋ก,npm/bun/pnpm์ค์น ๊ฒฝ๋ก๋PATH์ Bun ๋๋ Node 22+๊ฐ ํ์ํฉ๋๋ค. ์ธ๋ฑ์ค๋~/.csp/์ ์บ์๋ฉ๋๋ค(ADR 0002 ์ฐธ๊ณ ).
AGENTS.md / CLAUDE.md ์ค๋ํซ
## Code Search
์ฝ๋๋ฅผ grep ์ผ๋ก ์ฐพ๊ธฐ ์ ์ `csp search`๋ฅผ ์ฌ์ฉํ์ธ์. ๋์์ ์์ฐ์ด๋ก ์ค๋ช
ํ๊ฑฐ๋ ์ฌ๋ณผ/์๋ณ์๋ช
์ ์
๋ ฅํ๋ฉด ๋ฉ๋๋ค.
```bash
csp search "authentication flow" ./my-project
csp search "saveCheckpoint" ./my-project
csp search "save model to disk" ./my-project --top-k 10
```
์ฌ๋ฌ ๋ฒ ๊ฒ์ํ ์์ ์ด๋ผ๋ฉด `csp index`๋ก ์ธ๋ฑ์ค๋ฅผ ๋ง๋ค์ด ๋์ธ์.
```bash
csp index ./my-project -o my_index
```
์ดํ ์ธ๋ฑ์ค๋ฅผ ์ฌ์ฌ์ฉํ ์ ์์ต๋๋ค.
```bash
csp search "saveCheckpoint" --index my_index
```
์ธ๋ฑ์ค๋ ์๋์ผ๋ก ๊ฐฑ์ ๋์ง ์์ต๋๋ค. ์ฝ๋๊ฐ ํฌ๊ฒ ๋ฐ๋์๊ฑฐ๋ ๊ฒ์ ๊ฒฐ๊ณผ๊ฐ ์ค๋๋ ๊ฒ ๊ฐ๋ค๋ฉด ๋ค์ ์ธ๋ฑ์ฑํ์ธ์.
`--content docs`๋ก ๋ฌธ์์ ์ฐ๋ฌธ์, `--content config`๋ก yaml/toml ๋ฑ ์ค์ ํ์ผ์, `--content all`๋ก ๋ชจ๋ ๊ฒ์ํ ์ ์์ต๋๋ค.
```bash
csp search "deployment guide" ./my-project --content docs
csp search "database host port" ./my-project --content config
csp search "authentication" ./my-project --content all
```
`csp find-related`๋ก ๊ธฐ์กด ์์น์ ๋น์ทํ ์ฝ๋๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค (์ด์ ๊ฒ์ ๊ฒฐ๊ณผ์ `file_path`์ `line`์ ์ฌ์ฉ).
```bash
csp find-related src/auth.ts 42 ./my-project
```
`search`์ ๋ง์ฐฌ๊ฐ์ง๋ก `find-related`๋ `--index` ์ธ์๋ฅผ ๋ฐ์ต๋๋ค.
`path`๋ฅผ ์๋ตํ๋ฉด ํ์ฌ ๋๋ ํฐ๋ฆฌ๋ฅผ ์ฌ์ฉํฉ๋๋ค. git URL๋ ๋ฐ์ต๋๋ค.
`csp`๊ฐ `$PATH`์ ์๋ค๋ฉด `bunx @pleaseai/csp`๋ก ๋์ฒดํ์ธ์.
### Workflow
1. `csp index -o cached_index`๋ก ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ์ธ๋ฑ์ฑ.
2. `csp search`๋ก ๊ด๋ จ ์ฒญํฌ๋ฅผ ์ฐพ๊ธฐ. ์ธ๋ฑ์ค๋ฅผ ๋๊ธฐ๋ฉด ๋ ๋น ๋ฆ
๋๋ค.
3. ๋ฌธ์๋ `--content docs`, ์ค์ ํ์ผ์ `--content config`, ์ ๋ถ๋ `--content all`.
4. ๋ฐํ๋ ์ฒญํฌ๋ก ์ปจํ
์คํธ๊ฐ ๋ถ์กฑํ ๋๋ง ํ์ผ์ ์ ์ฒด ์ฝ๊ธฐ.
5. ์ ๋งํ ๊ฒฐ๊ณผ์์ `csp find-related`๋ก ๋น์ทํ ๊ตฌํ์ ์ถ๊ฐ ํ์.
6. ์ ํํ ๋ฆฌํฐ๋ด ๋งค์นญ์ด๋ ๋ฌธ์์ด ํ์ธ์ด ํ์ํ ๋๋ง grep ์ฌ์ฉ.์๋ธ ์์ด์ ํธ๋ฅผ ์ง์ํ๋ ํ๋์ค์์๋ csp-search ์ ์ฉ ์๋ธ ์์ด์ ํธ๋ฅผ ์ค์นํด ๊ฒ์์ด ๋ณ๋ ์ปจํ
์คํธ์์ ๋์ํ๋๋ก ํ ์ ์์ต๋๋ค (CLI ํ์).
csp init # Claude Code โ .claude/agents/csp-search.md๋ค๋ฅธ ํ๋์ค(Cursor, Codex, OpenCode ๋ฑ)๋ ์๋ ์๋ธ ์์ด์ ํธ ์ค์ ์น์ ์ ์ฐธ๊ณ ํ์ธ์.
csp ์ ๋ฐ์ดํธ
bun update -g @pleaseai/csp # bun
npm update -g @pleaseai/csp # npm
pnpm update -g @pleaseai/csp # pnpm- ๋น ๋ฆ: ํ๊ท ์ ์ธ ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ 1์ด ์ด๋ด์ ์ธ๋ฑ์ฑํ๊ณ , ์ฟผ๋ฆฌ๋ ๋ฐ๋ฆฌ์ด ๋จ์๋ก ์๋ตํฉ๋๋ค. ์ ๋ถ CPU์์ ๋์ํฉ๋๋ค.
- ์ ํํจ: ํ์ด๋ธ๋ฆฌ๋ ๊ฒ์(๋ฐ์ง ์๋ฒ ๋ฉ + BM25)๊ณผ ์ฝ๋ ์ธ์งํ ๋ฆฌ๋ญํน์ ๊ฒฐํฉํฉ๋๋ค.
- ํ ํฐ ํจ์จ์ : ๊ด๋ จ ์ฒญํฌ๋ง ๋ฐํํ๋ฏ๋ก grep+read ๋๋น ์ฝ 98% ์ ์ ํ ํฐ์ ์ฌ์ฉํฉ๋๋ค.
- ์ ๋ก ์ ์ : API ํค, GPU, ์ธ๋ถ ์๋น์ค ์์ด CPU์์ ๋์ํฉ๋๋ค.
- MCP ์๋ฒ: Claude Code, Cursor, Codex, OpenCode, VS Code ๋ฑ MCP ํธํ ์์ด์ ํธ์ ํจ๊ป ์ฌ์ฉ ๊ฐ๋ฅํฉ๋๋ค.
- ๋ก์ปฌ / ์๊ฒฉ: ๋ก์ปฌ ๊ฒฝ๋ก ๋๋ git URL์ ๋ชจ๋ ๋ฐ์ต๋๋ค.
- ๋จ์ผ ๋ฐ์ด๋๋ฆฌ: ์์ฒด ์๊ฒฐํ Rust ์คํ ํ์ผ โ Homebrew๋ก๋ ๋ฐํ์ ์์ด ์ค์นํ๊ฑฐ๋, npm/bun/pnpm์ผ๋ก ์ค์น(
PATH์ Node 22+ ๋๋ Bun ํ์).
csp๋ MCP ์๋ฒ๋ก ๋์ํ ์ ์์ด ์์ด์ ํธ๊ฐ ์ด๋ค ์ฝ๋๋ฒ ์ด์ค๋ ์ง์ ๊ฒ์ํ ์ ์์ต๋๋ค. ๋ฆฌํฌ์งํ ๋ฆฌ๋ ํ์ํ ๋ ํด๋ก ๋์ด ์ธ๋ฑ์ฑ๋ฉ๋๋ค. ์๋ฒ๋ ์ธ์
๋์ ์ธ๋ฉ๋ชจ๋ฆฌ ํซ ์บ์๋ฅผ ์ ์งํ๋ฉฐ, CLI์ ๋์ผํ ๋์คํฌ ์บ์ ~/.csp/index/๋ฅผ ๊ณต์ ํ๋ฏ๋ก ํ ๋ฒ ๋ง๋ ์ธ๋ฑ์ค๋ ์์ชฝ์์ ์ฌ์ฌ์ฉ๋ฉ๋๋ค. ๋ก์ปฌ ๊ฒฝ๋ก๋ ํ์ผ ๋ณ๊ฒฝ์ ๊ฐ์ํด ์๋์ผ๋ก ์ฌ์ธ๋ฑ์ฑํ๋ฉฐ, ๋์คํฌ ์บ์ ์ฌ์ฌ์ฉ์ ์์ค ์ฝํ
์ธ ํด์๋ก ๋ฌดํจํ๋ฉ๋๋ค.
Claude Code
claude mcp add csp -s user -- bunx @pleaseai/csp mcpCursor
~/.cursor/mcp.json (๋๋ ํ๋ก์ ํธ ๋ด .cursor/mcp.json)์ ์ถ๊ฐ:
{
"mcpServers": {
"csp": {
"command": "bunx",
"args": ["@pleaseai/csp", "mcp"]
}
}
}Codex
~/.codex/config.toml์ ์ถ๊ฐ:
[mcp_servers.csp]
command = "bunx"
args = [
"@pleaseai/csp",
"mcp"
]OpenCode
~/.opencode/config.json์ ์ถ๊ฐ:
{
"mcp": {
"csp": {
"type": "local",
"command": ["bunx", "@pleaseai/csp", "mcp"]
}
}
}VS Code
ํ๋ก์ ํธ์ .vscode/mcp.json (๋๋ ์ฌ์ฉ์ ํ๋กํ์ mcp.json)์ ์ถ๊ฐ:
{
"servers": {
"csp": {
"command": "bunx",
"args": ["@pleaseai/csp", "mcp"]
}
}
}GitHub Copilot CLI
~/.copilot/mcp-config.json์ ์ถ๊ฐ:
{
"mcpServers": {
"csp": {
"command": "bunx",
"args": ["@pleaseai/csp", "mcp"]
}
}
}Windsurf
~/.codeium/windsurf/mcp_config.json์ ์ถ๊ฐ:
{
"mcpServers": {
"csp": {
"command": "bunx",
"args": ["@pleaseai/csp", "mcp"]
}
}
}Gemini CLI
~/.gemini/settings.json์ ์ถ๊ฐ:
{
"mcpServers": {
"csp": {
"command": "bunx",
"args": ["@pleaseai/csp", "mcp"]
}
}
}Zed
~/.config/zed/settings.json (๋๋ ํ๋ก์ ํธ ๋ด .zed/settings.json)์ ์ถ๊ฐ:
{
"context_servers": {
"csp": {
"command": "bunx",
"args": ["@pleaseai/csp", "mcp"]
}
}
}| ๋๊ตฌ | ์ค๋ช |
|---|---|
search |
์์ฐ์ด ๋๋ ์ฝ๋ ์ฟผ๋ฆฌ๋ก ์ฝ๋๋ฒ ์ด์ค๋ฅผ ๊ฒ์. repo๋ ๋ก์ปฌ ๋๋ ํฐ๋ฆฌ ๊ฒฝ๋ก ๋๋ https:// git URL. |
find_related |
ํ์ผ ๊ฒฝ๋ก์ ๋ผ์ธ ๋ฒํธ๋ฅผ ๋ฐ์, ํด๋น ์์น์ ์ฝ๋์ ์๋ฏธ์ ์ผ๋ก ์ ์ฌํ ์ฒญํฌ๋ฅผ ๋ฐํ. |
๊ธฐ๋ณธ์ ์ผ๋ก MCP ์๋ฒ๋ ์ฝ๋ ํ์ผ๋ง ์ธ๋ฑ์ฑํฉ๋๋ค. ๋ฌธ์/์ค์ /์ ์ฒด๋ฅผ ํจ๊ป ์ธ๋ฑ์ฑํ๋ ค๋ฉด ๋ช
๋ น์ --content docs, --content config, --content all ๋๋ ์กฐํฉ(์: --content code docs)์ ์ถ๊ฐํ์ธ์. ์๋ฅผ ๋ค์ด Claude Code์์๋ claude mcp add csp -s user -- bunx @pleaseai/csp mcp --content all.
Claude Code, Gemini CLI, Cursor, OpenCode, GitHub Copilot CLI, Kiro, Antigravity, Command Code, Pi, Reasonix๋ ๋ชจ๋ ์ ์ฉ csp ๊ฒ์ ์๋ธ ์์ด์ ํธ๋ฅผ ์ง์ํฉ๋๋ค. ํ๋ก์ ํธ ๋ฃจํธ์์ csp init์ ํ ๋ฒ ์คํํ์ธ์.
csp init # Claude Code โ .claude/agents/csp-search.md
csp init --agent gemini # Gemini CLI โ .gemini/agents/csp-search.md
csp init --agent cursor # Cursor โ .cursor/agents/csp-search.md
csp init --agent opencode # OpenCode โ .opencode/agents/csp-search.md
csp init --agent copilot # Copilot CLI โ .github/agents/csp-search.md
csp init --agent kiro # Kiro โ .kiro/agents/csp-search.md
csp init --agent antigravity # Antigravity โ .antigravity/agents/csp-search.md
csp init --agent commandcode # Command Code โ .commandcode/agents/csp-search.md
csp init --agent pi # Pi โ .pi/agents/csp-search.md
csp init --agent reasonix # Reasonix โ .reasonix/agents/csp-search.mdcsp๊ฐ $PATH์ ์๋ค๋ฉด ๋ช
๋ น ์์ bunx @pleaseai/csp๋ฅผ ๋ถ์ด์ธ์.
csp๋ ๋
๋ฆฝ ์คํํ CLI๋ก๋ ์ ๊ณต๋ฉ๋๋ค. ์คํฌ๋ฆฝํธ๋ MCP ์ธ์
์์ด ๊ฒ์ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ๊ณ ์ถ์ ๋ ์ ์ฉํฉ๋๋ค.
# ๋ก์ปฌ ๋ฆฌํฌ์งํ ๋ฆฌ ๊ฒ์
csp search "authentication flow" ./my-project
# ๋ฐ๋ณต ๊ฒ์์ ๋น ๋ฅด๊ฒ ํ๋ ค๋ฉด ๋จผ์ ์ธ๋ฑ์ฑ (--index๋ ์๋ ๋ชจ๋ ๋ช
๋ น๊ณผ ํธํ)
csp index ./my-project -o my-index
csp search "authentication flow" --index my-index
# ์๊ฒฉ ๋ฆฌํฌ์งํ ๋ฆฌ ๊ฒ์ (ํ์ํ ๋ ํด๋ก )
csp search "save model to disk" https://github.com/MinishLab/model2vec
# ๊ฒฐ๊ณผ ๊ฐ์ ์ ํ
csp search "save model to disk" ./my-project --top-k 10
# ์ฝ๋ ๋์ docs/config/์ ์ฒด ๊ฒ์
csp search "deployment guide" ./my-project --content docs # ๋๋ config, all
# ํน์ ์์น์ ๋น์ทํ ์ฝ๋ ์ฐพ๊ธฐ
csp find-related src/auth.ts 42 ./my-project--content๋ code (๊ธฐ๋ณธ), docs, config, all์ ๋ฐ์ต๋๋ค. path๋ฅผ ์๋ตํ๋ฉด ํ์ฌ ๋๋ ํฐ๋ฆฌ๋ฅผ ์ฌ์ฉํฉ๋๋ค. git URL๋ ๋ฐ์ต๋๋ค. csp๊ฐ $PATH์ ์๋ค๋ฉด bunx @pleaseai/csp๋ก ๋์ฒดํ์ธ์.
csp search๋ csp find-related๋ฅผ --index ์์ด ์คํํ๋ฉด, csp๋ ์์ค์ ์ฝํ
์ธ ์ ํ์ ํค๋ก ํ์ฌ ๊ธ๋ก๋ฒ ์บ์ ~/.csp/index/์ ์๋์ผ๋ก ์ธ๋ฑ์ฑยท์บ์ํฉ๋๋ค. ๋ค์ ์คํ ๋ ์บ์๋ฅผ ์ฌ์ฌ์ฉํ๋ฉฐ, ์์ค ํ์ผ์ด ๋ฐ๋๋ฉด ์ฝํ
์ธ ํด์๋ก ์๋ ๋ฌดํจํ๋๋ฏ๋ก ์๋์ผ๋ก ๋ค์ ์ธ๋ฑ์ฑํ ํ์๊ฐ ์์ต๋๋ค. --index <๊ฒฝ๋ก>๋ฅผ ์ง์ ํ๋ฉด ๊ทธ ๊ฒฝ๋ก๋ฅผ ๊ทธ๋๋ก ์ฌ์ฉํ๊ณ ์๋ ์บ์๋ฅผ ์ฐํํฉ๋๋ค. csp index -o <๊ฒฝ๋ก>๋ ๋ช
์์ ์์ํ ์ ์ฉ(-o ํ์)์ด๋ฉฐ ์๋ ์บ์์๋ ๋
๋ฆฝ์ ์
๋๋ค.
ํ ํฐ ์ ์ฝ๋ ๋ณด๊ธฐ
csp savings๋ ๋ชจ๋ ๊ฒ์์์ csp๊ฐ ์ ์ฝํ ํ ํฐ๋์ ๋ณด์ฌ์ค๋๋ค.
csp savings # ๊ธฐ๊ฐ๋ณ ์์ฝ
csp savings --verbose # ํธ์ถ ์ ํ๋ณ ๋ถํด ํฌํจ Csp Token Savings
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Total saved: ~1.2M tokens (89%)
Total calls: 1.4k
Efficiency: โโโโโโโโโโโโโโโโโโโโโโโโ 89%
By Period
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Period Calls Saved Ratio
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Today 42 ~58.4k tokens โโโโโโโโโโโโโโโโโโโโโโโโ 95%
Last 7 days 287 ~312.4k tokens โโโโโโโโโโโโโโโโโโโโโโโโ 90%
All time 1.4k ~1.2M tokens โโโโโโโโโโโโโโโโโโโโโโโโ 89%
์ ์ฝ๋ ๊ณ์ฐ: ๊ฐ ํธ์ถ๋ง๋ค ๋ฐํ๋ ์ฒญํฌ๊ฐ ์ํ ํ์ผ๋ค์ ์ด ๋ฌธ์ ์์ ๋ฐํ๋ ์ค๋ํซ์ ๋ฌธ์ ์๋ฅผ ๊ธฐ๋กํฉ๋๋ค. ์ ์ฝ๋ ํ ํฐ ์ถ์ ์น๋ (ํ์ผ ๋ฌธ์ ์ โ ์ค๋ํซ ๋ฌธ์ ์) / 4 (1ํ ํฐ โ 4๋ฌธ์). ์ด๋ ๋ณด์์ ์ธ ์ถ์ ์ผ๋ก, ๊ธฐ์ค์ ์ "์์ด์ ํธ๊ฐ ๋งค์นญ๋ ํ์ผ์ ํต์งธ๋ก ์ฝ๋๋ค"๋ ์ผ๋ฐ์ ์ธ ์ฝ๋ฉ ์์ด์ ํธ ๋์์
๋๋ค.
stdout์ด ์ปฌ๋ฌ๋ฅผ ์ง์ํ๋ TTY์ผ ๋ ์ถ๋ ฅ์ ์์ด ์
ํ์ง๋๋ค(NO_COLOR, dumb ํฐ๋ฏธ๋, ํ์ดํ ์ฐ๊ฒฐ ์์๋ ๋นํ์ฑํ). --verbose๋ฅผ ์ฃผ๋ฉด "By Call Type" ๋ถํด๊ฐ ์ถ๊ฐ๋ฉ๋๋ค.
ํต๊ณ๋ ~/.csp/savings.jsonl์ ์ ์ฅ๋ฉ๋๋ค.
์บ์ ๋น์ฐ๊ธฐ
csp clear๋ ์บ์๋ ๋ฐ์ดํฐ๋ฅผ ์ญ์ ํฉ๋๋ค.
csp clear savings # ~/.csp/savings.jsonl ์ญ์
csp clear index # ๊ธ๋ก๋ฒ ์ธ๋ฑ์ค ์บ์ ~/.csp/index/ ์ญ์
csp clear all # ์ธ๋ฑ์ค ์บ์์ savings ๋ชจ๋ ์ญ์ clear index๋ ๊ธ๋ก๋ฒ ์ธ๋ฑ์ค ์บ์ ~/.csp/index/(์ฌ๊ธฐ์ csp search/find-related๊ฐ ์ธ๋ฑ์ค๋ฅผ ์๋ ์บ์ํฉ๋๋ค)๋ฅผ ์ญ์ ํ๊ณ ์ ๊ฑฐ๋ ์บ์ ์ํธ๋ฆฌ ์๋ฅผ ๋ณด๊ณ ํฉ๋๋ค. ~/.csp/savings.jsonl์ ๋ณด์กด๋ฉ๋๋ค. clear all์ ~/.csp/index/์ ~/.csp/savings.jsonl์ ๊ฐ๊ฐ ๋
๋ฆฝ์ ์ผ๋ก ์ญ์ ํฉ๋๋ค.
csp index -o <๊ฒฝ๋ก>๋ก ๋ช
์์ ์ผ๋ก ๊ธฐ๋กํ ์ธ๋ฑ์ค ๊ฒฝ๋ก๋ ์๋ ์บ์ ๋์์ด ์๋๋ฏ๋ก clear๊ฐ ๊ฑด๋๋ฆฌ์ง ์์ต๋๋ค. ํด๋น ๋๋ ํฐ๋ฆฌ๋ ์ง์ ์ญ์ ํ์ธ์.
๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฌ์ฉ
csp๋ ๋ ๊ฐ์ง ๋ฐฉ์์ผ๋ก ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ก ์ธ ์ ์์ต๋๋ค. Rust ํฌ๋ ์ดํธ, ๋๋ ๊ฐ์ ์ฝ์ด๋ฅผ napi-rs๋ก ๋ค์ดํฐ๋ธ ๋ฐ์ธ๋ฉํ JavaScript/TypeScript SDK(@pleaseai/csp-sdk)์
๋๋ค.
Rust โ ์งง์ ์ด๋ฆ csp๊ฐ ์ด๋ฏธ ์ ์ ๋์ด ์์ด crates.io์๋ code-search-please๋ก ๋ฐฐํฌ๋ฉ๋๋ค. ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ด๋ฆ์ csp ๊ทธ๋๋ก์ด๋ฏ๋ก ์์กด์ฑ์ code-search-please๋ก ์ถ๊ฐํ๋ ์ฝ๋์์๋ use csp::...๋ฅผ ์๋๋ค. CspIndex(from_path / from_git / search / find_related)์ ContentType enum, ๋ญํน ํ์ดํ๋ผ์ธ์ ๋
ธ์ถํฉ๋๋ค.
์ด ํฌ๋ ์ดํธ๋ csp CLI๋ ํจ๊ป ๋ด๊ณ ์์ต๋๋ค(๊ธฐ๋ณธ ํ์ฑํ๋ cli ํผ์ฒ). ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ก ์์กดํ ๋๋ ๊ธฐ๋ณธ ํผ์ฒ๋ฅผ ๋๋ฉด CLI ์คํ(clap / tokio / rmcp)์ ๊ฑด๋๋๋๋ค:
[dependencies]
code-search-please = { version = "0.1", default-features = false }use std::path::Path;
use csp::indexing::index::{CspIndex, LoadOptions, QueryOptions};
// ๋ก์ปฌ ๋๋ ํฐ๋ฆฌ๋ฅผ ์ธ๋ฑ์ฑํ๊ณ ๊ฒ์
let index = CspIndex::from_path(Path::new("./my-project"), &LoadOptions::default())?;
let results = index.search("save model to disk", &QueryOptions { top_k: Some(3), ..Default::default() });
for r in &results {
println!("{}:{}-{}", r.chunk.file_path, r.chunk.start_line, r.chunk.end_line);
}JavaScript / TypeScript โ @pleaseai/csp-sdk๋ ๋์ผํ Rust ๊ฒ์ ์์ง์ ์ธํ๋ก์ธ์ค๋ก ์คํํ๋ ๋ค์ดํฐ๋ธ(napi-rs) ์ ๋์จ์
๋๋ค. ์๋ธํ๋ก์ธ์ค๋, JSON ์๋ณต๋ ์์ต๋๋ค. ๋น๋ ์ง์
์ ์ ๋น๋๊ธฐ, ์ฟผ๋ฆฌ ํธ์ถ์ ๋๊ธฐ์
๋๋ค.
import { ContentType, CspIndex } from '@pleaseai/csp-sdk'
const index = await CspIndex.fromPath('./my-project', { content: [ContentType.Code] })
const results = index.search('save model to disk', { topK: 3 })
for (const { chunk, score } of results) {
console.log(score.toFixed(3), chunk.location) // ์: 0.871 src/index.ts:42-58
}๋ npm ํจํค์ง๋ ๋ณ๊ฐ์ ๋๋ค. **
@pleaseai/csp**๋cspCLI + MCP ์๋ฒ๋ฅผ ๋ฐ์ฒ ๋ค์ ๋ด์ ๋ฐฐํฌํ๋ฉฐ(JS API๋ ๋ ธ์ถํ์ง ์์), **@pleaseai/csp-sdk**๋ ์ธํ๋ก์ธ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ SDK์ ๋๋ค. ๋ ๋ค ํ๋์ Rust ์ฝ์ด์์ ๋น๋๋ฉ๋๋ค. ํฌ๋ ์ดํธ๋ crates.io์code-search-please๋ก ๋ฐฐํฌ๋๋ฉฐ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ด๋ฆ์csp์ ๋๋ค.
csp๋ tree-sitter๋ก ๊ฐ ํ์ผ์ ์ฝ๋ ์ธ์งํ ์ฒญํฌ๋ก ๋ถํ ํ ๋ค, ๋ ๊ฐ์ ์ํธ ๋ณด์์ ์ธ ๊ฒ์๊ธฐ๋ก ์ฟผ๋ฆฌ๋ฅผ ๋ชจ๋ ์ฒญํฌ์ ์ ์ํํฉ๋๋ค. ์๋ฏธ ์ ์ฌ๋๋ฅผ ์ํ ์ ์ Model2Vec ์๋ฒ ๋ฉ(์ฝ๋ ํนํ potion-code-16M-v2 ๋ชจ๋ธ ์ฌ์ฉ)๊ณผ, ์๋ณ์/API๋ช
๋ฑ ์ดํ ๋งค์นญ์ ์ํ BM25์
๋๋ค. ๋ ์ ์ ๋ฆฌ์คํธ๋ Reciprocal Rank Fusion(RRF)์ผ๋ก ๊ฒฐํฉ๋ฉ๋๋ค.
๊ฒฐํฉ ํ์๋ ์ฝ๋ ์ธ์งํ ์ ํธ๋ค๋ก ๊ฒฐ๊ณผ๋ฅผ ์ฌ์ ๋ ฌํฉ๋๋ค.
๋ญํน ์ ํธ
- ์ ์ํ ๊ฐ์ค์น.
Foo::bar,_private,getUserById๊ฐ์ ์ฌ๋ณผํ ์ฟผ๋ฆฌ๋ ์ดํ ๊ฐ์ค์น๋ฅผ ๋ ๋ฐ๊ณ , ์์ฐ์ด ์ฟผ๋ฆฌ๋ ์๋ฏธ/์ดํ ๊ฒ์๊ธฐ ์ฌ์ด์์ ๊ท ํ์ ์ ์งํฉ๋๋ค. - ์ ์ ๋ถ์คํธ. ์ฟผ๋ฆฌ๋ ์ฌ๋ณผ์ ์ ์ํ๋ ์ฒญํฌ(
class,function,interface๋ฑ)๋ ๋จ์ ์ฐธ์กฐํ๋ ์ฒญํฌ๋ณด๋ค ์์์ ์์นํฉ๋๋ค. - ์๋ณ์ ์คํ
. ์ฟผ๋ฆฌ ํ ํฐ์ ์คํ
์ฒ๋ฆฌํด ์ฒญํฌ ๋ด ์๋ณ์ ์คํ
๊ณผ ๋งค์นญํ๊ณ , ๋งค์นญ๋ ์ฒญํฌ์ ์ถ๊ฐ ๊ฐ์ค์น๋ฅผ ๋ถ์ฌํฉ๋๋ค. ์:
parse config์ฟผ๋ฆฌ๋parseConfig,ConfigParser,config_parser๊ฐ ํฌํจ๋ ์ฒญํฌ๋ฅผ ๋ถ์คํธํฉ๋๋ค. - ํ์ผ ์ผ๊ด์ฑ. ๊ฐ์ ํ์ผ์ ์ฌ๋ฌ ์ฒญํฌ๊ฐ ์ฟผ๋ฆฌ์ ๋งค์นญ๋๋ฉด ํด๋น ํ์ผ์ ๋ถ์คํธํด, ๋จ์ผ ์ฒญํฌ๊ฐ ์๋ ํ์ผ ์์ค์ ๊ด๋ จ์ฑ์ด ์์์ ๋ฐ์๋๋๋ก ํฉ๋๋ค.
- ๋
ธ์ด์ฆ ํ๋ํฐ. ํ
์คํธ ํ์ผ,
compat//legacy/์ ฐ์, ์์ ์ฝ๋,.d.ts์ ์ธ ์คํ ์ ์์๊ฐ ๋ฎ์์ ธ ์ ๊ท ๊ตฌํ์ด ๋จผ์ ๋ ธ์ถ๋ฉ๋๋ค.
์๋ฒ ๋ฉ ๋ชจ๋ธ์ด ์ ์ ์ด๋ผ ์ฟผ๋ฆฌ ์์ ์ ํธ๋์คํฌ๋จธ forward pass๊ฐ ์์ผ๋ฏ๋ก, ์ ๋ชจ๋ ๊ณผ์ ์ด CPU์์ ๋ฐ๋ฆฌ์ด ๋จ์๋ก ๋์ํฉ๋๋ค.
๋ผ์ด๋ธ๋ฌ๋ฆฌ์ csp ๋ฐ์ด๋๋ฆฌ๋ Cargo ์ํฌ์คํ์ด์ค์
๋๋ค(crates/csp์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ csp ๋ฐ์ด๋๋ฆฌ๊ฐ ํจ๊ป ์๊ณ , csp ๋ฐ์ด๋๋ฆฌ๋ ๊ธฐ๋ณธ ํ์ฑํ๋ cli ํผ์ฒ ๋ค์ ์์ต๋๋ค):
cargo build --release # csp ๋ฐ์ด๋๋ฆฌ ๋น๋
cargo test --workspace # ํ
์คํธ ์คํ
cargo fmt --all # ํฌ๋งท
cargo clippy --all-targets --all-features -- -D warnings # ๋ฆฐํธcsp๋ MinishLab์ Thomas van Dongen๊ณผ Stรฉphan Tulkens๊ฐ ๋ง๋ Semble์ Rust ํฌํธ์
๋๋ค. ์๊ณ ๋ฆฌ์ฆ, ๋ญํน ์ ํธ, ์ ์ฒด ์ํคํ
์ฒ์ ๊ณต๋ก๋ ๋ชจ๋ ์์ ์์๊ฒ ์์ผ๋ฉฐ, ๋ณธ ํ๋ก์ ํธ๋ ์ด๋ฅผ Rust๋ก ์ด์ํ ๊ฒ์
๋๋ค.
์ฐ๊ตฌ์์ ํต์ฌ ์์ด๋์ด๋ฅผ ์ธ์ฉํ์๋ ค๋ฉด ์๋ณธ Semble ๋ ผ๋ฌธ์ ์ธ์ฉํด ์ฃผ์ธ์.
@software{minishlab2026semble,
author = {{van Dongen}, Thomas and Stephan Tulkens},
title = {Semble: Fast and Accurate Code Search for Agents},
year = {2026},
publisher = {Zenodo},
doi = {10.5281/zenodo.19785932},
url = {https://github.com/MinishLab/semble},
license = {MIT}
}csp๋ ๋์ผํ๊ฒ MIT ๋ผ์ด์ ์ค์ธ MinishLab/semble์ ํ์ ์ ์๋ฌผ์
๋๋ค.