claudekit-cli 1.0.0 → 1.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/.github/workflows/ci.yml +2 -0
- package/CHANGELOG.md +19 -0
- package/CLAUDE.md +7 -0
- package/README.md +61 -3
- package/biome.json +3 -0
- package/dist/index.js +102 -0
- package/package.json +1 -1
- package/src/commands/version.ts +135 -0
- package/src/index.ts +11 -0
- package/src/types.ts +7 -0
- package/tests/commands/version.test.ts +297 -0
- package/.claude/agents/brainstormer.md +0 -96
- package/.claude/agents/code-reviewer.md +0 -141
- package/.claude/agents/copywriter.md +0 -108
- package/.claude/agents/database-admin.md +0 -86
- package/.claude/agents/debugger.md +0 -124
- package/.claude/agents/docs-manager.md +0 -115
- package/.claude/agents/git-manager.md +0 -60
- package/.claude/agents/journal-writer.md +0 -111
- package/.claude/agents/planner.md +0 -87
- package/.claude/agents/project-manager.md +0 -113
- package/.claude/agents/researcher.md +0 -173
- package/.claude/agents/scout.md +0 -123
- package/.claude/agents/tester.md +0 -95
- package/.claude/agents/ui-ux-designer.md +0 -206
- package/.claude/commands/bootstrap.md +0 -104
- package/.claude/commands/brainstorm.md +0 -67
- package/.claude/commands/content/enhance.md +0 -13
- package/.claude/commands/content/fast.md +0 -11
- package/.claude/commands/content/good.md +0 -13
- package/.claude/commands/cook.md +0 -19
- package/.claude/commands/debug.md +0 -10
- package/.claude/commands/design/3d.md +0 -65
- package/.claude/commands/design/describe.md +0 -13
- package/.claude/commands/design/fast.md +0 -19
- package/.claude/commands/design/good.md +0 -23
- package/.claude/commands/design/screenshot.md +0 -23
- package/.claude/commands/design/video.md +0 -23
- package/.claude/commands/docs/init.md +0 -13
- package/.claude/commands/docs/summarize.md +0 -10
- package/.claude/commands/docs/update.md +0 -21
- package/.claude/commands/fix/ci.md +0 -11
- package/.claude/commands/fix/fast.md +0 -12
- package/.claude/commands/fix/hard.md +0 -18
- package/.claude/commands/fix/logs.md +0 -16
- package/.claude/commands/fix/test.md +0 -18
- package/.claude/commands/fix/types.md +0 -10
- package/.claude/commands/git/cm.md +0 -5
- package/.claude/commands/git/cp.md +0 -4
- package/.claude/commands/integrate/polar.md +0 -42
- package/.claude/commands/plan/ci.md +0 -12
- package/.claude/commands/plan/two.md +0 -13
- package/.claude/commands/plan.md +0 -10
- package/.claude/commands/scout.md +0 -29
- package/.claude/commands/test.md +0 -7
- package/.claude/commands/watzup.md +0 -8
- package/.claude/hooks/telegram_notify.sh +0 -136
- package/.claude/send-discord.sh +0 -64
- package/.claude/settings.json +0 -7
- package/.claude/statusline.sh +0 -143
- package/.claude/workflows/development-rules.md +0 -80
- package/.claude/workflows/documentation-management.md +0 -28
- package/.claude/workflows/orchestration-protocol.md +0 -16
- package/.claude/workflows/primary-workflow.md +0 -41
- package/.opencode/agent/code-reviewer.md +0 -141
- package/.opencode/agent/debugger.md +0 -74
- package/.opencode/agent/docs-manager.md +0 -119
- package/.opencode/agent/git-manager.md +0 -60
- package/.opencode/agent/planner-researcher.md +0 -100
- package/.opencode/agent/planner.md +0 -87
- package/.opencode/agent/project-manager.md +0 -113
- package/.opencode/agent/researcher.md +0 -173
- package/.opencode/agent/solution-brainstormer.md +0 -89
- package/.opencode/agent/system-architecture.md +0 -192
- package/.opencode/agent/tester.md +0 -96
- package/.opencode/agent/ui-ux-designer.md +0 -203
- package/.opencode/agent/ui-ux-developer.md +0 -97
- package/.opencode/command/cook.md +0 -7
- package/.opencode/command/debug.md +0 -10
- package/.opencode/command/design/3d.md +0 -65
- package/.opencode/command/design/fast.md +0 -18
- package/.opencode/command/design/good.md +0 -21
- package/.opencode/command/design/screenshot.md +0 -22
- package/.opencode/command/design/video.md +0 -22
- package/.opencode/command/docs/init.md +0 -11
- package/.opencode/command/docs/summarize.md +0 -10
- package/.opencode/command/docs/update.md +0 -18
- package/.opencode/command/fix/ci.md +0 -8
- package/.opencode/command/fix/fast.md +0 -11
- package/.opencode/command/fix/hard.md +0 -15
- package/.opencode/command/fix/logs.md +0 -16
- package/.opencode/command/fix/test.md +0 -18
- package/.opencode/command/fix/types.md +0 -10
- package/.opencode/command/git/cm.md +0 -5
- package/.opencode/command/git/cp.md +0 -4
- package/.opencode/command/plan/ci.md +0 -12
- package/.opencode/command/plan/two.md +0 -13
- package/.opencode/command/plan.md +0 -10
- package/.opencode/command/test.md +0 -7
- package/.opencode/command/watzup.md +0 -8
- package/docs/code-standards.md +0 -1128
- package/docs/codebase-summary.md +0 -821
- package/docs/github-setup.md +0 -176
- package/docs/project-pdr.md +0 -739
- package/docs/system-architecture.md +0 -950
- package/docs/tech-stack.md +0 -290
- package/plans/251008-claudekit-cli-implementation-plan.md +0 -1469
- package/plans/reports/251008-from-code-reviewer-to-developer-review-report.md +0 -864
- package/plans/reports/251008-from-tester-to-developer-test-summary-report.md +0 -409
- package/plans/reports/251008-researcher-download-extraction-report.md +0 -1377
- package/plans/reports/251008-researcher-github-api-report.md +0 -1339
- package/plans/research/251008-cli-frameworks-bun-research.md +0 -1051
- package/plans/templates/bug-fix-template.md +0 -69
- package/plans/templates/feature-implementation-template.md +0 -84
- package/plans/templates/refactor-template.md +0 -82
- package/plans/templates/template-usage-guide.md +0 -58
package/.github/workflows/ci.yml
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [1.1.0](https://github.com/mrgoonie/claudekit-cli/compare/v1.0.1...v1.1.0) (2025-10-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* format package.json keywords array to single line ([c8dd66f](https://github.com/mrgoonie/claudekit-cli/commit/c8dd66faa94a84188790947fe3ee6f562d63cd46))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **cli:** add versions command to list available releases ([27fbad1](https://github.com/mrgoonie/claudekit-cli/commit/27fbad1be3b5df90cb85ba9a3dd1b0eeb4fa6125))
|
|
12
|
+
|
|
13
|
+
## [1.0.1](https://github.com/mrgoonie/claudekit-cli/compare/v1.0.0...v1.0.1) (2025-10-09)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* resolve CI lint failures ([8ff0186](https://github.com/mrgoonie/claudekit-cli/commit/8ff0186d8381003802c70c7cc17383e5662239a1))
|
|
19
|
+
|
|
1
20
|
# 1.0.0 (2025-10-09)
|
|
2
21
|
|
|
3
22
|
|
package/CLAUDE.md
CHANGED
|
@@ -31,3 +31,10 @@ We keep all important docs in `./docs` folder and keep updating them, structure
|
|
|
31
31
|
└── project-roadmap.md
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
+
## Related directories
|
|
35
|
+
|
|
36
|
+
- ClaudeKit CLI: current directory
|
|
37
|
+
- ClaudeKit Engineer: `../claudekit-engineer`
|
|
38
|
+
- ClaudeKit Marketing: `../claudekit-marketing`
|
|
39
|
+
- ClaudeKit Website: `../claudekit-web`
|
|
40
|
+
- ClaudeKit Docs: `../claudekit-docs`
|
package/README.md
CHANGED
|
@@ -13,14 +13,44 @@ Command-line tool for bootstrapping and updating ClaudeKit projects.
|
|
|
13
13
|
- Secure credential storage using OS keychain
|
|
14
14
|
- Beautiful CLI interface with interactive prompts
|
|
15
15
|
|
|
16
|
+
## Prerequisites
|
|
17
|
+
|
|
18
|
+
Before using ClaudeKit CLI, you need to:
|
|
19
|
+
|
|
20
|
+
1. **Purchase a ClaudeKit Starter Kit** from [ClaudeKit.cc](https://claudekit.cc)
|
|
21
|
+
2. **Get Repository Access**: After purchase, you'll receive access to the private GitHub repository containing your kit
|
|
22
|
+
3. **Create a GitHub Personal Access Token** (PAT) with `repo` scope to download releases
|
|
23
|
+
|
|
24
|
+
Without a purchased kit and repository access, the CLI will not be able to download any project templates.
|
|
25
|
+
|
|
16
26
|
## Installation
|
|
17
27
|
|
|
18
|
-
|
|
28
|
+
The ClaudeKit CLI is published on npm at [npmjs.com/package/claudekit-cli](https://www.npmjs.com/package/claudekit-cli).
|
|
29
|
+
|
|
30
|
+
### Using npm (Recommended)
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install -g claudekit-cli
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Using Bun
|
|
19
37
|
|
|
20
38
|
```bash
|
|
21
39
|
bun add -g claudekit-cli
|
|
22
40
|
```
|
|
23
41
|
|
|
42
|
+
### Using Yarn
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
yarn global add claudekit-cli
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Using pnpm
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pnpm add -g claudekit-cli
|
|
52
|
+
```
|
|
53
|
+
|
|
24
54
|
### From Source
|
|
25
55
|
|
|
26
56
|
```bash
|
|
@@ -30,6 +60,12 @@ bun install
|
|
|
30
60
|
bun link
|
|
31
61
|
```
|
|
32
62
|
|
|
63
|
+
After installation, verify it's working:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
ck --version
|
|
67
|
+
```
|
|
68
|
+
|
|
33
69
|
## Usage
|
|
34
70
|
|
|
35
71
|
### Create a New Project
|
|
@@ -58,10 +94,27 @@ ck update --kit engineer
|
|
|
58
94
|
ck update --kit engineer --version v1.0.0
|
|
59
95
|
```
|
|
60
96
|
|
|
97
|
+
### List Available Versions
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# Show all available versions for all kits
|
|
101
|
+
ck versions
|
|
102
|
+
|
|
103
|
+
# Filter by specific kit
|
|
104
|
+
ck versions --kit engineer
|
|
105
|
+
ck versions --kit marketing
|
|
106
|
+
|
|
107
|
+
# Show more versions (default: 30)
|
|
108
|
+
ck versions --limit 50
|
|
109
|
+
|
|
110
|
+
# Include prereleases and drafts
|
|
111
|
+
ck versions --all
|
|
112
|
+
```
|
|
113
|
+
|
|
61
114
|
### Other Commands
|
|
62
115
|
|
|
63
116
|
```bash
|
|
64
|
-
# Show version
|
|
117
|
+
# Show CLI version
|
|
65
118
|
ck --version
|
|
66
119
|
ck -v
|
|
67
120
|
|
|
@@ -93,9 +146,13 @@ export GITHUB_TOKEN=ghp_your_token_here
|
|
|
93
146
|
|
|
94
147
|
## Available Kits
|
|
95
148
|
|
|
149
|
+
ClaudeKit offers premium starter kits available for purchase at [ClaudeKit.cc](https://claudekit.cc):
|
|
150
|
+
|
|
96
151
|
- **engineer**: ClaudeKit Engineer - Engineering toolkit for building with Claude
|
|
97
152
|
- **marketing**: ClaudeKit Marketing - [Coming Soon]
|
|
98
153
|
|
|
154
|
+
Each kit provides a comprehensive project template with best practices, tooling, and workflows optimized for Claude Code development.
|
|
155
|
+
|
|
99
156
|
## Configuration
|
|
100
157
|
|
|
101
158
|
Configuration is stored in `~/.claudekit/config.json`:
|
|
@@ -193,7 +250,8 @@ claudekit-cli/
|
|
|
193
250
|
### 1. Commands
|
|
194
251
|
- **`ck new`**: Create new project from release
|
|
195
252
|
- **`ck update`**: Update existing project
|
|
196
|
-
- **`ck
|
|
253
|
+
- **`ck versions`**: List available versions of ClaudeKit repositories
|
|
254
|
+
- **`ck --version`**: Show CLI version
|
|
197
255
|
- **`ck --help`**: Show help
|
|
198
256
|
|
|
199
257
|
### 2. Authentication (Multi-Tier Fallback)
|
package/biome.json
CHANGED
package/dist/index.js
CHANGED
|
@@ -17718,6 +17718,11 @@ var UpdateCommandOptionsSchema = exports_external.object({
|
|
|
17718
17718
|
kit: KitType.optional(),
|
|
17719
17719
|
version: exports_external.string().optional()
|
|
17720
17720
|
});
|
|
17721
|
+
var VersionCommandOptionsSchema = exports_external.object({
|
|
17722
|
+
kit: KitType.optional(),
|
|
17723
|
+
limit: exports_external.number().optional(),
|
|
17724
|
+
all: exports_external.boolean().optional()
|
|
17725
|
+
});
|
|
17721
17726
|
var ConfigSchema = exports_external.object({
|
|
17722
17727
|
github: exports_external.object({
|
|
17723
17728
|
token: exports_external.string().optional()
|
|
@@ -19085,6 +19090,100 @@ Protected files (.env, etc.) were not modified.`, "Update complete");
|
|
|
19085
19090
|
}
|
|
19086
19091
|
}
|
|
19087
19092
|
|
|
19093
|
+
// src/commands/version.ts
|
|
19094
|
+
var import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
19095
|
+
function formatRelativeTime(dateString) {
|
|
19096
|
+
if (!dateString)
|
|
19097
|
+
return "Unknown";
|
|
19098
|
+
const date = new Date(dateString);
|
|
19099
|
+
const now = new Date;
|
|
19100
|
+
const diffMs = now.getTime() - date.getTime();
|
|
19101
|
+
const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
|
|
19102
|
+
if (diffDays === 0)
|
|
19103
|
+
return "Today";
|
|
19104
|
+
if (diffDays === 1)
|
|
19105
|
+
return "Yesterday";
|
|
19106
|
+
if (diffDays < 7)
|
|
19107
|
+
return `${diffDays} days ago`;
|
|
19108
|
+
if (diffDays < 30)
|
|
19109
|
+
return `${Math.floor(diffDays / 7)} weeks ago`;
|
|
19110
|
+
if (diffDays < 365)
|
|
19111
|
+
return `${Math.floor(diffDays / 30)} months ago`;
|
|
19112
|
+
return `${Math.floor(diffDays / 365)} years ago`;
|
|
19113
|
+
}
|
|
19114
|
+
function displayKitReleases(kitName, releases) {
|
|
19115
|
+
console.log(`
|
|
19116
|
+
${import_picocolors4.default.bold(import_picocolors4.default.cyan(kitName))} - Available Versions:
|
|
19117
|
+
`);
|
|
19118
|
+
if (releases.length === 0) {
|
|
19119
|
+
console.log(import_picocolors4.default.dim(" No releases found"));
|
|
19120
|
+
return;
|
|
19121
|
+
}
|
|
19122
|
+
for (const release of releases) {
|
|
19123
|
+
const version = import_picocolors4.default.green(release.tag_name);
|
|
19124
|
+
const name2 = release.name || "No title";
|
|
19125
|
+
const publishedAt = formatRelativeTime(release.published_at);
|
|
19126
|
+
const assetCount = release.assets.length;
|
|
19127
|
+
const badges = [];
|
|
19128
|
+
if (release.prerelease)
|
|
19129
|
+
badges.push(import_picocolors4.default.yellow("[prerelease]"));
|
|
19130
|
+
if (release.draft)
|
|
19131
|
+
badges.push(import_picocolors4.default.gray("[draft]"));
|
|
19132
|
+
const badgeStr = badges.length > 0 ? ` ${badges.join(" ")}` : "";
|
|
19133
|
+
const versionPart = version.padEnd(20);
|
|
19134
|
+
const namePart = name2.length > 40 ? `${name2.slice(0, 37)}...` : name2.padEnd(40);
|
|
19135
|
+
const timePart = import_picocolors4.default.dim(publishedAt.padEnd(20));
|
|
19136
|
+
const assetPart = import_picocolors4.default.dim(`(${assetCount} ${assetCount === 1 ? "asset" : "assets"})`);
|
|
19137
|
+
console.log(` ${versionPart} ${namePart} ${timePart} ${assetPart}${badgeStr}`);
|
|
19138
|
+
}
|
|
19139
|
+
console.log(import_picocolors4.default.dim(`
|
|
19140
|
+
Showing ${releases.length} ${releases.length === 1 ? "release" : "releases"}`));
|
|
19141
|
+
}
|
|
19142
|
+
async function versionCommand(options) {
|
|
19143
|
+
const prompts = new PromptsManager;
|
|
19144
|
+
prompts.intro("\uD83D\uDCE6 ClaudeKit - Available Versions");
|
|
19145
|
+
try {
|
|
19146
|
+
const validOptions = VersionCommandOptionsSchema.parse(options);
|
|
19147
|
+
const kitsToFetch = validOptions.kit ? [validOptions.kit] : Object.keys(AVAILABLE_KITS);
|
|
19148
|
+
const github = new GitHubClient;
|
|
19149
|
+
const limit = validOptions.limit || 30;
|
|
19150
|
+
const releasePromises = kitsToFetch.map(async (kitType) => {
|
|
19151
|
+
const kitConfig = AVAILABLE_KITS[kitType];
|
|
19152
|
+
try {
|
|
19153
|
+
const releases = await github.listReleases(kitConfig, limit);
|
|
19154
|
+
const filteredReleases = validOptions.all ? releases : releases.filter((r2) => !r2.draft && !r2.prerelease);
|
|
19155
|
+
return {
|
|
19156
|
+
kitType,
|
|
19157
|
+
kitConfig,
|
|
19158
|
+
releases: filteredReleases,
|
|
19159
|
+
error: null
|
|
19160
|
+
};
|
|
19161
|
+
} catch (error2) {
|
|
19162
|
+
return {
|
|
19163
|
+
kitType,
|
|
19164
|
+
kitConfig,
|
|
19165
|
+
releases: [],
|
|
19166
|
+
error: error2 instanceof Error ? error2.message : "Unknown error"
|
|
19167
|
+
};
|
|
19168
|
+
}
|
|
19169
|
+
});
|
|
19170
|
+
const results = await Promise.all(releasePromises);
|
|
19171
|
+
for (const result of results) {
|
|
19172
|
+
if (result.error) {
|
|
19173
|
+
console.log(`
|
|
19174
|
+
${import_picocolors4.default.bold(import_picocolors4.default.cyan(result.kitConfig.name))} - ${import_picocolors4.default.red("Error")}`);
|
|
19175
|
+
console.log(import_picocolors4.default.dim(` ${result.error}`));
|
|
19176
|
+
} else {
|
|
19177
|
+
displayKitReleases(result.kitConfig.name, result.releases);
|
|
19178
|
+
}
|
|
19179
|
+
}
|
|
19180
|
+
prompts.outro("✨ Done");
|
|
19181
|
+
} catch (error2) {
|
|
19182
|
+
logger.error(error2 instanceof Error ? error2.message : "Unknown error occurred");
|
|
19183
|
+
process.exit(1);
|
|
19184
|
+
}
|
|
19185
|
+
}
|
|
19186
|
+
|
|
19088
19187
|
// src/index.ts
|
|
19089
19188
|
var __dirname2 = fileURLToPath(new URL(".", import.meta.url));
|
|
19090
19189
|
var packageJson = JSON.parse(readFileSync(join5(__dirname2, "../package.json"), "utf-8"));
|
|
@@ -19095,6 +19194,9 @@ cli.command("new", "Bootstrap a new ClaudeKit project").option("--dir <dir>", "T
|
|
|
19095
19194
|
cli.command("update", "Update existing ClaudeKit project").option("--dir <dir>", "Target directory (default: .)").option("--kit <kit>", "Kit to use (engineer, marketing)").option("--version <version>", "Specific version to download (default: latest)").action(async (options) => {
|
|
19096
19195
|
await updateCommand(options);
|
|
19097
19196
|
});
|
|
19197
|
+
cli.command("versions", "List available versions of ClaudeKit repositories").option("--kit <kit>", "Filter by specific kit (engineer, marketing)").option("--limit <limit>", "Number of releases to show (default: 30)").option("--all", "Show all releases including prereleases").action(async (options) => {
|
|
19198
|
+
await versionCommand(options);
|
|
19199
|
+
});
|
|
19098
19200
|
cli.version(packageJson.version);
|
|
19099
19201
|
cli.help();
|
|
19100
19202
|
cli.parse();
|
package/package.json
CHANGED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import pc from "picocolors";
|
|
2
|
+
import { GitHubClient } from "../lib/github.js";
|
|
3
|
+
import { PromptsManager } from "../lib/prompts.js";
|
|
4
|
+
import {
|
|
5
|
+
AVAILABLE_KITS,
|
|
6
|
+
type GitHubRelease,
|
|
7
|
+
type VersionCommandOptions,
|
|
8
|
+
VersionCommandOptionsSchema,
|
|
9
|
+
} from "../types.js";
|
|
10
|
+
import { logger } from "../utils/logger.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Format a date as a relative time string
|
|
14
|
+
*/
|
|
15
|
+
function formatRelativeTime(dateString?: string): string {
|
|
16
|
+
if (!dateString) return "Unknown";
|
|
17
|
+
|
|
18
|
+
const date = new Date(dateString);
|
|
19
|
+
const now = new Date();
|
|
20
|
+
const diffMs = now.getTime() - date.getTime();
|
|
21
|
+
const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
|
|
22
|
+
|
|
23
|
+
if (diffDays === 0) return "Today";
|
|
24
|
+
if (diffDays === 1) return "Yesterday";
|
|
25
|
+
if (diffDays < 7) return `${diffDays} days ago`;
|
|
26
|
+
if (diffDays < 30) return `${Math.floor(diffDays / 7)} weeks ago`;
|
|
27
|
+
if (diffDays < 365) return `${Math.floor(diffDays / 30)} months ago`;
|
|
28
|
+
return `${Math.floor(diffDays / 365)} years ago`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Display releases for a single kit
|
|
33
|
+
*/
|
|
34
|
+
function displayKitReleases(kitName: string, releases: GitHubRelease[]): void {
|
|
35
|
+
console.log(`\n${pc.bold(pc.cyan(kitName))} - Available Versions:\n`);
|
|
36
|
+
|
|
37
|
+
if (releases.length === 0) {
|
|
38
|
+
console.log(pc.dim(" No releases found"));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
for (const release of releases) {
|
|
43
|
+
const version = pc.green(release.tag_name);
|
|
44
|
+
const name = release.name || "No title";
|
|
45
|
+
const publishedAt = formatRelativeTime(release.published_at);
|
|
46
|
+
const assetCount = release.assets.length;
|
|
47
|
+
|
|
48
|
+
// Add badges for prerelease and draft
|
|
49
|
+
const badges: string[] = [];
|
|
50
|
+
if (release.prerelease) badges.push(pc.yellow("[prerelease]"));
|
|
51
|
+
if (release.draft) badges.push(pc.gray("[draft]"));
|
|
52
|
+
const badgeStr = badges.length > 0 ? ` ${badges.join(" ")}` : "";
|
|
53
|
+
|
|
54
|
+
// Format: version | name | time | assets
|
|
55
|
+
const versionPart = version.padEnd(20);
|
|
56
|
+
const namePart = name.length > 40 ? `${name.slice(0, 37)}...` : name.padEnd(40);
|
|
57
|
+
const timePart = pc.dim(publishedAt.padEnd(20));
|
|
58
|
+
const assetPart = pc.dim(`(${assetCount} ${assetCount === 1 ? "asset" : "assets"})`);
|
|
59
|
+
|
|
60
|
+
console.log(` ${versionPart} ${namePart} ${timePart} ${assetPart}${badgeStr}`);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
console.log(
|
|
64
|
+
pc.dim(`\nShowing ${releases.length} ${releases.length === 1 ? "release" : "releases"}`),
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Version command - List available versions of ClaudeKit repositories
|
|
70
|
+
*/
|
|
71
|
+
export async function versionCommand(options: VersionCommandOptions): Promise<void> {
|
|
72
|
+
const prompts = new PromptsManager();
|
|
73
|
+
|
|
74
|
+
prompts.intro("📦 ClaudeKit - Available Versions");
|
|
75
|
+
|
|
76
|
+
try {
|
|
77
|
+
// Validate and parse options
|
|
78
|
+
const validOptions = VersionCommandOptionsSchema.parse(options);
|
|
79
|
+
|
|
80
|
+
// Determine which kits to fetch
|
|
81
|
+
const kitsToFetch = validOptions.kit
|
|
82
|
+
? [validOptions.kit]
|
|
83
|
+
: (Object.keys(AVAILABLE_KITS) as Array<keyof typeof AVAILABLE_KITS>);
|
|
84
|
+
|
|
85
|
+
// Initialize GitHub client
|
|
86
|
+
const github = new GitHubClient();
|
|
87
|
+
|
|
88
|
+
// Determine limit (default to 30, similar to GitHub CLI)
|
|
89
|
+
const limit = validOptions.limit || 30;
|
|
90
|
+
|
|
91
|
+
// Fetch releases for all requested kits in parallel
|
|
92
|
+
const releasePromises = kitsToFetch.map(async (kitType) => {
|
|
93
|
+
const kitConfig = AVAILABLE_KITS[kitType];
|
|
94
|
+
try {
|
|
95
|
+
const releases = await github.listReleases(kitConfig, limit);
|
|
96
|
+
|
|
97
|
+
// Filter out drafts and prereleases unless --all flag is set
|
|
98
|
+
const filteredReleases = validOptions.all
|
|
99
|
+
? releases
|
|
100
|
+
: releases.filter((r) => !r.draft && !r.prerelease);
|
|
101
|
+
|
|
102
|
+
return {
|
|
103
|
+
kitType,
|
|
104
|
+
kitConfig,
|
|
105
|
+
releases: filteredReleases,
|
|
106
|
+
error: null,
|
|
107
|
+
};
|
|
108
|
+
} catch (error) {
|
|
109
|
+
return {
|
|
110
|
+
kitType,
|
|
111
|
+
kitConfig,
|
|
112
|
+
releases: [],
|
|
113
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
const results = await Promise.all(releasePromises);
|
|
119
|
+
|
|
120
|
+
// Display results
|
|
121
|
+
for (const result of results) {
|
|
122
|
+
if (result.error) {
|
|
123
|
+
console.log(`\n${pc.bold(pc.cyan(result.kitConfig.name))} - ${pc.red("Error")}`);
|
|
124
|
+
console.log(pc.dim(` ${result.error}`));
|
|
125
|
+
} else {
|
|
126
|
+
displayKitReleases(result.kitConfig.name, result.releases);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
prompts.outro("✨ Done");
|
|
131
|
+
} catch (error) {
|
|
132
|
+
logger.error(error instanceof Error ? error.message : "Unknown error occurred");
|
|
133
|
+
process.exit(1);
|
|
134
|
+
}
|
|
135
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { fileURLToPath } from "node:url";
|
|
|
6
6
|
import { cac } from "cac";
|
|
7
7
|
import { newCommand } from "./commands/new.js";
|
|
8
8
|
import { updateCommand } from "./commands/update.js";
|
|
9
|
+
import { versionCommand } from "./commands/version.js";
|
|
9
10
|
|
|
10
11
|
const __dirname = fileURLToPath(new URL(".", import.meta.url));
|
|
11
12
|
|
|
@@ -34,6 +35,16 @@ cli
|
|
|
34
35
|
await updateCommand(options);
|
|
35
36
|
});
|
|
36
37
|
|
|
38
|
+
// Versions command
|
|
39
|
+
cli
|
|
40
|
+
.command("versions", "List available versions of ClaudeKit repositories")
|
|
41
|
+
.option("--kit <kit>", "Filter by specific kit (engineer, marketing)")
|
|
42
|
+
.option("--limit <limit>", "Number of releases to show (default: 30)")
|
|
43
|
+
.option("--all", "Show all releases including prereleases")
|
|
44
|
+
.action(async (options) => {
|
|
45
|
+
await versionCommand(options);
|
|
46
|
+
});
|
|
47
|
+
|
|
37
48
|
// Version
|
|
38
49
|
cli.version(packageJson.version);
|
|
39
50
|
|
package/src/types.ts
CHANGED
|
@@ -19,6 +19,13 @@ export const UpdateCommandOptionsSchema = z.object({
|
|
|
19
19
|
});
|
|
20
20
|
export type UpdateCommandOptions = z.infer<typeof UpdateCommandOptionsSchema>;
|
|
21
21
|
|
|
22
|
+
export const VersionCommandOptionsSchema = z.object({
|
|
23
|
+
kit: KitType.optional(),
|
|
24
|
+
limit: z.number().optional(),
|
|
25
|
+
all: z.boolean().optional(),
|
|
26
|
+
});
|
|
27
|
+
export type VersionCommandOptions = z.infer<typeof VersionCommandOptionsSchema>;
|
|
28
|
+
|
|
22
29
|
// Config schemas
|
|
23
30
|
export const ConfigSchema = z.object({
|
|
24
31
|
github: z
|