Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 10 additions & 25 deletions README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,12 @@ cargo install code-search-please
코드를 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
csp search "authentication flow" ./my-project --max-snippet-lines 10 # 처음 10줄만, 간결하게
csp search "saveCheckpoint" ./my-project # 전체 청크 콘텐츠
csp search "save model to disk" ./my-project --top-k 10 # 더 많은 결과
```

이후 인덱스를 재사용할 수 있습니다.

```bash
csp search "saveCheckpoint" --index my_index
```

인덱스는 자동으로 갱신되지 않습니다. 코드가 크게 바뀌었거나 검색 결과가 오래된 것 같다면 다시 인덱싱하세요.
결과는 첫 실행 때 자동으로 캐시됩니다. 로컬 경로는 파일이 바뀌면 다시 인덱싱되지만, git URL 인덱스는 URL과 `--ref`를 키로 캐시되어 갱신되지 않으므로 원격의 새 커밋을 반영하려면 `csp clear index`를 실행하세요.

`--content docs`로 문서와 산문을, `--content config`로 yaml/toml 등 설정 파일을, `--content all`로 모두 검색할 수 있습니다.

Expand All @@ -136,26 +124,23 @@ csp search "authentication" ./my-project --content all
csp search "authentication" ./my-project --max-snippet-lines 10
```

