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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

223 changes: 123 additions & 100 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@
cargo install cora-cli
```

### Homebrew

```bash
brew tap ajianaz/tap
brew install cora-cli
```

### Binary Download

Download the latest release from [GitHub Releases](https://github.com/ajianaz/cora-cli/releases):
Expand Down Expand Up @@ -84,19 +77,13 @@ export ANTHROPIC_API_KEY="sk-ant-..."
cora review
```

### 3. Review a Specific File

```bash
cora review src/main.rs
```

### 4. Review the Last Commit
### 3. Review a Specific Commit

```bash
cora review --commit HEAD
```

### 5. Scan the Entire Project
### 4. Scan the Entire Project

```bash
cora scan .
Expand All @@ -109,32 +96,48 @@ cora scan .
Review code changes using an LLM.

```bash
# Review staged files
# Review staged files (default)
cora review

# Review specific files
cora review src/main.rs src/lib.rs
# Review staged explicitly
cora review --staged

# Review unstaged changes
cora review --unstaged

# Review unpushed commits
cora review --unpushed

# Review a range of commits
# Review against a branch
cora review --base develop

# Review a commit or range
cora review --commit HEAD
cora review --commit HEAD~3..HEAD

# Review a pull request diff
# Review from a diff file
cora review --diff-file pr.diff

# Use a specific model
cora review --model gpt-4o

# Output as SARIF (for CI)
cora review --output sarif --output-file results.sarif
# Filter by severity
cora review --severity major

# Output as JSON
cora review --output json
# Quiet mode (minimal output)
cora review --quiet

# Set severity threshold
cora review --severity warning
# Stream response
cora review --stream

# Quiet mode (machine-readable)
cora review --quiet
# Output as SARIF
cora review --format sarif

# Review and upload SARIF to GitHub Code Scanning
cora review --base develop --upload

# Output as JSON
cora review --format json
```

### `cora scan`
Expand All @@ -145,14 +148,14 @@ Scan files for code quality issues without requiring git context.
# Scan current directory
cora scan .

# Scan specific files
cora scan src/**/*.rs

# Scan with custom rules focus
# Scan with focus areas
cora scan . --focus security,performance

Comment on lines +151 to 153

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Scan examples use a positional path that doesn’t match the CLI contract.

These examples use cora scan . ..., but path is exposed as a long flag (--path). Docs should use cora scan --path . ... (or omit path and rely on default current directory).

Also applies to: 157-158

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 151 - 153, The README examples use a positional path
(e.g., "cora scan . --focus security,performance") which doesn't match the CLI
contract; update those examples to either omit the path (rely on default current
directory) or use the long flag ("--path .") so they match the CLI; search for
occurrences of "cora scan . --focus" (and the other example similar at lines
nearby) and replace with either "cora scan --path . --focus
security,performance" or "cora scan --focus security,performance".

# Exclude patterns
cora scan . --exclude "tests/**" --exclude "examples/**"
cora scan . --exclude "tests/**" --exclude "vendor/**"

# Incremental (only changed files)
cora scan . --incremental
```

### `cora config`
Expand All @@ -163,78 +166,112 @@ Manage configuration.
# Show current configuration
cora config show

# Initialize config file
cora config init
# Set model
cora config set model gpt-4o

# Set provider
cora config set provider anthropic
```

### `cora init`

Create a `.cora.yaml` config file in your project.

```bash
cora init
cora init --force
```

### `cora auth`

Manage API key authentication.

```bash
cora auth login
cora auth status
cora auth remove
```

### `cora hook`

Manage git hooks.

```bash
cora hook install
cora hook uninstall
```

### `cora providers`

List detected AI providers.

# Set a configuration value
cora config set model claude-sonnet-4-20250514
cora config set severity error
```bash
cora providers
```

### `cora upload-sarif`

Upload a SARIF file to GitHub Code Scanning.

```bash
cora upload-sarif results.sarif
```

### `cora completion`

Generate shell completions.

```bash
cora completion bash > ~/.cora-completion.bash
cora completion zsh > ~/.cora-completion.zsh
cora completion fish > ~/.cora-completion.fish
cora completion bash
cora completion zsh
cora completion fish
```

## ⚙️ Configuration

Create a `.cora.yaml` in your project root or `~/.config/cora/config.yaml` globally:
Create a `.cora.yaml` in your project root. API keys are stored at `~/.cora/config.toml`.

```yaml
# .cora.yaml
model: gpt-4o
temperature: 0.1

