{"id":25040258,"url":"https://github.com/hustcer/deepseek-review","last_synced_at":"2026-01-23T14:09:59.078Z","repository":{"id":274764190,"uuid":"923990653","full_name":"hustcer/deepseek-review","owner":"hustcer","description":"🚀 Sharpen Your Code, Ship with Confidence – Elevate Your Workflow with DeepSeek Code Review 🚀","archived":false,"fork":false,"pushed_at":"2026-01-20T15:01:27.000Z","size":288,"stargazers_count":354,"open_issues_count":10,"forks_count":32,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-01-20T23:14:27.471Z","etag":null,"topics":["cli","codereview","deepseek"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/deepseek-cr","language":"Nushell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hustcer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-29T07:58:48.000Z","updated_at":"2026-01-18T14:01:46.000Z","dependencies_parsed_at":"2025-02-28T12:20:14.271Z","dependency_job_id":"3f8ee164-2a23-4c92-be83-a3bd6d7ee08e","html_url":"https://github.com/hustcer/deepseek-review","commit_stats":null,"previous_names":["hustcer/deepseek-review"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/hustcer/deepseek-review","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcer%2Fdeepseek-review","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcer%2Fdeepseek-review/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcer%2Fdeepseek-review/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcer%2Fdeepseek-review/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hustcer","download_url":"https://codeload.github.com/hustcer/deepseek-review/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcer%2Fdeepseek-review/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28693630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T11:01:27.039Z","status":"ssl_error","status_checked_at":"2026-01-23T11:00:26.909Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","codereview","deepseek"],"created_at":"2025-02-06T03:00:55.248Z","updated_at":"2026-01-23T14:09:59.066Z","avatar_url":"https://github.com/hustcer.png","language":"Nushell","funding_links":[],"categories":["Integrations"],"sub_categories":[],"readme":"# DeepSeek Code Review\n\n![Tests](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgist.githubusercontent.com%2Fhustcer%2Fb99391ee59016b17d0befe3331387e89%2Fraw%2Ftest-summary.json\u0026query=%24.total\u0026label=Tests)\n![Passed](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgist.githubusercontent.com%2Fhustcer%2Fb99391ee59016b17d0befe3331387e89%2Fraw%2Ftest-summary.json\u0026query=%24.passed\u0026label=Passed\u0026color=%2331c654)\n![Failed](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgist.githubusercontent.com%2Fhustcer%2Fb99391ee59016b17d0befe3331387e89%2Fraw%2Ftest-summary.json\u0026query=%24.failed\u0026label=Failed\u0026color=red)\n![Skipped](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgist.githubusercontent.com%2Fhustcer%2Fb99391ee59016b17d0befe3331387e89%2Fraw%2Ftest-summary.json\u0026query=%24.skipped\u0026label=Skipped\u0026color=yellow)\n\n[中文说明](README.zh-CN.md)\n\n`deepseek-review` offers seamless integration with DeepSeek models on SiliconCloud. [Sign Up Now](https://cloud.siliconflow.cn/i/rqCdIxzS) to **claim your free 20 million tokens** and start exploring its capabilities!\n\n## Features\n\n### GitHub Action\n\n- Automate PR Reviews with DeepSeek via GitHub Action\n- Add `skip cr` or `skip review` to the PR title or body to disable code review in GitHub Actions\n- Cross-platform Support: Compatible with GitHub Runners across `macOS`, `Ubuntu`, and `Windows`.\n\n### Local Code Review\n\n- Streaming output support for local code review\n- Review remote GitHub PRs directly from your local CLI\n- Review commit changes with DeepSeek for any local repository via CLI\n- Support on-demand change generation via `git show`/`git diff` commands for further code review\n- Output code review results to a specified file in Markdown format\n- Cross-platform compatibility: Designed to function seamlessly across all platforms capable of running [Nushell](https://github.com/nushell/nushell)\n\n### Both GH Action \u0026 Local\n\n- Support both DeepSeek's `V3` and `R1` models\n- Fully customizable: Choose models, base URLs, and prompts\n- Support self-hosted DeepSeek models for enhanced flexibility\n- Perform code reviews for changes that either include or exclude specific files\n\n## Planned Features\n\n- [ ] **Trigger Code Review on Mention**: Automatically initiate code review when the `github-actions` bot is mentioned in a PR comment.\n- [ ] **Generate Commit Message Locally**: Generate a commit message for the code changes in any local repository.\n\n## Code Review with GitHub Action\n\n### Initiate Code Review When a PR is Created\n\nAdd a GitHub workflow with the following contents:\n\n```yaml\nname: Code Review\non:\n  pull_request_target:\n    types:\n      - opened      # Triggers when a PR is opened\n      - reopened    # Triggers when a PR is reopened\n      - synchronize # Triggers when a commit is pushed to the PR\n\n# fix: GraphQL: Resource not accessible by integration (addComment) error\npermissions:\n  pull-requests: write\n\njobs:\n  setup-deepseek-review:\n    runs-on: ubuntu-latest\n    name: Code Review\n    steps:\n      - name: DeepSeek Code Review\n        uses: hustcer/deepseek-review@v1\n        with:\n          chat-token: ${{ secrets.CHAT_TOKEN }}\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eCHAT_TOKEN Config\u003c/summary\u003e\n\n  Follow these steps to config your `CHAT_TOKEN`:\n\n  - Click on the \"Settings\" tab in your repository navigation bar.\n  - In the left sidebar, click on \"Secrets and variables\" under \"Security\".\n  - Click on \"Actions\" -\u003e \"New repository secret\" button.\n  - Enter `CHAT_TOKEN` in the \"Name\" field.\n  - Enter the value of your `CHAT_TOKEN` in the \"Secret\" field.\n  - Finally, click the \"Add secret\" button to save the secret.\n\n\u003c/details\u003e\n\nWhen a PR is created, DeepSeek code review will be automatically triggered, and the review results (depending on your prompt) will be posted as comments on the corresponding PR. For example:\n- [Example 1](https://github.com/hustcer/deepseek-review/pull/30) with [default prompts](https://github.com/hustcer/deepseek-review/blob/main/action.yaml#L35) \u0026 [Run Log](https://github.com/hustcer/deepseek-review/actions/runs/13043609677/job/36390331791#step:2:53).\n- [Example 2](https://github.com/hustcer/deepseek-review/pull/68) with [this prompt](https://github.com/hustcer/deepseek-review/blob/eba892d969049caff00b51a31e5c093aeeb536e3/.github/workflows/cr.yml#L32)\n\n### Trigger Code Review When a Specific Label is Added\n\nIf you don't want automatic code review on PR creation, you can choose to trigger code review by adding a label. For example, create the following workflow:\n\n```yaml\nname: Code Review\non:\n  pull_request_target:\n    types:\n      - labeled     # Triggers when a label is added to the PR\n\n# fix: GraphQL: Resource not accessible by integration (addComment) error\npermissions:\n  pull-requests: write\n\njobs:\n  setup-deepseek-review:\n    runs-on: ubuntu-latest\n    name: Code Review\n    # Make sure the code review happens only when the PR has the label 'ai review'\n    if: contains(github.event.pull_request.labels.*.name, 'ai review')\n    steps:\n      - name: DeepSeek Code Review\n        uses: hustcer/deepseek-review@v1\n        with:\n          chat-token: ${{ secrets.CHAT_TOKEN }}\n```\n\nWith this setup, DeepSeek code review will not run automatically upon PR creation. Instead, it will only be triggered when you manually add the `ai review` label.\n\n## Input Parameters\n\n| Name           | Type   | Description                                                             |\n| -------------- | ------ | ----------------------------------------------------------------------- |\n| chat-token     | String | Required, DeepSeek API Token                                            |\n| model          | String | Optional, The model used for code review, defaults to `deepseek-chat`   |\n| base-url       | String | Optional, DeepSeek API Base URL, defaults to `https://api.deepseek.com` |\n| max-length     | Int    | Optional, Maximum length (Unicode width) of the content for review. If the content length exceeds this value, the review will be skipped. Default `0` means no limit. |\n| sys-prompt     | String | Optional, System prompt corresponding to `$sys_prompt` in the payload, default value see note below |\n| user-prompt    | String | Optional, User prompt corresponding to `$user_prompt` in the payload, default value see note below |\n| temperature    | Number | Optional, The temperature for the model to generate the response, between `0` and `2`. Default value is `0.3` |\n| include-patterns | String | Optional, Comma-separated file patterns to include in the code review. No default |\n| exclude-patterns | String | Optional, Comma-separated file patterns to exclude from the code review. Defaults to `pnpm-lock.yaml,package-lock.json,*.lock` |\n| github-token   | String | Optional, The `GITHUB_TOKEN` secret or personal access token to authenticate. Defaults to `${{ github.token }}`. |\n\n**DeepSeek API Call Payload**:\n\n```js\n{\n  // `$model` default value: deepseek-chat\n  model: $model,\n  stream: false,\n  temperature: $temperature,\n  messages: [\n    // `$sys_prompt` default value: You are a professional code review assistant responsible for\n    // analyzing code changes in GitHub Pull Requests. Identify potential issues such as code\n    // style violations, logical errors, security vulnerabilities, and provide improvement\n    // suggestions. Clearly list the problems and recommendations in a concise manner.\n    { role: 'system', content: $sys_prompt },\n    // `$user_prompt` default value: Please review the following code changes\n    // `diff_content` will be the code changes of current PR\n    { role: 'user', content: $\"($user_prompt):\\n($diff_content)\" }\n  ]\n}\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e You can control the language of the code review results through the language of the\n\u003e prompt. The default prompt language is currently English. When you use a Chinese\n\u003e prompt, the generated code review results will be in Chinese.\n\n## Local Code Review\n\n### Required Tools\n\nTo perform code reviews locally (works on `macOS`, `Ubuntu`, and `Windows`), you need to install the following tools:\n\n- [`Nushell`](https://www.nushell.sh/book/installation.html). It is recommended to install the latest version (minimum version required: `0.110.0`).\n- The latest version of [`awk`](https://github.com/onetrueawk/awk) or [`gawk`](https://www.gnu.org/software/gawk/) is required, with `gawk` being preferred.\n- Clone this repository to your local machine, navigate to the repository directory, and run `nu cr -h`. You should see an output similar to the following:\n\n```console\nUse DeepSeek AI to review code changes locally or in GitHub Actions\n\nUsage:\n  \u003e nu cr {flags} (token)\n\nFlags:\n  -d, --debug: Debug mode\n  -r, --repo \u003cstring\u003e: GitHub repo name, e.g. hustcer/deepseek-review\n  -n, --pr-number \u003cstring\u003e: GitHub PR number\n  -k, --gh-token \u003cstring\u003e: Your GitHub token, fallback to GITHUB_TOKEN env var\n  -f, --diff-from \u003cstring\u003e: Git diff starting commit SHA\n  -t, --diff-to \u003cstring\u003e: Git diff ending commit SHA\n  -c, --patch-cmd \u003cstring\u003e: The `git show` or `git diff` command to get the diff content, for local CR only\n  -l, --max-length \u003cint\u003e: Maximum length of the content for review, 0 means no limit.\n  -m, --model \u003cstring\u003e: Model name, or read from CHAT_MODEL env var, `deepseek-chat` by default\n  -b, --base-url \u003cstring\u003e: DeepSeek API base URL, fallback to BASE_URL env var\n  -U, --chat-url \u003cstring\u003e: DeepSeek Model chat full API URL, e.g. http://localhost:11535/api/chat\n  -s, --sys-prompt \u003cstring\u003e: Default to $DEFAULT_OPTIONS.SYS_PROMPT,\n  -u, --user-prompt \u003cstring\u003e: Default to $DEFAULT_OPTIONS.USER_PROMPT,\n  -i, --include \u003cstring\u003e: Comma separated file patterns to include in the code review\n  -x, --exclude \u003cstring\u003e: Comma separated file patterns to exclude in the code review\n  -T, --temperature \u003cfloat\u003e: Temperature for the model, between `0` and `2`, default value `0.3`\n  -C, --config \u003cstring\u003e: Config file path, default to `config.yml`\n  -o, --output \u003cstring\u003e: Output file path\n  -h, --help: Display the help message for this command\n\nParameters:\n  token \u003cstring\u003e: Your DeepSeek API token, fallback to CHAT_TOKEN env var (optional)\n\n```\n\n### Environment Configuration\n\nTo perform code reviews locally, you need to modify the configuration file. The repository provides a configuration example [`config.example.yml`](https://github.com/hustcer/deepseek-review/blob/main/config.example.yml). Copy it to `config.yml` and modify it according to your needs. **Read the comments in the configuration file carefully**, as they explain the purpose of each configuration item.\n\n\u003e [!WARNING]\n\u003e\n\u003e The `config.yml` configuration file is **only used locally** and will not be utilized in GitHub Workflows. **Sensitive information** in this file should be properly secured and **never committed** to the code repository.\n\u003e\n\n**Create a Command Alias**\n\nFor convenience when performing code reviews across any local repository, create a command alias. For example:\n\n```sh\n# For Nushell: Modify config.nu and add:\nalias cr = nu /absolute/path/to/deepseek-review/cr --config /absolute/path/to/deepseek-review/config.yml\n\n# Modify ~/.zshrc for zsh, ~/.bashrc for bash, or ~/.config/fish/config.fish for fish and add:\nalias cr=\"nu /absolute/path/to/deepseek-review/cr --config /absolute/path/to/deepseek-review/config.yml\"\n\n# After sourcing the modified profile, use `cr` for code reviews\n\n# For Windows PowerShell users, set the cr alias by editing $PROFILE and add:\nfunction cr {\n  nu D:\\absolute\\path\\to\\deepseek-review\\cr --config D:\\absolute\\path\\to\\deepseek-review\\config.yml @args\n}\n\n# Then restart the terminal or run `. $PROFILE` in pwsh to make `cr` work\n```\n\n### Review Local Repository\n\nTo review a local repository:\n\n- Navigate to the Git repository directory.\n- Use the `cr` command to review current modifications, provided that `config.yml` is correctly configured.\n\n**Usage Examples**\n\n```sh\n# Perform code review on the `git diff` changes in the current directory\ncr\n# Perform code review on the `git diff f536acc` changes in the current directory\ncr --diff-from f536acc\n# Perform code review on the `git diff f536acc` changes and output the result to review.md\ncr --diff-from f536acc --output review.md\n# Perform code review on the `git diff f536acc 0dd0eb5` changes in the current directory\ncr --diff-from f536acc --diff-to 0dd0eb5\n# Review the changes in the current directory using the `--patch-cmd` flag\ncr --patch-cmd 'git diff head~3'\ncr -c 'git show head~3'\ncr -c 'git diff 2393375 71f5a31'\ncr -c 'git diff 2393375 71f5a31 nu/*'\ncr -c 'git diff 2393375 71f5a31 :!nu/*'\n# Dangerous commands like `cr -c 'git show head~3; rm ./*'` will not be allowed\n```\n\n### Review Remote GitHub PR Locally\n\nWhen reviewing a remote GitHub PR locally:\n\n- Always specify the PR number via `--pr-number`.\n- Use `--repo` to indicate the target repository (e.g., `hustcer/deepseek-review`). If `--repo` is omitted, the tool reads `settings.default-github-repo` from `config.yml`.\n\n**Usage Examples**\n\n```sh\n# Perform code review on PR #31 in the remote DEFAULT_GITHUB_REPO repository\ncr --pr-number 31\n# Perform code review on PR #31 in the remote hustcer/deepseek-review repository\ncr --pr-number 31 --repo hustcer/deepseek-review\n# Perform code review on PR #31 and exclude changes in pnpm-lock.yaml\ncr --pr-number 31 --exclude pnpm-lock.yaml\n```\n\n## License\n\nLicensed under:\n\n* MIT license ([LICENSE](LICENSE) or http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustcer%2Fdeepseek-review","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhustcer%2Fdeepseek-review","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustcer%2Fdeepseek-review/lists"}