`csp find-related`로 기존 위치와 비슷한 코드를 찾을 수 있습니다 (이전 검색 결과의 `file_path`와 `line`을 사용).
`csp find-related`로 기존 위치와 비슷한 코드를 찾을 수 있습니다 (이전 검색 결과의 `file_path`와 `start_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 사용.
1. `csp search`로 관련 청크를 찾기. 인덱스는 자동으로 빌드되고 캐시됩니다.
2. 문서는 `--content docs`, 설정 파일은 `--content config`, 전부는 `--content all`.
3. 반환된 `file_path`의 `start_line`으로 바로 이동하세요. `file_path`는 검색한 경로 기준의 상대 경로입니다(예: `./my-project/<file_path>`). git URL 결과는 로컬 체크아웃이 남지 않으므로 직접 클론하거나 원격에서 여세요. 같은 내용을 다시 검색하거나 grep 하지 마세요.
4. 유망한 결과의 `file_path`와 `start_line`으로 `csp find-related`를 사용해 비슷한 구현을 추가 탐색(선택).
5. 리포지토리 전체에서 리터럴 문자열의 모든 출현 위치가 필요할 때만 grep 사용 (예: 이름이 바뀐 함수의 모든 호출처).
````

</details>
Expand Down
35 changes: 10 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,12 @@ cargo install code-search-please
Use `csp search` to find code by describing what it does or naming a symbol/identifier, instead of grep:

```bash
csp search "authentication flow" ./my-project
csp search "saveCheckpoint" ./my-project
csp search "save model to disk" ./my-project --top-k 10
```

If you anticipate doing more than one search, use `csp index` to create an index.

```bash
csp index ./my-project -o my_index
csp search "authentication flow" ./my-project --max-snippet-lines 10 # first 10 lines only, concise
csp search "saveCheckpoint" ./my-project # full chunk content
csp search "save model to disk" ./my-project --top-k 10 # more results
```

You can then reuse this index later on:

```bash
csp search "saveCheckpoint" --index my_index
```

An index is not automatically updated, so if the code changes significantly, reindex. If you notice stale results while resolving searches to files, reindex.
Results are cached automatically on first run. Local paths are re-indexed when files change; git URL indexes are keyed by URL and `--ref` and are not refreshed, so run `csp clear index` to pick up new remote commits.

Use `--content docs` to search documentation and prose, `--content config` for config files (yaml, toml, etc.), or `--content all` to search code, docs, and config:

Expand All @@ -136,26 +124,23 @@ Use `--max-snippet-lines N` to cap the code returned per result: `10` gives a si
csp search "authentication" ./my-project --max-snippet-lines 10
```

Use `csp find-related` to discover code similar to a known location (pass `file_path` and `line` from a prior search result):
Use `csp find-related` to discover code similar to a known location (pass `file_path` and `start_line` from a prior search result):

```bash
csp find-related src/auth.ts 42 ./my-project
```

Like search, `find-related` also accepts an `--index` argument.

`path` defaults to the current directory when omitted; git URLs are accepted.

If `csp` is not on `$PATH`, use `bunx @pleaseai/csp` in its place.

### Workflow

1. Index the repo using `csp index -o cached_index`.
2. Start with `csp search` to find relevant chunks. Pass the index to achieve results faster.
3. Use `--content docs` for documentation, `--content config` for config files, or `--content all` for everything.
4. Inspect full files only when the returned chunk does not give enough context.
5. Optionally use `csp find-related` with a promising result's `file_path` and `line` to discover related implementations.
6. Use grep only when you need exhaustive literal matches or quick confirmation of an exact string.
1. Start with `csp search` to find relevant chunks. The index is built and cached automatically.
2. Use `--content docs` for documentation, `--content config` for config files, or `--content all` for everything.
3. Navigate directly to the returned `file_path` at `start_line`. `file_path` is relative to the searched path (e.g. `./my-project/<file_path>`); git URL results have no local checkout, so open them in your own clone or on the remote. Do not re-search or grep for the same content.
4. Optionally use `csp find-related` with a promising result's `file_path` and `start_line` to discover related implementations.
5. Use grep only when you need every occurrence of a literal string across the whole repo (e.g., all callers of a renamed function).
````

</details>
Expand Down
35 changes: 10 additions & 25 deletions crates/csp/src/bin/csp/agents/antigravity.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,12 @@ tools:
Use `csp search` to find code by describing what it does or naming a symbol/identifier, instead of grep:

```bash
csp search "authentication flow" ./my-project
csp search "save_pretrained" ./my-project
csp search "save model to disk" ./my-project --top-k 10
csp search "authentication flow" ./my-project --max-snippet-lines 10 # first 10 lines only, concise
csp search "save_pretrained" ./my-project # full chunk content
csp search "save model to disk" ./my-project --top-k 10 # more results
```

If you anticipate doing more than one search, use `csp index` to create an index.

```bash
csp index ./my-project -o my_index
```

You can then reuse this index later on:

```bash
csp search "save_pretrained" --index my_index
```

An index is not automatically updated, so if the code changes significantly, reindex. If you notice stale results while resolving searches to files, reindex.
Results are cached automatically on first run. Local paths are re-indexed when files change; git URL indexes are keyed by URL and `--ref` and are not refreshed, so run `csp clear index` to pick up new remote commits.

Use `--content docs` to search documentation and prose, `--content config` for config files (yaml, toml, etc.), or `--content all` to search code, docs, and config:

Expand All @@ -36,23 +24,20 @@ csp search "database host port" ./my-project --content config
csp search "authentication" ./my-project --content all
```

Use `csp find-related` to discover code similar to a known location (pass `filePath` and `line` from a prior search result):
Use `csp find-related` to discover code similar to a known location (pass `file_path` and `start_line` from a prior search result):

```bash
csp find-related src/auth.ts 42 ./my-project
```

Like search, `find-related` also accepts an `--index` argument.

`path` defaults to the current directory when omitted; git URLs are accepted.

If `csp` is not on `$PATH`, use `bunx @pleaseai/csp` in its place.

### Workflow

1. Index the repo using `csp index -o cached_index`.
2. Start with `csp search` to find relevant chunks. Pass the index to achieve results faster.
3. Use `--content docs` for documentation, `--content config` for config files, or `--content all` for everything.
4. Inspect full files only when the returned chunk does not give enough context.
5. Optionally use `csp find-related` with a promising result's `filePath` and `line` to discover related implementations.
6. Use grep only when you need exhaustive literal matches or quick confirmation of an exact string.
1. Start with `csp search` to find relevant chunks. The index is built and cached automatically.
2. Use `--content docs` for documentation, `--content config` for config files, or `--content all` for everything.
3. Navigate directly to the returned `file_path` at `start_line`. `file_path` is relative to the searched path (e.g. `./my-project/<file_path>`); git URL results have no local checkout, so open them in your own clone or on the remote. Do not re-search or grep for the same content.
4. Optionally use `csp find-related` with a promising result's `file_path` and `start_line` to discover related implementations.
5. Use grep only when you need every occurrence of a literal string across the whole repo (e.g., all callers of a renamed function).
35 changes: 10 additions & 25 deletions crates/csp/src/bin/csp/agents/claude.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,12 @@ tools: Bash, Read
Use `csp search` to find code by describing what it does or naming a symbol/identifier, instead of grep:

```bash
csp search "authentication flow" ./my-project
csp search "save_pretrained" ./my-project
csp search "save model to disk" ./my-project --top-k 10
csp search "authentication flow" ./my-project --max-snippet-lines 10 # first 10 lines only, concise
csp search "save_pretrained" ./my-project # full chunk content
csp search "save model to disk" ./my-project --top-k 10 # more results
```

If you anticipate doing more than one search, use `csp index` to create an index.

```bash
csp index ./my-project -o my_index
```

You can then reuse this index later on:

```bash
csp search "save_pretrained" --index my_index
```

An index is not automatically updated, so if the code changes significantly, reindex. If you notice stale results while resolving searches to files, reindex.
Results are cached automatically on first run. Local paths are re-indexed when files change; git URL indexes are keyed by URL and `--ref` and are not refreshed, so run `csp clear index` to pick up new remote commits.

Use `--content docs` to search documentation and prose, `--content config` for config files (yaml, toml, etc.), or `--content all` to search code, docs, and config:

Expand All @@ -34,23 +22,20 @@ csp search "database host port" ./my-project --content config
csp search "authentication" ./my-project --content all
```

Use `csp find-related` to discover code similar to a known location (pass `filePath` and `line` from a prior search result):
Use `csp find-related` to discover code similar to a known location (pass `file_path` and `start_line` from a prior search result):

```bash
csp find-related src/auth.ts 42 ./my-project
```

Like search, `find-related` also accepts an `--index` argument.

`path` defaults to the current directory when omitted; git URLs are accepted.

If `csp` is not on `$PATH`, use `bunx @pleaseai/csp` in its place.

### Workflow

1. Index the repo using `csp index -o cached_index`.
2. Start with `csp search` to find relevant chunks. Pass the index to achieve results faster.
3. Use `--content docs` for documentation, `--content config` for config files, or `--content all` for everything.
4. Inspect full files only when the returned chunk does not give enough context.
5. Optionally use `csp find-related` with a promising result's `filePath` and `line` to discover related implementations.
6. Use grep only when you need exhaustive literal matches or quick confirmation of an exact string.
1. Start with `csp search` to find relevant chunks. The index is built and cached automatically.
2. Use `--content docs` for documentation, `--content config` for config files, or `--content all` for everything.
3. Navigate directly to the returned `file_path` at `start_line`. `file_path` is relative to the searched path (e.g. `./my-project/<file_path>`); git URL results have no local checkout, so open them in your own clone or on the remote. Do not re-search or grep for the same content.
4. Optionally use `csp find-related` with a promising result's `file_path` and `start_line` to discover related implementations.
5. Use grep only when you need every occurrence of a literal string across the whole repo (e.g., all callers of a renamed function).
35 changes: 10 additions & 25 deletions crates/csp/src/bin/csp/agents/commandcode.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,12 @@ tools: bash, read_file
Use `csp search` to find code by describing what it does or naming a symbol/identifier, instead of grep:

```bash
csp search "authentication flow" ./my-project
csp search "save_pretrained" ./my-project
csp search "save model to disk" ./my-project --top-k 10
csp search "authentication flow" ./my-project --max-snippet-lines 10 # first 10 lines only, concise
csp search "save_pretrained" ./my-project # full chunk content
csp search "save model to disk" ./my-project --top-k 10 # more results
```

If you anticipate doing more than one search, use `csp index` to create an index.

```bash
csp index ./my-project -o my_index
```

You can then reuse this index later on:

```bash
csp search "save_pretrained" --index my_index
```

An index is not automatically updated, so if the code changes significantly, reindex. If you notice stale results while resolving searches to files, reindex.
Results are cached automatically on first run. Local paths are re-indexed when files change; git URL indexes are keyed by URL and `--ref` and are not refreshed, so run `csp clear index` to pick up new remote commits.

Use `--content docs` to search documentation and prose, `--content config` for config files (yaml, toml, etc.), or `--content all` to search code, docs, and config:

Expand All @@ -34,23 +22,20 @@ csp search "database host port" ./my-project --content config
csp search "authentication" ./my-project --content all
```

Use `csp find-related` to discover code similar to a known location (pass `filePath` and `line` from a prior search result):
Use `csp find-related` to discover code similar to a known location (pass `file_path` and `start_line` from a prior search result):

```bash
csp find-related src/auth.ts 42 ./my-project
```

Like search, `find-related` also accepts an `--index` argument.

`path` defaults to the current directory when omitted; git URLs are accepted.

If `csp` is not on `$PATH`, use `bunx @pleaseai/csp` in its place.

### Workflow

1. Index the repo using `csp index -o cached_index`.
2. Start with `csp search` to find relevant chunks. Pass the index to achieve results faster.
3. Use `--content docs` for documentation, `--content config` for config files, or `--content all` for everything.
4. Inspect full files only when the returned chunk does not give enough context.
5. Optionally use `csp find-related` with a promising result's `filePath` and `line` to discover related implementations.
6. Use grep only when you need exhaustive literal matches or quick confirmation of an exact string.
1. Start with `csp search` to find relevant chunks. The index is built and cached automatically.
2. Use `--content docs` for documentation, `--content config` for config files, or `--content all` for everything.
3. Navigate directly to the returned `file_path` at `start_line`. `file_path` is relative to the searched path (e.g. `./my-project/<file_path>`); git URL results have no local checkout, so open them in your own clone or on the remote. Do not re-search or grep for the same content.
4. Optionally use `csp find-related` with a promising result's `file_path` and `start_line` to discover related implementations.
5. Use grep only when you need every occurrence of a literal string across the whole repo (e.g., all callers of a renamed function).
Loading
Loading