aiblueprint-cli 1.0.0 → 1.0.3

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.
Files changed (3) hide show
  1. package/README.md +34 -81
  2. package/dist/cli.js +116 -29
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,108 +2,46 @@
2
2
 
3
3
  A CLI tool for setting up Claude Code configurations with AIBlueprint defaults.
4
4
 
5
- ## Development
6
-
7
- ### Setup
5
+ ## Quick Start
8
6
 
9
7
  ```bash
10
- # Install dependencies (includes release-it)
11
- bun install
8
+ # Run immediately without installation
9
+ bunx aiblueprint-cli claude-code setup
12
10
  ```
13
11
 
14
- ### Testing & Development
15
-
16
- ```bash
17
- # Build the CLI
18
- bun run build
19
-
20
- # Test locally with npm link
21
- npm link
22
-
23
- # Test the CLI
24
- aiblueprint claude-code setup
25
-
26
- # Or test directly with node
27
- node dist/cli.js claude-code setup
28
-
29
- # Test with custom folder (for development)
30
- mkdir ./test-claude-config
31
- node dist/cli.js claude-code -f ./test-claude-config setup
32
-
33
- # Run in development mode
34
- bun run dev claude-code setup
35
- ```
36
-
37
- ### Publishing
38
-
39
- #### Automated Release (Recommended)
40
-
41
- ```bash
42
- # This will automatically:
43
- # 1. Increment version
44
- # 2. Build the project
45
- # 3. Create git tag
46
- # 4. Publish to npm
47
- bun run release
48
- ```
49
-
50
- #### Manual Release
51
-
52
- ```bash
53
- # Build first
54
- bun run build
55
-
56
- # Then publish
57
- npm publish
58
- ```
59
-
60
- ### Scripts
61
-
62
- - `bun run build` - Build the TypeScript to JavaScript
63
- - `bun run dev` - Run in development mode
64
- - `bun run release` - Automated release with version bump and publish
65
- - `bun run test-local` - Test locally with npm link
66
-
67
- ## Usage
68
-
69
- ### Installation
12
+ ## Installation & Usage
70
13
 
71
14
  ```bash
72
15
  # Install globally
73
- npm install -g @melvynx/aiblueprint
16
+ npm install -g aiblueprint-cli
74
17
 
75
- # Or use with npx/pnpm dlx
76
- npx @melvynx/aiblueprint claude-code setup
77
- pnpm dlx @melvynx/aiblueprint claude-code setup
18
+ # Or use with npx/pnpm dlx/bunx
19
+ npx aiblueprint-cli claude-code setup
20
+ pnpm dlx aiblueprint-cli claude-code setup
21
+ bunx aiblueprint-cli claude-code setup
78
22
  ```
79
23
 
80
- ### Setup Claude Code Configuration
81
-
82
- ```bash
83
- aiblueprint claude-code setup
84
- ```
24
+ ## What it does
85
25
 
86
- This will interactively set up your Claude Code environment with:
26
+ The setup command will interactively configure your Claude Code environment with:
87
27
 
88
28
  - **Shell shortcuts** - Add `cc` and `ccc` aliases for quick access
89
- - **Command validation** - Security hook for bash commands
29
+ - **Command validation** - Security hook for bash commands
90
30
  - **Custom statusline** - Shows git, costs, tokens info
91
31
  - **AIBlueprint commands** - Pre-configured command templates
92
32
  - **AIBlueprint agents** - Specialized AI agents
93
33
  - **Output styles** - Custom output formatting
94
34
  - **Notification sounds** - Audio alerts for events
95
35
 
96
- ## What it does
97
-
98
- The setup command will:
36
+ ### Setup Process
99
37
 
100
- 1. Create `~/.claude/` directory if it doesn't exist
101
- 2. Copy selected configurations to your `.claude` folder
102
- 3. Update your `~/.claude/settings.json` with new configurations
103
- 4. Install required dependencies (`bun`, `ccusage`)
104
- 5. Add shell aliases to your shell configuration file
38
+ 1. Creates `~/.claude/` directory if it doesn't exist
39
+ 2. Copies selected configurations to your `.claude` folder
40
+ 3. Updates your `~/.claude/settings.json` with new configurations
41
+ 4. Installs required dependencies (`bun`, `ccusage`)
42
+ 5. Adds shell aliases to your shell configuration file
105
43
 
106
- ## Shell Shortcuts
44
+ ### Shell Shortcuts
107
45
 
108
46
  After setup, you can use:
109
47
  - `cc` - Claude Code with permissions skipped
@@ -115,6 +53,21 @@ After setup, you can use:
115
53
  - macOS or Linux
116
54
  - Claude Code installed
117
55
 
56
+ ## Development
57
+
58
+ ```bash
59
+ # Install dependencies
60
+ bun install
61
+
62
+ # Build and test locally
63
+ bun run build
64
+ npm link
65
+ aiblueprint claude-code setup
66
+
67
+ # Development mode
68
+ bun run dev claude-code setup
69
+ ```
70
+
118
71
  ## License
