cullit 0.1.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/LICENSE +21 -0
- package/dist/index.js +188 -0
- package/package.json +36 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Cullit (Matt)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
import { runPipeline, VERSION } from "@cullit/core";
|
|
5
|
+
import { loadConfig } from "@cullit/config";
|
|
6
|
+
import { getRecentTags } from "@cullit/core";
|
|
7
|
+
import { writeFileSync, readFileSync, existsSync } from "fs";
|
|
8
|
+
import { resolve } from "path";
|
|
9
|
+
function loadEnv() {
|
|
10
|
+
const envPath = resolve(process.cwd(), ".env");
|
|
11
|
+
if (!existsSync(envPath)) return;
|
|
12
|
+
const content = readFileSync(envPath, "utf-8");
|
|
13
|
+
for (const line of content.split("\n")) {
|
|
14
|
+
const trimmed = line.trim();
|
|
15
|
+
if (!trimmed || trimmed.startsWith("#")) continue;
|
|
16
|
+
const eqIndex = trimmed.indexOf("=");
|
|
17
|
+
if (eqIndex === -1) continue;
|
|
18
|
+
const key = trimmed.slice(0, eqIndex).trim();
|
|
19
|
+
const val = trimmed.slice(eqIndex + 1).trim().replace(/^["']|["']$/g, "");
|
|
20
|
+
if (key && val && !process.env[key]) {
|
|
21
|
+
process.env[key] = val;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
loadEnv();
|
|
26
|
+
var HELP = `
|
|
27
|
+
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
28
|
+
\u2551 Cullit v${VERSION} \u2551
|
|
29
|
+
\u2551 Cull the noise from your releases. \u2551
|
|
30
|
+
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
31
|
+
|
|
32
|
+
USAGE
|
|
33
|
+
$ cullit <command> [options]
|
|
34
|
+
|
|
35
|
+
COMMANDS
|
|
36
|
+
generate Generate release notes from git, Jira, or Linear
|
|
37
|
+
init Create a .cullit.yml config file
|
|
38
|
+
tags List recent tags in the current repo
|
|
39
|
+
|
|
40
|
+
OPTIONS (generate)
|
|
41
|
+
--from, -f Start ref, JQL query, or Linear filter
|
|
42
|
+
--to, -t End ref (defaults to HEAD)
|
|
43
|
+
--config, -c Path to config file (default: .cullit.yml)
|
|
44
|
+
--format Output format: markdown, html, json (default: markdown)
|
|
45
|
+
--dry-run Generate but don't publish
|
|
46
|
+
--provider Override AI provider (anthropic, openai, gemini, ollama, openclaw, none)
|
|
47
|
+
--source Override source type (local, jira, linear)
|
|
48
|
+
--audience Override audience (developer, end-user, executive)
|
|
49
|
+
|
|
50
|
+
EXAMPLES
|
|
51
|
+
$ cullit generate --from v1.0.0 --to v1.1.0
|
|
52
|
+
$ cullit generate --from HEAD~10 --provider gemini
|
|
53
|
+
$ cullit generate --from HEAD~5 --provider ollama --model llama3.1
|
|
54
|
+
$ cullit generate --from HEAD~5 --provider none # no AI key needed
|
|
55
|
+
$ cullit generate --source jira --from "project = PROJ" --provider anthropic
|
|
56
|
+
$ cullit generate --source linear --from "team:ENG" --provider openai
|
|
57
|
+
$ cullit init
|
|
58
|
+
`;
|
|
59
|
+
var DEFAULT_YML = `# Cullit Configuration
|
|
60
|
+
# https://cullit.io/docs/config
|
|
61
|
+
|
|
62
|
+
ai:
|
|
63
|
+
provider: anthropic # anthropic | openai | gemini | ollama | openclaw | none
|
|
64
|
+
# model: claude-sonnet-4-20250514 # optional: override default model
|
|
65
|
+
audience: developer # developer | end-user | executive
|
|
66
|
+
tone: professional # professional | casual | terse
|
|
67
|
+
categories: [features, fixes, breaking, improvements, chores]
|
|
68
|
+
|
|
69
|
+
source:
|
|
70
|
+
type: local # local | jira | linear
|
|
71
|
+
# enrichment: [jira, linear] # uncomment to enable enrichment
|
|
72
|
+
|
|
73
|
+
publish:
|
|
74
|
+
- type: stdout # always output to terminal
|
|
75
|
+
# - type: file
|
|
76
|
+
# path: RELEASE_NOTES.md
|
|
77
|
+
# - type: slack
|
|
78
|
+
# webhook_url: $SLACK_WEBHOOK_URL
|
|
79
|
+
# - type: discord
|
|
80
|
+
# webhook_url: $DISCORD_WEBHOOK_URL
|
|
81
|
+
|
|
82
|
+
# jira:
|
|
83
|
+
# domain: yourcompany.atlassian.net
|
|
84
|
+
# # Set JIRA_EMAIL and JIRA_API_TOKEN in your environment
|
|
85
|
+
|
|
86
|
+
# linear:
|
|
87
|
+
# # Set LINEAR_API_KEY in your environment
|
|
88
|
+
|
|
89
|
+
# openclaw:
|
|
90
|
+
# baseUrl: http://localhost:18789 # OpenClaw gateway URL
|
|
91
|
+
# # Set OPENCLAW_TOKEN in your environment
|
|
92
|
+
`;
|
|
93
|
+
async function main() {
|
|
94
|
+
const args = process.argv.slice(2);
|
|
95
|
+
const command = args[0];
|
|
96
|
+
if (!command || command === "--help" || command === "-h") {
|
|
97
|
+
console.log(HELP);
|
|
98
|
+
process.exit(0);
|
|
99
|
+
}
|
|
100
|
+
if (command === "--version" || command === "-v") {
|
|
101
|
+
console.log(`cull v${VERSION}`);
|
|
102
|
+
process.exit(0);
|
|
103
|
+
}
|
|
104
|
+
if (command === "init") {
|
|
105
|
+
writeFileSync(".cullit.yml", DEFAULT_YML, "utf-8");
|
|
106
|
+
console.log("\u2713 Created .cullit.yml");
|
|
107
|
+
console.log(" Edit it to configure your AI provider, integrations, and publish targets.");
|
|
108
|
+
process.exit(0);
|
|
109
|
+
}
|
|
110
|
+
if (command === "tags") {
|
|
111
|
+
const tags = getRecentTags(process.cwd(), 20);
|
|
112
|
+
if (tags.length === 0) {
|
|
113
|
+
console.log("No tags found in this repository.");
|
|
114
|
+
} else {
|
|
115
|
+
console.log("Recent tags:");
|
|
116
|
+
tags.forEach((t, i) => console.log(` ${i === 0 ? "\u2192" : " "} ${t}`));
|
|
117
|
+
}
|
|
118
|
+
process.exit(0);
|
|
119
|
+
}
|
|
120
|
+
if (command === "generate") {
|
|
121
|
+
const opts = parseArgs(args.slice(1));
|
|
122
|
+
const from = opts.from || opts.f;
|
|
123
|
+
let to = opts.to || opts.t || "HEAD";
|
|
124
|
+
if (!from) {
|
|
125
|
+
const tags = getRecentTags();
|
|
126
|
+
if (tags.length >= 2) {
|
|
127
|
+
console.log(`\xBB Auto-detected: generating notes from ${tags[1]} to ${tags[0]}`);
|
|
128
|
+
const autoFrom = tags[1];
|
|
129
|
+
to = tags[0];
|
|
130
|
+
return await runGenerate(autoFrom, to, opts);
|
|
131
|
+
}
|
|
132
|
+
console.error("Error: --from is required. Specify a tag, branch, or commit SHA.");
|
|
133
|
+
console.error(" Example: cullit generate --from v1.0.0 --to v1.1.0");
|
|
134
|
+
console.error(' Run "cullit tags" to see available tags.');
|
|
135
|
+
process.exit(1);
|
|
136
|
+
}
|
|
137
|
+
return await runGenerate(from, to, opts);
|
|
138
|
+
}
|
|
139
|
+
console.error(`Unknown command: ${command}`);
|
|
140
|
+
console.log(HELP);
|
|
141
|
+
process.exit(1);
|
|
142
|
+
}
|
|
143
|
+
async function runGenerate(from, to, opts) {
|
|
144
|
+
const config = loadConfig(opts.config || opts.c || process.cwd());
|
|
145
|
+
if (opts.provider) config.ai.provider = opts.provider;
|
|
146
|
+
if (opts.audience) config.ai.audience = opts.audience;
|
|
147
|
+
if (opts.model) config.ai.model = opts.model;
|
|
148
|
+
if (opts.source) config.source.type = opts.source;
|
|
149
|
+
const format = opts.format || "markdown";
|
|
150
|
+
const dryRun = "dry-run" in opts || "dryRun" in opts;
|
|
151
|
+
try {
|
|
152
|
+
const result = await runPipeline(from, to, config, { format, dryRun });
|
|
153
|
+
} catch (err) {
|
|
154
|
+
console.error(`
|
|
155
|
+
\u2717 Error: ${err.message}`);
|
|
156
|
+
process.exitCode = 1;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function parseArgs(args) {
|
|
160
|
+
const result = {};
|
|
161
|
+
for (let i = 0; i < args.length; i++) {
|
|
162
|
+
const arg = args[i];
|
|
163
|
+
if (arg.startsWith("--")) {
|
|
164
|
+
const key = arg.substring(2);
|
|
165
|
+
const next = args[i + 1];
|
|
166
|
+
if (next && !next.startsWith("-")) {
|
|
167
|
+
result[key] = next;
|
|
168
|
+
i++;
|
|
169
|
+
} else {
|
|
170
|
+
result[key] = "true";
|
|
171
|
+
}
|
|
172
|
+
} else if (arg.startsWith("-") && arg.length === 2) {
|
|
173
|
+
const key = arg.substring(1);
|
|
174
|
+
const next = args[i + 1];
|
|
175
|
+
if (next && !next.startsWith("-")) {
|
|
176
|
+
result[key] = next;
|
|
177
|
+
i++;
|
|
178
|
+
} else {
|
|
179
|
+
result[key] = "true";
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return result;
|
|
184
|
+
}
|
|
185
|
+
main().catch((err) => {
|
|
186
|
+
console.error(`Fatal: ${err.message}`);
|
|
187
|
+
process.exitCode = 1;
|
|
188
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cullit",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Cull the noise from your releases. AI-powered release notes from the CLI.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Cullit <matt@cullit.io>",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/mttaylor/cullit",
|
|
11
|
+
"directory": "packages/cli"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"release-notes",
|
|
15
|
+
"changelog",
|
|
16
|
+
"ai",
|
|
17
|
+
"cli",
|
|
18
|
+
"devops",
|
|
19
|
+
"automation"
|
|
20
|
+
],
|
|
21
|
+
"bin": {
|
|
22
|
+
"cullit": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"main": "./dist/index.js",
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@cullit/core": "0.1.0",
|
|
30
|
+
"@cullit/config": "0.1.0"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsup src/index.ts --format esm --clean",
|
|
34
|
+
"dev": "tsup src/index.ts --format esm --watch"
|
|
35
|
+
}
|
|
36
|
+
}
|