threadlines 0.1.8 → 0.1.9

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 CHANGED
@@ -24,16 +24,43 @@ Getting teams to follow consistent quality standards is **hard**. Really hard.
24
24
 
25
25
  ## Installation
26
26
 
27
+ ### Option 1: Global Installation (Recommended for Regular Use)
28
+
27
29
  ```bash
28
30
  npm install -g threadlines
29
31
  ```
30
32
 
31
- Or use with npx:
33
+ Then use directly:
34
+ ```bash
35
+ threadlines check
36
+ ```
37
+
38
+ ### Option 2: Use with npx (No Installation)
39
+
40
+ ```bash
41
+ npx threadlines check
42
+ ```
43
+
44
+ **For non-interactive environments** (CI/CD, AI assistants like Cursor):
45
+ ```bash
46
+ npx --yes threadlines check
47
+ ```
48
+
49
+ The `--yes` flag auto-confirms package installation, preventing prompts that block automation.
50
+
51
+ ### Option 3: Local Project Dependency (Recommended for Teams)
52
+
53
+ ```bash
54
+ npm install --save-dev threadlines
55
+ ```
32
56
 
57
+ Then use:
33
58
  ```bash
34
59
  npx threadlines check
35
60
  ```
36
61
 
62
+ This ensures everyone on your team uses the same version.
63
+
37
64
  ## Quick Start
38
65
 
39
66
  ### 1. Initialize Your First Threadline
@@ -88,10 +115,50 @@ Creates a template threadline file to get you started. The command will:
88
115
  threadlines check
89
116
  ```
90
117
 
91
- Analyzes your git changes against all threadlines in the `/threadlines` directory.
118
+ By default, analyzes your staged/unstaged git changes against all threadlines in the `/threadlines` directory.
119
+
120
+ **Common Use Cases:**
121
+
122
+ **Check latest commit locally:**
123
+ ```bash
124
+ threadlines check --commit HEAD
125
+ ```
126
+
127
+ **Check a specific commit:**
128
+ ```bash
129
+ threadlines check --commit abc123def
130
+ ```
131
+
132
+ **Check all commits in a branch:**
133
+ ```bash
134
+ threadlines check --branch feature/new-feature
135
+ ```
136
+
137
+ **Check entire file(s):**
138
+ ```bash
139
+ threadlines check --file src/api/users.ts
140
+ threadlines check --files src/api/users.ts src/api/posts.ts
141
+ threadlines check --folder src/api
142
+ ```
143
+
144
+ **Show all results (not just violations):**
145
+ ```bash
146
+ threadlines check --full
147
+ ```
92
148
 
93
149
  **Options:**
94
150
  - `--api-url <url>` - Override the server URL (default: http://localhost:3000)
151
+ - `--commit <ref>` - Review specific commit. Accepts commit SHA or git reference (e.g., `HEAD`, `HEAD~1`, `abc123`)
152
+ - `--branch <name>` - Review all commits in branch vs base
153
+ - `--file <path>` - Review entire file (all lines as additions)
154
+ - `--folder <path>` - Review all files in folder recursively
155
+ - `--files <paths...>` - Review multiple specified files
156
+ - `--full` - Show all results (compliant, attention, not_relevant). Default: only attention items
157
+
158
+ **Auto-detection in CI:**
159
+ - CI with branch detected → reviews all commits in branch vs base
160
+ - CI with commit SHA detected → reviews specific commit
161
+ - Local development → reviews staged/unstaged changes
95
162
 
96
163
  ## Configuration
97
164
 
@@ -105,6 +105,7 @@ async function initCommand() {
105
105
  console.log(chalk_1.default.white(' Make sure .env.local is in your .gitignore file!'));
106
106
  console.log('');
107
107
  console.log(chalk_1.default.gray(' 3. Run: npx threadlines check'));
108
+ console.log(chalk_1.default.gray(' (Use npx --yes threadlines check in non-interactive environments)'));
108
109
  }
109
110
  catch (error) {
110
111
  console.error(chalk_1.default.red(`\n❌ Error: ${error.message}`));
package/dist/index.js CHANGED
@@ -63,10 +63,23 @@ program
63
63
  .description('Check code against your threadlines')
64
64
  .option('--api-url <url>', 'Threadline server URL', process.env.THREADLINE_API_URL || (process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : 'http://localhost:3000'))
65
65
  .option('--full', 'Show all results (compliant, attention, not_relevant). Default: only attention items')
66
- .option('--branch <name>', 'Review all commits in branch vs base')
67
- .option('--commit <sha>', 'Review specific commit')
66
+ .option('--branch <name>', 'Review all commits in branch vs base (e.g., --branch feature/new-feature)')
67
+ .option('--commit <ref>', 'Review specific commit. Accepts commit SHA or git reference (e.g., HEAD, HEAD~1, abc123). Example: --commit HEAD')
68
68
  .option('--file <path>', 'Review entire file (all lines as additions)')
69
69
  .option('--folder <path>', 'Review all files in folder recursively')
70
70
  .option('--files <paths...>', 'Review multiple specified files')
71
+ .addHelpText('after', `
72
+ Examples:
73
+ $ threadlines check # Check staged/unstaged changes (local dev)
74
+ $ threadlines check --commit HEAD # Check latest commit locally
75
+ $ threadlines check --branch main # Check all commits in branch vs base
76
+ $ threadlines check --file src/api.ts # Check entire file
77
+ $ threadlines check --full # Show all results (not just attention items)
78
+
79
+ Auto-detection in CI:
80
+ - CI with branch detected → reviews all commits in branch vs base
81
+ - CI with commit SHA detected → reviews specific commit
82
+ - Local development → reviews staged/unstaged changes
83
+ `)
71
84
  .action(check_1.checkCommand);
72
85
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "threadlines",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Threadline CLI - AI-powered linter based on your natural language documentation",
5
5
  "main": "dist/index.js",
6
6
  "bin": {