119
72
 
120
73
  MIT
package/dist/cli.js CHANGED
@@ -5123,6 +5123,48 @@ import { fileURLToPath } from "url";
5123
5123
  import { dirname } from "path";
5124
5124
  var __filename2 = fileURLToPath(import.meta.url);
5125
5125
  var __dirname2 = dirname(__filename2);
5126
+ var GITHUB_RAW_BASE = "https://raw.githubusercontent.com/Melvynx/aiblueprint-cli/main/claude-code-config";
5127
+ async function downloadFromGitHub(relativePath, targetPath) {
5128
+ try {
5129
+ const url = `${GITHUB_RAW_BASE}/${relativePath}`;
5130
+ const response = await fetch(url);
5131
+ if (!response.ok) {
5132
+ return false;
5133
+ }
5134
+ const content = await response.arrayBuffer();
5135
+ await import_fs_extra.default.ensureDir(path.dirname(targetPath));
5136
+ await import_fs_extra.default.writeFile(targetPath, Buffer.from(content));
5137
+ return true;
5138
+ } catch (error) {
5139
+ return false;
5140
+ }
5141
+ }
5142
+ async function downloadDirectoryFromGitHub(dirPath, targetDir) {
5143
+ try {
5144
+ const apiUrl = `https://api.github.com/repos/Melvynx/aiblueprint-cli/contents/claude-code-config/${dirPath}`;
5145
+ const response = await fetch(apiUrl);
5146
+ if (!response.ok) {
5147
+ return false;
5148
+ }
5149
+ const files = await response.json();
5150
+ if (!Array.isArray(files)) {
5151
+ return false;
5152
+ }
5153
+ await import_fs_extra.default.ensureDir(targetDir);
5154
+ for (const file of files) {
5155
+ const relativePath = `${dirPath}/${file.name}`;
5156
+ const targetPath = path.join(targetDir, file.name);
5157
+ if (file.type === "file") {
5158
+ await downloadFromGitHub(relativePath, targetPath);
5159
+ } else if (file.type === "dir") {
5160
+ await downloadDirectoryFromGitHub(relativePath, targetPath);
5161
+ }
5162
+ }
5163
+ return true;
5164
+ } catch (error) {
5165
+ return false;
5166
+ }
5167
+ }
5126
5168
  async function setupCommand(customFolder, skipInteractive) {
5127
5169
  try {
5128
5170
  console.log(source_default.blue.bold(`
@@ -5163,51 +5205,96 @@ async function setupCommand(customFolder, skipInteractive) {
5163
5205
  };
5164
5206
  const s = de();
5165
5207
  const claudeDir = customFolder ? path.resolve(customFolder) : path.join(os2.homedir(), ".claude");
5166
- let sourceDir;
5167
- const currentDir = process.cwd();
5168
- const possiblePaths = [
5169
- path.join(currentDir, "claude-code-config"),
5170
- path.join(__dirname2, "../../claude-code-config"),
5171
- path.join(path.dirname(process.argv[1]), "../claude-code-config")
5172
- ];
5173
- sourceDir = possiblePaths.find((p) => {
5174
- try {
5175
- return import_fs_extra.default.existsSync(p);
5176
- } catch {
5177
- return false;
5178
- }
5179
- }) || possiblePaths[0];
5180
5208
  console.log(source_default.gray(`Installing to: ${claudeDir}`));
5181
5209
  await import_fs_extra.default.ensureDir(claudeDir);
5210
+ let useGitHub = true;
5211
+ let sourceDir;
5212
+ const testUrl = `${GITHUB_RAW_BASE}/scripts/validate-command.js`;
5213
+ try {
5214
+ const testResponse = await fetch(testUrl);
5215
+ useGitHub = testResponse.ok;
5216
+ } catch {
5217
+ useGitHub = false;
5218
+ }
5219
+ if (!useGitHub) {
5220
+ const currentDir = process.cwd();
5221
+ const possiblePaths = [
5222
+ path.join(currentDir, "claude-code-config"),
5223
+ path.join(__dirname2, "../../claude-code-config"),
5224
+ path.join(__dirname2, "../claude-code-config"),
5225
+ path.join(path.dirname(process.argv[1]), "../claude-code-config")
5226
+ ];
5227
+ sourceDir = possiblePaths.find((p) => {
5228
+ try {
5229
+ return import_fs_extra.default.existsSync(p);
5230
+ } catch {
5231
+ return false;
5232
+ }
5233
+ });
5234
+ if (!sourceDir) {
5235
+ throw new Error("Could not find claude-code-config directory locally and GitHub is not accessible");
5236
+ }
5237
+ console.log(source_default.yellow(" Using local configuration files (GitHub not accessible)"));
5238
+ } else {
5239
+ console.log(source_default.green(" Downloading latest configuration from GitHub"));
5240
+ }
5182
5241
  if (options.shellShortcuts) {
5183
5242
  s.start("Setting up shell shortcuts");
5184
5243
  await setupShellShortcuts();
5185
5244
  s.stop("Shell shortcuts configured");
5186
5245
  }
5187
5246
  if (options.commandValidation || options.customStatusline || options.notificationSounds) {
5188
- s.start("Copying scripts");
5189
- await import_fs_extra.default.copy(path.join(sourceDir, "scripts"), path.join(claudeDir, "scripts"), { overwrite: true });
5190
- s.stop("Scripts copied");
5247
+ s.start("Setting up scripts");
5248
+ if (useGitHub) {
5249
+ const scriptsDir = path.join(claudeDir, "scripts");
5250
+ await import_fs_extra.default.ensureDir(scriptsDir);
5251
+ const scriptFiles = ["validate-command.js", "statusline-ccusage.sh", "validate-command.readme.md", "statusline.readme.md"];
5252
+ for (const file of scriptFiles) {
5253
+ await downloadFromGitHub(`scripts/${file}`, path.join(scriptsDir, file));
5254
+ }
5255
+ } else {
5256
+ await import_fs_extra.default.copy(path.join(sourceDir, "scripts"), path.join(claudeDir, "scripts"), { overwrite: true });
5257
+ }
5258
+ s.stop("Scripts installed");
5191
5259
  }
5192
5260
  if (options.aiblueprintCommands) {
5193
- s.start("Copying AIBlueprint commands");
5194
- await import_fs_extra.default.copy(path.join(sourceDir, "commands"), path.join(claudeDir, "commands"), { overwrite: true });
5195
- s.stop("Commands copied");
5261
+ s.start("Setting up AIBlueprint commands");
5262
+ if (useGitHub) {
5263
+ await downloadDirectoryFromGitHub("commands", path.join(claudeDir, "commands"));
5264
+ } else {
5265
+ await import_fs_extra.default.copy(path.join(sourceDir, "commands"), path.join(claudeDir, "commands"), { overwrite: true });
5266
+ }
5267
+ s.stop("Commands installed");
5196
5268
  }
5197
5269
  if (options.aiblueprintAgents) {
5198
- s.start("Copying AIBlueprint agents");
5199
- await import_fs_extra.default.copy(path.join(sourceDir, "agents"), path.join(claudeDir, "agents"), { overwrite: true });
5200
- s.stop("Agents copied");
5270
+ s.start("Setting up AIBlueprint agents");
5271
+ if (useGitHub) {
5272
+ await downloadDirectoryFromGitHub("agents", path.join(claudeDir, "agents"));
5273
+ } else {
5274
+ await import_fs_extra.default.copy(path.join(sourceDir, "agents"), path.join(claudeDir, "agents"), { overwrite: true });
5275
+ }
5276
+ s.stop("Agents installed");
5201
5277
  }
5202
5278
  if (options.outputStyles) {
5203
- s.start("Copying output styles");
5204
- await import_fs_extra.default.copy(path.join(sourceDir, "output-styles"), path.join(claudeDir, "output-styles"), { overwrite: true });
5205
- s.stop("Output styles copied");
5279
+ s.start("Setting up output styles");
5280
+ if (useGitHub) {
5281
+ await downloadDirectoryFromGitHub("output-styles", path.join(claudeDir, "output-styles"));
5282
+ } else {
5283
+ await import_fs_extra.default.copy(path.join(sourceDir, "output-styles"), path.join(claudeDir, "output-styles"), { overwrite: true });
5284
+ }
5285
+ s.stop("Output styles installed");
5206
5286
  }
5207
5287
  if (options.notificationSounds) {
5208
- s.start("Copying notification sounds");
5209
- await import_fs_extra.default.copy(path.join(sourceDir, "song"), path.join(claudeDir, "song"), { overwrite: true });
5210
- s.stop("Notification sounds copied");
5288
+ s.start("Setting up notification sounds");
5289
+ if (useGitHub) {
5290
+ const songDir = path.join(claudeDir, "song");
5291
+ await import_fs_extra.default.ensureDir(songDir);
5292
+ await downloadFromGitHub("song/finish.mp3", path.join(songDir, "finish.mp3"));
5293
+ await downloadFromGitHub("song/need-human.mp3", path.join(songDir, "need-human.mp3"));
5294
+ } else {
5295
+ await import_fs_extra.default.copy(path.join(sourceDir, "song"), path.join(claudeDir, "song"), { overwrite: true });
5296
+ }
5297
+ s.stop("Notification sounds installed");
5211
5298
  }
5212
5299
  if (options.customStatusline) {
5213
5300
  s.start("Checking dependencies");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiblueprint-cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "AIBlueprint CLI for setting up Claude Code configurations",
5
5
  "author": "AIBlueprint",
6
6
  "license": "MIT",