threadlines 0.1.24 → 0.1.25

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.
@@ -52,30 +52,39 @@ const chalk_1 = __importDefault(require("chalk"));
52
52
  async function checkCommand(options) {
53
53
  const repoRoot = process.cwd();
54
54
  console.log(chalk_1.default.blue('🔍 Threadline: Checking code against your threadlines...\n'));
55
- // Get and validate API key
55
+ // Pre-flight check: Validate ALL required environment variables at once
56
56
  const apiKey = (0, config_1.getThreadlineApiKey)();
57
- if (!apiKey) {
58
- console.error(chalk_1.default.red('❌ Error: THREADLINE_API_KEY is required'));
57
+ const account = (0, config_1.getThreadlineAccount)();
58
+ const missingVars = [];
59
+ if (!apiKey)
60
+ missingVars.push('THREADLINE_API_KEY');
61
+ if (!account)
62
+ missingVars.push('THREADLINE_ACCOUNT');
63
+ if (missingVars.length > 0) {
64
+ console.error(chalk_1.default.red('❌ Error: Missing required environment variables:'));
65
+ for (const varName of missingVars) {
66
+ console.error(chalk_1.default.red(` • ${varName}`));
67
+ }
59
68
  console.log('');
60
69
  console.log(chalk_1.default.yellow('To fix this:'));
61
- console.log(chalk_1.default.white(' 1. Create a .env.local file in your project root'));
62
- console.log(chalk_1.default.gray(' 2. Add: THREADLINE_API_KEY=your-api-key-here'));
63
- console.log(chalk_1.default.gray(' 3. Make sure .env.local is in your .gitignore'));
64
70
  console.log('');
65
- console.log(chalk_1.default.gray('For CI/CD: Set THREADLINE_API_KEY as an environment variable in your platform settings.'));
66
- process.exit(1);
67
- }
68
- // Get and validate account key
69
- const account = (0, config_1.getThreadlineAccount)();
70
- if (!account) {
71
- console.error(chalk_1.default.red('❌ Error: THREADLINE_ACCOUNT is required'));
71
+ console.log(chalk_1.default.white(' Local development:'));
72
+ console.log(chalk_1.default.gray(' 1. Create a .env.local file in your project root'));
73
+ console.log(chalk_1.default.gray(' 2. Add the missing variable(s):'));
74
+ if (missingVars.includes('THREADLINE_API_KEY')) {
75
+ console.log(chalk_1.default.gray(' THREADLINE_API_KEY=your-api-key-here'));
76
+ }
77
+ if (missingVars.includes('THREADLINE_ACCOUNT')) {
78
+ console.log(chalk_1.default.gray(' THREADLINE_ACCOUNT=your-email@example.com'));
79
+ }
80
+ console.log(chalk_1.default.gray(' 3. Make sure .env.local is in your .gitignore'));
72
81
  console.log('');
73
- console.log(chalk_1.default.yellow('To fix this:'));
74
- console.log(chalk_1.default.white(' 1. Create a .env.local file in your project root'));
75
- console.log(chalk_1.default.gray(' 2. Add: THREADLINE_ACCOUNT=your-email@example.com'));
76
- console.log(chalk_1.default.gray(' 3. Make sure .env.local is in your .gitignore'));
82
+ console.log(chalk_1.default.white(' CI/CD:'));
83
+ console.log(chalk_1.default.gray(' GitHub Actions: Settings Secrets Add variables'));
84
+ console.log(chalk_1.default.gray(' GitLab CI: Settings → CI/CD → Variables'));
85
+ console.log(chalk_1.default.gray(' Vercel: Settings Environment Variables'));
77
86
  console.log('');
78
- console.log(chalk_1.default.gray('For CI/CD: Set THREADLINE_ACCOUNT as an environment variable in your platform settings.'));
87
+ console.log(chalk_1.default.gray('Get your credentials at: https://devthreadline.com/settings'));
79
88
  process.exit(1);
80
89
  }
81
90
  try {
@@ -216,8 +225,8 @@ async function checkCommand(options) {
216
225
  threadlines: threadlinesWithContext,
217
226
  diff: gitDiff.diff,
218
227
  files: gitDiff.changedFiles,
219
- apiKey,
220
- account,
228
+ apiKey: apiKey,
229
+ account: account,
221
230
  repoName: repoName,
222
231
  branchName: branchName,
223
232
  commitSha: metadata.commitSha,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "threadlines",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "description": "Threadline CLI - AI-powered linter based on your natural language documentation",
5
5
  "main": "dist/index.js",
6
6
  "bin": {