deepsource
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDeepSource CLI
DeepSource CLI
Authentication
认证
bash
./scripts/check_auth.shIf not authenticated:
bash
deepsource auth loginbash
./scripts/check_auth.sh如果未完成认证:
bash
deepsource auth loginGoals
功能目标
Get code review issues
获取代码审查问题
bash
deepsource issues --output jsonFilter examples:
bash
deepsource issues --severity critical,major --output json
deepsource issues --category security,bug-risk --output json
deepsource issues --path src/auth --output json
deepsource issues --severity critical --category security --limit 20 --output jsonScope to a PR or branch:
bash
deepsource issues --pr 42 --output json
deepsource issues --default-branch --output jsonbash
deepsource issues --output json过滤示例:
bash
deepsource issues --severity critical,major --output json
deepsource issues --category security,bug-risk --output json
deepsource issues --path src/auth --output json
deepsource issues --severity critical --category security --limit 20 --output json限定到某个PR或分支:
bash
deepsource issues --pr 42 --output json
deepsource issues --default-branch --output jsonGet report card
获取报告卡
bash
deepsource report-card --output jsonReturns grades (A-F) and scores for security, reliability, complexity, hygiene, coverage, and an aggregate.
Scope to a PR or commit:
bash
deepsource report-card --pr 42 --output json
deepsource report-card --commit abc123 --output jsonbash
deepsource report-card --output json返回安全、可靠性、复杂度、代码卫生、覆盖率的评分等级(A-F)和得分,以及综合得分。
限定到某个PR或提交:
bash
deepsource report-card --pr 42 --output json
deepsource report-card --commit abc123 --output jsonGet vulnerabilities
获取漏洞
bash
deepsource vulnerabilities --output jsonFilter by severity:
bash
deepsource vulnerabilities --severity critical,high --output jsonScope to a PR or branch:
bash
deepsource vulnerabilities --pr 42 --output json
deepsource vulnerabilities --default-branch --output jsonbash
deepsource vulnerabilities --output json按严重程度过滤:
bash
deepsource vulnerabilities --severity critical,high --output json限定到某个PR或分支:
bash
deepsource vulnerabilities --pr 42 --output json
deepsource vulnerabilities --default-branch --output jsonCheck analysis status
检查分析状态
bash
deepsource repo status --output json
deepsource runs --output json
deepsource runs --commit abc123 --output jsonrepo statusrunsbash
deepsource repo status --output json
deepsource runs --output json
deepsource runs --commit abc123 --output jsonrepo statusrunsKey patterns
核心使用规则
- Auto-detection: Inside a git repo the CLI auto-detects the repo and current branch. Use when outside the repo or targeting a different one. Use scope flags (
--repo,--pr,--commit) to override the auto-detected branch.--default-branch - Always use for machine-readable output.
--output json - Repo format: — providers:
--repo provider/owner/name,gh,gl,bb.ads - Scope flags are mutually exclusive: ,
--commit, and--prcannot be combined. Omit all three to use auto-detection.--default-branch
- 自动检测: 在git仓库内部时,CLI会自动检测对应仓库和当前分支。当你处于仓库外部或需要指定其他仓库时,使用参数。使用范围参数(
--repo、--pr、--commit)可以覆盖自动检测到的分支。--default-branch - 始终使用 参数来获取机器可读的输出格式。
--output json - 仓库格式: — 平台取值:
--repo provider/owner/name、gh、gl、bb。ads - 范围参数互斥: 、
--commit和--pr不可同时使用。三个参数都省略时将启用自动检测。--default-branch
Documentation
文档
Full CLI docs: https://deepsource.com/docs/developers/cli/installation
Run for detailed flag reference.
deepsource <command> --help运行 可查看详细的参数参考。
deepsource <command> --help