linear-cli-agents 0.4.1 → 0.5.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/README.md +66 -11
- package/bin/dev.js +0 -0
- package/dist/commands/config/get.d.ts +9 -0
- package/dist/commands/config/get.js +37 -0
- package/dist/commands/config/list.d.ts +6 -0
- package/dist/commands/config/list.js +30 -0
- package/dist/commands/config/set.d.ts +10 -0
- package/dist/commands/config/set.js +40 -0
- package/dist/commands/info.d.ts +9 -0
- package/dist/commands/info.js +676 -0
- package/dist/commands/issues/bulk-label.d.ts +11 -0
- package/dist/commands/issues/bulk-label.js +113 -0
- package/dist/commands/issues/bulk-update.d.ts +15 -0
- package/dist/commands/issues/bulk-update.js +131 -0
- package/dist/commands/issues/create.js +6 -3
- package/dist/commands/projects/create.d.ts +1 -1
- package/dist/commands/projects/create.js +14 -3
- package/dist/commands/setup.d.ts +9 -0
- package/dist/commands/setup.js +91 -0
- package/dist/lib/config.d.ts +36 -1
- package/dist/lib/config.js +76 -0
- package/dist/lib/types.d.ts +6 -0
- package/oclif.manifest.json +633 -352
- package/package.json +18 -16
- package/scripts/postinstall.js +97 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "linear-cli-agents",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "CLI for interacting with Linear, designed for LLMs and agents",
|
|
5
5
|
"author": "Nacho",
|
|
6
6
|
"bin": {
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"files": [
|
|
21
21
|
"/bin",
|
|
22
22
|
"/dist",
|
|
23
|
+
"/scripts",
|
|
23
24
|
"/oclif.manifest.json"
|
|
24
25
|
],
|
|
25
26
|
"dependencies": {
|
|
@@ -60,6 +61,9 @@
|
|
|
60
61
|
"comments": {
|
|
61
62
|
"description": "Comment management commands"
|
|
62
63
|
},
|
|
64
|
+
"config": {
|
|
65
|
+
"description": "Configuration management commands"
|
|
66
|
+
},
|
|
63
67
|
"issues": {
|
|
64
68
|
"description": "Issue management commands"
|
|
65
69
|
},
|
|
@@ -92,18 +96,6 @@
|
|
|
92
96
|
}
|
|
93
97
|
}
|
|
94
98
|
},
|
|
95
|
-
"scripts": {
|
|
96
|
-
"build": "shx rm -rf dist && tsc -b",
|
|
97
|
-
"lint": "eslint . && tsc --noEmit",
|
|
98
|
-
"lint:fix": "eslint . --fix",
|
|
99
|
-
"format": "prettier --write .",
|
|
100
|
-
"format:check": "prettier --check .",
|
|
101
|
-
"postpack": "shx rm -f oclif.manifest.json",
|
|
102
|
-
"prepack": "pnpm run build && oclif manifest && oclif readme",
|
|
103
|
-
"test": "vitest run",
|
|
104
|
-
"test:watch": "vitest",
|
|
105
|
-
"test:coverage": "vitest run --coverage"
|
|
106
|
-
},
|
|
107
99
|
"engines": {
|
|
108
100
|
"node": ">=18.0.0"
|
|
109
101
|
},
|
|
@@ -114,6 +106,16 @@
|
|
|
114
106
|
"agent",
|
|
115
107
|
"project-management"
|
|
116
108
|
],
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
|
|
109
|
+
"prettier": "@oclif/prettier-config",
|
|
110
|
+
"scripts": {
|
|
111
|
+
"postinstall": "node scripts/postinstall.js || true",
|
|
112
|
+
"build": "shx rm -rf dist && tsc -b",
|
|
113
|
+
"lint": "eslint . && tsc --noEmit",
|
|
114
|
+
"lint:fix": "eslint . --fix",
|
|
115
|
+
"format": "prettier --write .",
|
|
116
|
+
"format:check": "prettier --check .",
|
|
117
|
+
"test": "vitest run",
|
|
118
|
+
"test:watch": "vitest",
|
|
119
|
+
"test:coverage": "vitest run --coverage"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Post-install script that optionally adds Linear CLI usage instructions to CLAUDE.md
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import {existsSync, readFileSync, writeFileSync, mkdirSync} from 'node:fs'
|
|
8
|
+
import {homedir} from 'node:os'
|
|
9
|
+
import {join, dirname} from 'node:path'
|
|
10
|
+
import {createInterface} from 'node:readline'
|
|
11
|
+
|
|
12
|
+
const CLAUDE_MD_PATH = join(homedir(), '.claude', 'CLAUDE.md')
|
|
13
|
+
const LINEAR_CLI_SECTION_START = '<!-- LINEAR-CLI-START -->'
|
|
14
|
+
const LINEAR_CLI_SECTION_END = '<!-- LINEAR-CLI-END -->'
|
|
15
|
+
|
|
16
|
+
const LINEAR_CLI_DOCS = `${LINEAR_CLI_SECTION_START}
|
|
17
|
+
## Linear CLI
|
|
18
|
+
|
|
19
|
+
CLI for Linear. Run \`linear info\` for full documentation.
|
|
20
|
+
|
|
21
|
+
\`\`\`bash
|
|
22
|
+
linear auth login # Authenticate (one-time)
|
|
23
|
+
linear info # Get all commands and docs
|
|
24
|
+
linear issues create --title "X" --team-id ID
|
|
25
|
+
linear issues bulk-update --ids A,B,C --state-id ID
|
|
26
|
+
\`\`\`
|
|
27
|
+
${LINEAR_CLI_SECTION_END}`
|
|
28
|
+
|
|
29
|
+
const updateClaudeMd = () => {
|
|
30
|
+
const dir = dirname(CLAUDE_MD_PATH)
|
|
31
|
+
if (!existsSync(dir)) {
|
|
32
|
+
mkdirSync(dir, {recursive: true})
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
let content = existsSync(CLAUDE_MD_PATH) ? readFileSync(CLAUDE_MD_PATH, 'utf-8') : ''
|
|
36
|
+
|
|
37
|
+
if (content.includes(LINEAR_CLI_SECTION_START)) {
|
|
38
|
+
const regex = new RegExp(`${LINEAR_CLI_SECTION_START}[\\s\\S]*?${LINEAR_CLI_SECTION_END}`, 'g')
|
|
39
|
+
content = content.replace(regex, LINEAR_CLI_DOCS)
|
|
40
|
+
} else {
|
|
41
|
+
const separator = content.length > 0 && !content.endsWith('\n\n') ? '\n\n' : ''
|
|
42
|
+
content = content + separator + LINEAR_CLI_DOCS + '\n'
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
writeFileSync(CLAUDE_MD_PATH, content, 'utf-8')
|
|
46
|
+
return true
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const askQuestion = (question) => {
|
|
50
|
+
return new Promise((resolve) => {
|
|
51
|
+
// Check if stdin is available and interactive
|
|
52
|
+
if (!process.stdin.isTTY) {
|
|
53
|
+
resolve(null)
|
|
54
|
+
return
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const rl = createInterface({
|
|
58
|
+
input: process.stdin,
|
|
59
|
+
output: process.stdout,
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
rl.question(question, (answer) => {
|
|
63
|
+
rl.close()
|
|
64
|
+
resolve(answer?.toLowerCase().trim())
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
// Timeout after 10 seconds
|
|
68
|
+
setTimeout(() => {
|
|
69
|
+
rl.close()
|
|
70
|
+
resolve(null)
|
|
71
|
+
}, 10000)
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const main = async () => {
|
|
76
|
+
// Skip in CI environments
|
|
77
|
+
if (process.env.CI || process.env.GITHUB_ACTIONS) {
|
|
78
|
+
return
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
console.log('\n✓ Linear CLI installed')
|
|
82
|
+
|
|
83
|
+
const answer = await askQuestion(' Add usage instructions to ~/.claude/CLAUDE.md? [y/N] ')
|
|
84
|
+
|
|
85
|
+
if (answer === 'y' || answer === 'yes') {
|
|
86
|
+
try {
|
|
87
|
+
updateClaudeMd()
|
|
88
|
+
console.log(' ✓ Added to CLAUDE.md\n')
|
|
89
|
+
} catch {
|
|
90
|
+
console.log(' ✗ Failed. Run "linear setup" manually.\n')
|
|
91
|
+
}
|
|
92
|
+
} else {
|
|
93
|
+
console.log(' Run "linear setup" later to add instructions.\n')
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
main()
|