@slahon/lazykit 1.2.8 → 1.3.0
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/README.md +1 -0
- package/init.js +22 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -157,6 +157,7 @@ If your `main` branch has protection rules enabled, Claude's pull requests will
|
|
|
157
157
|
- **Edit CLAUDE.md** to describe your folder structure, naming conventions, and any rules Claude must follow.
|
|
158
158
|
- **Use `@claude` in comments** to give Claude follow-up instructions or corrections without opening a new issue.
|
|
159
159
|
- **Run `lazykit status`** if something stops working — it pinpoints exactly what's misconfigured.
|
|
160
|
+
- **Re-run a failed workflow:** Go to your repo → Actions tab → click the failed run → click **"Re-run failed jobs"**. Or just comment `@claude` on the issue to trigger a fresh run.
|
|
160
161
|
|
|
161
162
|
## License
|
|
162
163
|
|
package/init.js
CHANGED
|
@@ -7,7 +7,7 @@ const chalk = require('chalk');
|
|
|
7
7
|
const ora = require('ora');
|
|
8
8
|
|
|
9
9
|
const { log } = require('./logger');
|
|
10
|
-
const { confirm } = require('./prompt');
|
|
10
|
+
const { ask, confirm } = require('./prompt');
|
|
11
11
|
const { isGitRepo, getGitRemote, parseGitHubRepo, isGhCliAvailable, isGhAuthenticated, detectStack, hasBranchProtection } = require('./git');
|
|
12
12
|
const { generateWorkflow } = require('./workflow');
|
|
13
13
|
const { generateClaudeMd } = require('./claude-md');
|
|
@@ -197,22 +197,32 @@ async function init({ dryRun = false } = {}) {
|
|
|
197
197
|
if (result.stderr) process.stderr.write(result.stderr);
|
|
198
198
|
|
|
199
199
|
const output = (result.stdout || '') + (result.stderr || '');
|
|
200
|
-
|
|
200
|
+
let token = (output.match(/sk-ant-oat[^\s]+/) || [])[0];
|
|
201
|
+
|
|
202
|
+
// Fallback: ask user to paste if auto-capture didn't work
|
|
203
|
+
if (!token) {
|
|
204
|
+
console.log();
|
|
205
|
+
log.warn('Could not capture the token automatically.');
|
|
206
|
+
console.log(chalk.gray(' If a browser opened, complete the auth and copy the token it shows.\n'));
|
|
207
|
+
const pasted = await ask('Paste your token here (or press Enter to skip)', '');
|
|
208
|
+
if (pasted && pasted.trim().startsWith('sk-ant-oat')) {
|
|
209
|
+
token = pasted.trim();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
201
212
|
|
|
202
|
-
if (
|
|
213
|
+
if (token && ghReady) {
|
|
203
214
|
const secretSpinner = ora({ text: 'Adding CLAUDE_CODE_OAUTH_TOKEN to GitHub secrets...', color: 'cyan' }).start();
|
|
204
215
|
execSync(
|
|
205
|
-
`gh secret set CLAUDE_CODE_OAUTH_TOKEN --body "${
|
|
216
|
+
`gh secret set CLAUDE_CODE_OAUTH_TOKEN --body "${token}" --repo ${repoInfo.owner}/${repoInfo.repo}`,
|
|
206
217
|
{ stdio: 'pipe' }
|
|
207
218
|
);
|
|
208
219
|
secretSpinner.succeed(chalk.green('CLAUDE_CODE_OAUTH_TOKEN added to GitHub secrets'));
|
|
209
|
-
} else if (
|
|
210
|
-
log.warn('
|
|
211
|
-
console.log(chalk.gray('
|
|
212
|
-
console.log(chalk.gray('
|
|
213
|
-
console.log(chalk.cyan(` https://github.com/${repoInfo.owner}/${repoInfo.repo}/settings/secrets/actions`));
|
|
220
|
+
} else if (token && !ghReady) {
|
|
221
|
+
log.warn('gh CLI not available — add the secret manually:');
|
|
222
|
+
console.log(chalk.gray(' Go to: ') + chalk.cyan(`https://github.com/${repoInfo.owner}/${repoInfo.repo}/settings/secrets/actions`));
|
|
223
|
+
console.log(chalk.gray(' Add secret: ') + chalk.cyan('CLAUDE_CODE_OAUTH_TOKEN') + chalk.gray(' = ') + chalk.cyan(token));
|
|
214
224
|
} else {
|
|
215
|
-
throw new Error('
|
|
225
|
+
throw new Error('No token');
|
|
216
226
|
}
|
|
217
227
|
} catch (err) {
|
|
218
228
|
const isNotFound = (err.message || '').includes('ENOENT');
|
|
@@ -220,10 +230,9 @@ async function init({ dryRun = false } = {}) {
|
|
|
220
230
|
log.warn('Claude Code CLI not found — install it first:');
|
|
221
231
|
console.log(chalk.cyan('\n npm install -g @anthropic-ai/claude-code'));
|
|
222
232
|
} else {
|
|
223
|
-
log.warn('
|
|
233
|
+
log.warn('Token not set — add it manually:');
|
|
224
234
|
}
|
|
225
|
-
console.log(chalk.gray('\n
|
|
226
|
-
console.log(chalk.gray(' 1. Run: ') + chalk.cyan('claude setup-token'));
|
|
235
|
+
console.log(chalk.gray('\n 1. Run: ') + chalk.cyan('claude setup-token'));
|
|
227
236
|
console.log(chalk.gray(' 2. Go to: ') + chalk.cyan(`https://github.com/${repoInfo.owner}/${repoInfo.repo}/settings/secrets/actions`));
|
|
228
237
|
console.log(chalk.gray(' 3. Add secret: ') + chalk.cyan('CLAUDE_CODE_OAUTH_TOKEN') + chalk.gray(' = the token you copied\n'));
|
|
229
238
|
}
|