Skip to content

Commit 4ccaa93

Browse files
authored
Merge pull request #96 from DGouron/feat/29-interactive-setup-wizard
docs: update documentation for reviewflow init wizard
2 parents 395b4a2 + 425e4e1 commit 4ccaa93

File tree

9 files changed

+761
-191
lines changed

9 files changed

+761
-191
lines changed

docs/guide/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Guide
44

55
# Guide
66

7-
Everything you need to get started with Claude Review Automation and configure it for your projects.
7+
Everything you need to get started with Reviewflow and configure it for your projects.
88

99
## Suggested Reading Order
1010

docs/guide/quick-start.md

Lines changed: 58 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Get Reviewflow running in 5 minutes.
1212
- A GitLab or GitHub account with webhook access
1313
- [Claude Code CLI](https://claude.ai/claude-code) installed and authenticated
1414

15-
## 1. Installation
15+
## 1. Install
1616

1717
### As a user (recommended)
1818

@@ -37,120 +37,93 @@ yarn install
3737
yarn build
3838
```
3939

40-
## 2. Configuration
40+
## 2. Initialize
4141

42-
### Environment variables
42+
Run the interactive setup wizard:
4343

4444
```bash
45-
# Create your .env from the bundled template
46-
cp node_modules/reviewflow/templates/.env.example .env 2>/dev/null \
47-
|| cp .env.example .env
48-
49-
# Edit with your webhook secrets
50-
# Generate tokens with: openssl rand -hex 32
51-
nano .env
45+
reviewflow init
5246
```
5347

54-
```bash
55-
# .env
56-
GITLAB_WEBHOOK_TOKEN=your_generated_token_here
57-
GITHUB_WEBHOOK_SECRET=your_generated_token_here
58-
```
48+
The wizard walks you through:
49+
1. Choosing your platform (GitLab, GitHub, or both)
50+
2. Entering your username(s) for @mention filtering
51+
3. Scanning for local repositories to register
52+
4. Generating webhook secrets automatically
5953

60-
### Application config
54+
Your configuration is saved to `~/.claude-review/config.json` and `~/.claude-review/.env`.
6155

62-
```bash
63-
# Create your config from the bundled template
64-
cp node_modules/reviewflow/templates/config.json.template config.json 2>/dev/null \
65-
|| cp config.example.json config.json
56+
::: tip Non-interactive mode
57+
Use `reviewflow init --yes` to accept all defaults. You can also pass `--scan-path /path/to/projects` to target specific directories.
58+
:::
6659

67-
# Edit with your settings
68-
nano config.json
69-
```
60+
::: tip Add repositories later
61+
Use `reviewflow discover` to scan for and add new repositories to your existing configuration.
62+
:::
7063

71-
```json
72-
{
73-
"server": { "port": 3000 },
74-
"user": {
75-
"gitlabUsername": "YOUR_GITLAB_USERNAME",
76-
"githubUsername": "YOUR_GITHUB_USERNAME"
77-
},
78-
"repositories": [
79-
{
80-
"platform": "gitlab",
81-
"remoteUrl": "https://gitlab.com/your-org/your-project",
82-
"localPath": "/path/to/your/local/clone",
83-
"skill": "review-code",
84-
"enabled": true
85-
}
86-
]
87-
}
88-
```
64+
## 3. Configure webhook
8965

90-
## 3. Start the server
66+
### GitLab
9167

92-
### Global install
68+
1. Go to your project → **Settings** → **Webhooks**
69+
2. Add webhook:
70+
- **URL**: `https://YOUR_TUNNEL_URL/webhooks/gitlab`
71+
- **Secret token**: (shown during `reviewflow init`, or run `reviewflow init --show-secrets` to view)
72+
- **Trigger**: ☑ Merge request events
73+
3. Click **Add webhook**
9374

94-
```bash
95-
reviewflow start
96-
```
75+
### GitHub
76+
77+
1. Go to your repo → **Settings** → **Webhooks**
78+
2. Add webhook:
79+
- **Payload URL**: `https://YOUR_TUNNEL_URL/webhooks/github`
80+
- **Content type**: `application/json`
81+
- **Secret**: (shown during `reviewflow init`, or run `reviewflow init --show-secrets` to view)
82+
- **Events**: ☑ Pull requests
83+
3. Click **Add webhook**
9784

98-
### Contributor mode
85+
::: info Expose for webhooks
86+
GitLab/GitHub need to reach your server. Use a tunnel:
9987

10088
```bash
101-
# Development mode (with hot reload)
102-
yarn dev
89+
# Cloudflare Tunnel (recommended)
90+
cloudflared tunnel --url http://localhost:3847
10391

104-
# Or production mode
105-
yarn start
92+
# Or ngrok
93+
ngrok http 3847
10694
```
95+
:::
10796

108-
The server runs at `http://localhost:3000` (or your configured port).
109-
110-
## 4. Expose for webhooks
111-
112-
GitLab/GitHub need to reach your server. Options:
113-
114-
### Option A: Cloudflare Tunnel (recommended)
97+
## 4. Start & verify
11598

11699
```bash
117-
cloudflared tunnel --url http://localhost:3000
118-
```
119-
120-
Copy the generated URL (e.g., `https://xxx-xxx.trycloudflare.com`).
100+
# Start the server
101+
reviewflow start
121102

122-
### Option B: ngrok
103+
# Or as a background daemon
104+
reviewflow start --daemon
123105

124-
```bash
125-
ngrok http 3000
106+
# Open the dashboard automatically
107+
reviewflow start --open
126108
```
127109

128-
## 5. Configure webhook
110+
The server runs at `http://localhost:3847` (or your configured port).
129111

130-
### GitLab
112+
### Verify your setup
131113

132-
1. Go to your project → **Settings****Webhooks**
133-
2. Add webhook:
134-
- **URL**: `https://YOUR_TUNNEL_URL/webhooks/gitlab`
135-
- **Secret token**: (same as `GITLAB_WEBHOOK_TOKEN` in your `.env`)
136-
- **Trigger**: ☑ Merge request events
137-
3. Click **Add webhook**
138-
139-
### GitHub
114+
```bash
115+
# Check configuration is valid
116+
reviewflow validate
140117

141-
1. Go to your repo → **Settings****Webhooks**
142-
2. Add webhook:
143-
- **Payload URL**: `https://YOUR_TUNNEL_URL/webhooks/github`
144-
- **Content type**: `application/json`
145-
- **Secret**: (same as `GITHUB_WEBHOOK_SECRET` in your `.env`)
146-
- **Events**: ☑ Pull requests
147-
3. Click **Add webhook**
118+
# Check server status
119+
reviewflow status
120+
```
148121

149-
## 6. Test it!
122+
## 5. Test it!
150123

151124
1. Create or open a Merge Request / Pull Request
152125
2. Assign yourself as **Reviewer**
153-
3. Open `http://localhost:3000/dashboard/`
126+
3. Open `http://localhost:3847/dashboard/`
154127
4. Watch the review appear!
155128

156129
## Next steps
@@ -161,4 +134,4 @@ ngrok http 3000
161134

162135
## Troubleshooting
163136

164-
See [Troubleshooting](./troubleshooting.md) for common issues (webhooks, reviews, Claude Code).
137+
See [Troubleshooting](./troubleshooting.md) for common issues and CLI diagnostics.

docs/guide/troubleshooting.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ title: Troubleshooting
66

77
Common issues and solutions for Reviewflow.
88

9+
## CLI Diagnostics
10+
11+
Before diving into specific issues, use these built-in commands:
12+
13+
| Command | What it checks |
14+
|---------|---------------|
15+
| `reviewflow validate` | Config and `.env` correctness |
16+
| `reviewflow status` | Server running state, PID, port |
17+
| `reviewflow logs -f` | Live server logs (follow mode) |
18+
| `reviewflow logs -n 50` | Last 50 log lines |
19+
20+
```bash
21+
# Quick health check
22+
reviewflow validate && reviewflow status
23+
```
24+
925
## Webhooks
1026

1127
### Webhook returns 401

docs/reference/config.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The system uses two configuration files:
1212

1313
| File | Location | Purpose |
1414
|------|----------|---------|
15-
| `config.json` | Server root | Server configuration, repositories |
15+
| `config.json` | `~/.claude-review/` (created by `reviewflow init`) | Server configuration, repositories |
1616
| `.claude/reviews/config.json` | Each project | Project-specific review settings |
1717

1818
---
@@ -21,14 +21,14 @@ The system uses two configuration files:
2121

2222
### Location
2323

24-
`config.json` in the server's root directory (or `config.example.json` as template).
24+
`~/.claude-review/config.json`, created automatically by `reviewflow init`.
2525

2626
### Schema
2727

2828
```json
2929
{
3030
"server": {
31-
"port": 3000
31+
"port": 3847
3232
},
3333
"user": {
3434
"gitlabUsername": "your-gitlab-username",
@@ -57,7 +57,7 @@ The system uses two configuration files:
5757

5858
| Field | Type | Default | Description |
5959
|-------|------|---------|-------------|
60-
| `port` | number | `3000` | HTTP server port |
60+
| `port` | number | `3847` | HTTP server port |
6161

6262
#### `user`
6363

@@ -169,7 +169,7 @@ The automation server creates these files in `.claude/reviews/`:
169169

170170
## Validation
171171

172-
Configuration files are validated at startup. Common errors: missing required fields, invalid model name (use `"sonnet"` or `"opus"`), nonexistent `localPath`, or missing skill file in `.claude/skills/`.
172+
Configuration files are validated at startup. Run `reviewflow validate` to check your configuration without starting the server. Common errors: missing required fields, invalid model name (use `"sonnet"` or `"opus"`), nonexistent `localPath`, or missing skill file in `.claude/skills/`.
173173

174174
---
175175

0 commit comments

Comments
 (0)