claude-intern 1.2.1 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.sample +27 -5
- package/README.md +78 -1
- package/dist/index.js +241 -216
- package/package.json +2 -2
package/.env.sample
CHANGED
|
@@ -30,13 +30,35 @@ CLAUDE_CLI_PATH=claude
|
|
|
30
30
|
# VERBOSE=true
|
|
31
31
|
|
|
32
32
|
# Optional: Pull Request Integration
|
|
33
|
-
#
|
|
34
|
-
#
|
|
33
|
+
#
|
|
34
|
+
# Option 1: GitHub Personal Access Token (for individual users)
|
|
35
|
+
# Create at: https://github.com/settings/tokens
|
|
36
|
+
# Required permissions:
|
|
37
|
+
# - Classic token: 'repo' scope (or 'public_repo' for public repos only)
|
|
38
|
+
# - Fine-grained token (recommended): 'Pull requests: Read and write' + 'Contents: Read'
|
|
35
39
|
# GITHUB_TOKEN=your-github-token-here
|
|
40
|
+
#
|
|
41
|
+
# Option 2: GitHub App Authentication (for organizations)
|
|
42
|
+
# Each organization creates their own GitHub App for centralized control.
|
|
43
|
+
# Create at: https://github.com/settings/apps (or your org's settings)
|
|
44
|
+
# Required App permissions:
|
|
45
|
+
# - Repository permissions:
|
|
46
|
+
# - Contents: Read (to check branches)
|
|
47
|
+
# - Pull requests: Read and write (to create PRs)
|
|
48
|
+
# After creating the App, generate a private key and install the App on your repositories.
|
|
49
|
+
#
|
|
50
|
+
# GITHUB_APP_ID=123456
|
|
51
|
+
# Private key can be provided as a file path:
|
|
52
|
+
# GITHUB_APP_PRIVATE_KEY_PATH=/path/to/your-app.private-key.pem
|
|
53
|
+
# Or as base64-encoded content (useful for CI/CD environments):
|
|
54
|
+
# To encode: base64 -i your-key.pem (macOS) or base64 -w 0 your-key.pem (Linux)
|
|
55
|
+
# GITHUB_APP_PRIVATE_KEY_BASE64=LS0tLS1CRUdJTi4uLg==
|
|
56
|
+
#
|
|
57
|
+
# Note: If both GITHUB_TOKEN and GitHub App credentials are set, GITHUB_TOKEN takes precedence.
|
|
36
58
|
|
|
37
|
-
# Bitbucket app password for creating pull requests
|
|
38
|
-
# Create
|
|
39
|
-
#
|
|
59
|
+
# Bitbucket app password for creating pull requests
|
|
60
|
+
# Create at: https://bitbucket.org/account/settings/app-passwords/
|
|
61
|
+
# Required permissions: 'Repositories: Write'
|
|
40
62
|
# BITBUCKET_TOKEN=your-bitbucket-app-password-here
|
|
41
63
|
|
|
42
64
|
# Note: Bitbucket workspace is automatically detected from your git remote URL
|
package/README.md
CHANGED
|
@@ -96,9 +96,23 @@ Update your `.env` file with your JIRA details:
|
|
|
96
96
|
- `JIRA_EMAIL`: Your JIRA email address
|
|
97
97
|
- `JIRA_API_TOKEN`: Your JIRA API token (create one at https://id.atlassian.com/manage-profile/security/api-tokens)
|
|
98
98
|
|
|
99
|
-
Optional PR integration:
|
|
99
|
+
Optional PR integration (choose one):
|
|
100
|
+
|
|
101
|
+
**Option 1: GitHub Personal Access Token** (for individual users)
|
|
100
102
|
- `GITHUB_TOKEN`: GitHub personal access token for creating pull requests
|
|
103
|
+
- **Classic token**: Requires `repo` scope
|
|
104
|
+
- **Fine-grained token** (recommended): Requires `Pull requests: Read and write` and `Contents: Read` permissions
|
|
105
|
+
- Create at: https://github.com/settings/tokens
|
|
106
|
+
|
|
107
|
+
**Option 2: GitHub App Authentication** (for organizations)
|
|
108
|
+
- `GITHUB_APP_ID`: Your GitHub App's ID
|
|
109
|
+
- `GITHUB_APP_PRIVATE_KEY_PATH`: Path to your App's private key file
|
|
110
|
+
- See [GitHub App Setup](#github-app-setup) section below for detailed instructions
|
|
111
|
+
|
|
112
|
+
**Bitbucket:**
|
|
101
113
|
- `BITBUCKET_TOKEN`: Bitbucket app password for creating pull requests
|
|
114
|
+
- Requires `Repositories: Write` permission
|
|
115
|
+
- Create at: https://bitbucket.org/account/settings/app-passwords/
|
|
102
116
|
|
|
103
117
|
The `.env.sample` file includes helpful comments and optional configuration options.
|
|
104
118
|
|
|
@@ -128,6 +142,63 @@ The `.claude-intern/settings.json` file allows you to configure project-specific
|
|
|
128
142
|
|
|
129
143
|
**Example:** If you work with multiple JIRA projects that have different workflows (e.g., "PROJ" uses "In Review" but "ABC" uses "Code Review"), configure each project's status in `settings.json`.
|
|
130
144
|
|
|
145
|
+
### GitHub App Setup
|
|
146
|
+
|
|
147
|
+
For organizations that want centralized control over PR creation, you can configure a GitHub App instead of using individual personal access tokens.
|
|
148
|
+
|
|
149
|
+
**Benefits of GitHub App authentication:**
|
|
150
|
+
- No individual tokens needed - the App authenticates itself
|
|
151
|
+
- Fine-grained permissions - only pull request and content read access
|
|
152
|
+
- Centralized control - organization admins manage the App installation
|
|
153
|
+
- Audit trail - all actions show as coming from the App, not individual users
|
|
154
|
+
|
|
155
|
+
**Setup Steps:**
|
|
156
|
+
|
|
157
|
+
1. **Create a GitHub App:**
|
|
158
|
+
- Go to your organization's Settings → Developer settings → GitHub Apps → New GitHub App
|
|
159
|
+
- Or for personal account: https://github.com/settings/apps
|
|
160
|
+
- Fill in the required fields:
|
|
161
|
+
- **App name:** e.g., "Claude Intern Bot" (must be unique across GitHub)
|
|
162
|
+
- **Homepage URL:** Your project URL or a placeholder
|
|
163
|
+
- **Webhook:** Uncheck "Active" (not needed)
|
|
164
|
+
- Set **Repository permissions:**
|
|
165
|
+
- **Contents:** Read (to check branches)
|
|
166
|
+
- **Pull requests:** Read and write (to create PRs)
|
|
167
|
+
- Click "Create GitHub App"
|
|
168
|
+
|
|
169
|
+
2. **Generate a Private Key:**
|
|
170
|
+
- On your App's settings page, scroll to "Private keys"
|
|
171
|
+
- Click "Generate a private key"
|
|
172
|
+
- Save the downloaded `.pem` file securely
|
|
173
|
+
|
|
174
|
+
3. **Install the App:**
|
|
175
|
+
- Go to your App's page → "Install App"
|
|
176
|
+
- Select the organization/account and repositories where you want to use it
|
|
177
|
+
|
|
178
|
+
4. **Configure claude-intern:**
|
|
179
|
+
Add to your `.claude-intern/.env`:
|
|
180
|
+
```bash
|
|
181
|
+
GITHUB_APP_ID=123456 # Your App's ID (shown on the App's settings page)
|
|
182
|
+
GITHUB_APP_PRIVATE_KEY_PATH=/secure/path/to/your-app.private-key.pem
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Or for CI/CD environments, use base64-encoded key:
|
|
186
|
+
```bash
|
|
187
|
+
GITHUB_APP_ID=123456
|
|
188
|
+
GITHUB_APP_PRIVATE_KEY_BASE64=LS0tLS1CRUdJTi4uLg==
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
To encode your key:
|
|
192
|
+
```bash
|
|
193
|
+
# macOS
|
|
194
|
+
base64 -i your-app.private-key.pem
|
|
195
|
+
|
|
196
|
+
# Linux
|
|
197
|
+
base64 -w 0 your-app.private-key.pem
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
**Note:** If both `GITHUB_TOKEN` and GitHub App credentials are configured, `GITHUB_TOKEN` takes precedence.
|
|
201
|
+
|
|
131
202
|
## Usage
|
|
132
203
|
|
|
133
204
|
### Single Task Processing
|
|
@@ -169,6 +240,12 @@ claude-intern TASK-123 --create-pr
|
|
|
169
240
|
# Create pull request targeting specific branch
|
|
170
241
|
claude-intern TASK-123 --create-pr --pr-target-branch develop
|
|
171
242
|
|
|
243
|
+
# Auto-detect target branch from JIRA task description
|
|
244
|
+
# Simply add "Target branch: <branch-name>" to your task description
|
|
245
|
+
# Patterns supported: "Target branch:", "Base branch:", "PR target:"
|
|
246
|
+
claude-intern TASK-123 --create-pr
|
|
247
|
+
# (will use branch specified in task description, or fall back to --pr-target-branch)
|
|
248
|
+
|
|
172
249
|
# Testing options - skip ALL JIRA comments (feasibility + implementation)
|
|
173
250
|
claude-intern TASK-123 --skip-jira-comments
|
|
174
251
|
|