# Provider configuration
provider:
name: openai # openai | anthropic | google | custom
base_url: null # Override API endpoint (for custom/self-hosted)
api_key_env: OPENAI_API_KEY # Environment variable for API key

# Review settings
review:
severity: warning # error | warning | info | note
focus: # Focus areas (empty = all)
- security
- performance
- maintainability
ignore:
patterns:
- "tests/**"
- "vendor/**"
- "*.generated.*"
rules:
- "line-too-long"
max_tokens: 4096
language: en # Response language

# Output settings
output:
format: colored # colored | plain | json | sarif
file: null # Output to file instead of stdout

# Git settings
git:
auto_stage: false # Auto-stage files after review
base_branch: main # Base branch for PR reviews
severity: warning # minimum severity level
max_issues: 20 # max issues to report
focus: security,performance # focus areas
Comment on lines +239 to +241

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use a valid severity enum in the config example.

Line 239 shows severity: warning, but CLI severity values are info | minor | major | critical. This example can mislead users into invalid config values.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 239 - 241, The README example uses an invalid
severity value ("severity: warning"); update the example to use one of the valid
CLI severity enums (info | minor | major | critical) by replacing the severity
line (the "severity" key in the config snippet) with a permitted value such as
"severity: minor" (or "info"/"major"/"critical") so the sample config is
accurate and won't mislead users.


# Patterns to ignore
ignore:
- "vendor/**"
- "*.min.js"
- "migrations/**"

# Provider-specific model overrides
providers:
openai:
model: gpt-4o
anthropic:
model: claude-sonnet-4-20250514
```

### Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `OPENAI_API_KEY` | OpenAI API key | — |
| `ANTHROPIC_API_KEY` | Anthropic API key | — |
| `GOOGLE_API_KEY` | Google AI API key | — |
| `CORa_MODEL` | Override model | — |
| `CORa_PROVIDER` | Override provider | — |
| `CORa_CONFIG` | Path to config file | `.cora.yaml` |
| `CORa_LOG_LEVEL` | Log verbosity | `info` |
| Variable | Description |
|----------|-------------|
| `CORA_API_KEY` | Generic API key |
| `OPENAI_API_KEY` | OpenAI API key |
| `ANTHROPIC_API_KEY` | Anthropic API key |
| `GROQ_API_KEY` | Groq API key |
| `ZAI_API_KEY` | Z.AI API key |
| `CORA_PROVIDER` | Override provider |
| `CORA_MODEL` | Override model |
| `CORA_BASE_URL` | Override API base URL |
| `CORA_CONFIG` | Config file path |
| `CORA_FORMAT` | Output format |
| `CORA_NO_COLOR` | Disable colors |
| `GITHUB_TOKEN` | GitHub token for SARIF upload |
| `GITHUB_REPOSITORY` | GitHub repo for SARIF upload |
| `GITHUB_REF` | GitHub ref for SARIF upload |

## 🔗 CI/CD Integration

Expand Down Expand Up @@ -263,9 +300,7 @@ jobs:
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
cora review --commit origin/main..HEAD \
--output sarif \
--output-file results.sarif
cora review --base origin/develop --format sarif --output-file results.sarif

- name: Upload SARIF to GitHub Code Scanning
if: always()
Expand All @@ -284,7 +319,7 @@ code-review:
before_script:
- cargo install cora-cli
script:
- cora review --commit origin/main..HEAD --severity error
- cora review --base origin/develop --severity critical
variables:
OPENAI_API_KEY: $CI_OPENAI_API_KEY
rules:
Expand All @@ -311,26 +346,14 @@ Or add it manually to `.git/hooks/pre-commit`:
```bash
#!/bin/sh
# cora-cli pre-commit hook
cora review --quiet --severity error
cora review --quiet --severity critical
if [ $? -ne 0 ]; then
echo "❌ Code review found critical issues. Commit blocked."
echo " Run 'cora review' to see details, or use 'git commit --no-verify' to skip."
exit 1
fi
```

### With [pre-commit](https://pre-commit.com) framework

```yaml
# .pre-commit-config.yaml
repos:
- repo: https://github.com/ajianaz/cora-cli
rev: v0.1.0
hooks:
- id: cora-review
args: ['--severity', 'warning']
```

## 🆚 Positioning: How Cora Compares

| Feature | **cora-cli** | AI Agent IDE Tools | Standard Linters |
Expand Down
Loading
Loading