|
| 1 | +*coderabbit.txt* Neovim plugin for CodeRabbit AI code reviews |
| 2 | + |
| 3 | +============================================================================== |
| 4 | +CONTENTS *coderabbit-contents* |
| 5 | + |
| 6 | + 1. Introduction ............................ |coderabbit-introduction| |
| 7 | + 2. Setup ................................... |coderabbit-setup| |
| 8 | + 3. Configuration ........................... |coderabbit-configuration| |
| 9 | + 4. Commands ................................ |coderabbit-commands| |
| 10 | + 5. Lua API ................................. |coderabbit-api| |
| 11 | + |
| 12 | +============================================================================== |
| 13 | +INTRODUCTION *coderabbit-introduction* |
| 14 | + |
| 15 | +Run CodeRabbit AI code reviews from Neovim. Findings appear as native |
| 16 | +|vim.diagnostic| entries with virtual text, signs, and code actions. |
| 17 | + |
| 18 | +Requirements: |
| 19 | +- Neovim >= 0.10 |
| 20 | +- CodeRabbit CLI (`cr`): https://cli.coderabbit.ai |
| 21 | + |
| 22 | +============================================================================== |
| 23 | +SETUP *coderabbit-setup* |
| 24 | + |
| 25 | +>lua |
| 26 | + require("coderabbit").setup({}) |
| 27 | +< |
| 28 | + |
| 29 | +Run `:checkhealth coderabbit` to verify CLI installation and auth. |
| 30 | + |
| 31 | +============================================================================== |
| 32 | +CONFIGURATION *coderabbit-configuration* |
| 33 | + |
| 34 | +All options are optional. Defaults: >lua |
| 35 | + require("coderabbit").setup({ |
| 36 | + cli = { |
| 37 | + binary = "cr", |
| 38 | + timeout = 0, |
| 39 | + extra_args = {}, |
| 40 | + }, |
| 41 | + review = { |
| 42 | + type = "all", |
| 43 | + base = nil, |
| 44 | + base_commit = nil, |
| 45 | + }, |
| 46 | + diagnostics = { |
| 47 | + enabled = true, |
| 48 | + severity_map = { |
| 49 | + critical = vim.diagnostic.severity.ERROR, |
| 50 | + major = vim.diagnostic.severity.WARN, |
| 51 | + minor = vim.diagnostic.severity.INFO, |
| 52 | + }, |
| 53 | + virtual_text = true, |
| 54 | + signs = true, |
| 55 | + underline = true, |
| 56 | + }, |
| 57 | + on_review_complete = nil, |
| 58 | + }) |
| 59 | +< |
| 60 | + |
| 61 | +cli.binary Path to the CodeRabbit CLI. Default: `"cr"` |
| 62 | +cli.timeout Timeout in ms. `0` = no timeout. |
| 63 | +cli.extra_args Extra arguments for `cr review`. |
| 64 | + |
| 65 | +review.type `"all"`, `"committed"`, or `"uncommitted"`. |
| 66 | +review.base Base branch for comparison. |
| 67 | +review.base_commit Base commit SHA for comparison. |
| 68 | + |
| 69 | +diagnostics.enabled Populate |vim.diagnostic| with findings. |
| 70 | +diagnostics.severity_map Map CodeRabbit severities to |vim.diagnostic.severity|. |
| 71 | +diagnostics.virtual_text Show inline virtual text. |
| 72 | +diagnostics.signs Show sign column indicators. |
| 73 | +diagnostics.underline Underline diagnostic ranges. |
| 74 | + |
| 75 | +on_review_complete Callback receiving the findings table when a review |
| 76 | + finishes. |
| 77 | + |
| 78 | +============================================================================== |
| 79 | +COMMANDS *coderabbit-commands* |
| 80 | + |
| 81 | +:CodeRabbitReview [type] *:CodeRabbitReview* |
| 82 | + Start a review. Optional: `all`, `committed`, `uncommitted`. |
| 83 | + |
| 84 | +:CodeRabbitStop *:CodeRabbitStop* |
| 85 | + Cancel a running review. |
| 86 | + |
| 87 | +:CodeRabbitClear *:CodeRabbitClear* |
| 88 | + Clear all CodeRabbit diagnostics. |
| 89 | + |
| 90 | +:CodeRabbitShow [id] *:CodeRabbitShow* |
| 91 | + Open review results in a vertical split. Pass an `id` from |
| 92 | + `:CodeRabbitHistory` to view a saved review. Press `q` to close. |
| 93 | + |
| 94 | +:CodeRabbitHistory *:CodeRabbitHistory* |
| 95 | + Browse saved reviews via |vim.ui.select|. |
| 96 | + |
| 97 | +============================================================================== |
| 98 | +LUA API *coderabbit-api* |
| 99 | + |
| 100 | +require("coderabbit").setup({opts}) *coderabbit.setup()* |
| 101 | + Configure the plugin. |
| 102 | + |
| 103 | +require("coderabbit").review({opts}) *coderabbit.review()* |
| 104 | + Start a review. Accepts `{ type, base, base_commit }`. |
| 105 | + |
| 106 | +require("coderabbit").stop() *coderabbit.stop()* |
| 107 | + Cancel the running review. |
| 108 | + |
| 109 | +require("coderabbit").clear() *coderabbit.clear()* |
| 110 | + Clear diagnostics and reset state. |
| 111 | + |
| 112 | +require("coderabbit").show({id}) *coderabbit.show()* |
| 113 | + Open the review buffer. `nil` = current, number = saved. |
| 114 | + |
| 115 | +require("coderabbit").history() *coderabbit.history()* |
| 116 | + Open the review history picker. |
| 117 | + |
| 118 | +require("coderabbit").status() *coderabbit.status()* |
| 119 | + Returns `"⠋ CodeRabbit (12s)"` while reviewing, `nil` when idle. |
| 120 | + Designed for statusline use. |
| 121 | + |
| 122 | +============================================================================== |
| 123 | +vim:tw=78:ts=8:ft=help:norl: |
0 commit comments