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
8 changes: 8 additions & 0 deletions site/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ A target is a file, a folder, or a file with a line range: `src/app.py:40-80` fo
| `-y`, `--yes` | Skip the size confirmation. |
| `-r`, `--resolve` | Recursively resolve imports of the targets. |
| `--format` | `xml` (default), `markdown` or `json`. See [Formats](#formats). |
| `--github` | Read the target `OWNER/REPO` from GitHub (implied by a github.com URL). |
| `--ref` | GitHub: branch, tag or commit (default: the repository's default branch). |
| `--path` | GitHub: only this path of the repository; repeat for more, `FILE:40-60` for lines. |
| `--auth` | GitHub: send your token (`GH_TOKEN`, `GITHUB_TOKEN` or `gh`) to read private repositories. |
| `--max-file-size` | GitHub: list larger files as skipped, without downloading (default: `1MB`). |

A GitHub repository (`OWNER/REPO --github`, or its URL) is read the same way, without cloning.

Above 30,000 estimated tokens or 100 files, `scan` asks before continuing. When nobody can answer (no terminal on stdin), it stops with exit code 1 and a hint instead of waiting; `-y` takes everything. A line names any credential files that were withheld.

Expand All @@ -95,6 +102,7 @@ cdg scan src/app.py -r # one file and the local files it imports
cdg scan src/billing/ docs/ # folders, files, or both
cdg scan src/app.py -l # with line numbers
cdg scan src/app.py:40-80 # only lines 40 to 80
cdg scan OWNER/REPO --github --ref v1.2 --path src/app.py:40-60 # lines of a file in a GitHub repository
```

## `cdg digest`
Expand Down
8 changes: 8 additions & 0 deletions site/ko/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ cdg scan [OPTIONS] [targets]...
| `-y`, `--yes` | 크기 확인을 건너뜁니다. |
| `-r`, `--resolve` | 대상이 import하는 파일을 재귀적으로 담습니다. |
| `--format` | `xml`(기본), `markdown`, `json`. [출력 형식](#formats)을 참고하세요. |
| `--github` | 대상 `OWNER/REPO`를 GitHub에서 읽습니다 (github.com URL이면 자동으로 켜짐). |
| `--ref` | GitHub: 브랜치, 태그 또는 커밋 (기본: 저장소의 기본 브랜치). |
| `--path` | GitHub: 저장소의 이 경로만 읽습니다. 여러 번 줄 수 있고, 줄 범위는 `FILE:40-60`입니다. |
| `--auth` | GitHub: 토큰(`GH_TOKEN`, `GITHUB_TOKEN` 또는 `gh`)을 보내 비공개 저장소를 읽습니다. |
| `--max-file-size` | GitHub: 이보다 큰 파일은 내려받지 않고 건너뛴 파일로 표시합니다 (기본: `1MB`). |

GitHub 저장소(`OWNER/REPO --github` 또는 그 URL)도 복제하지 않고 같은 방식으로 읽습니다.

추정 토큰이 3만을 넘거나 파일이 100개를 넘으면 `scan`은 계속할지 묻습니다. 대답할 사람이 없을 때(stdin이 터미널이 아닐 때)는 기다리지 않고 힌트와 함께 종료 코드 1로 멈춥니다. 전부 가져오려면 `-y`를 붙입니다. 빼 놓은 인증 정보 파일이 있으면 그 이름을 알려 주는 줄이 나옵니다.

Expand All @@ -95,6 +102,7 @@ cdg scan src/app.py -r # 파일 하나와, 그 파일이 import하는 프
cdg scan src/billing/ docs/ # 폴더나 파일 여러 개
cdg scan src/app.py -l # 줄 번호를 붙여서
cdg scan src/app.py:40-80 # 40~80번째 줄만
cdg scan OWNER/REPO --github --ref v1.2 --path src/app.py:40-60 # GitHub 저장소 파일의 일부 줄
```

## `cdg digest`
Expand Down
Loading