ai-builder 0.1.1 → 0.1.2

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 +25 -25
  2. package/dist/index.js +18 -3
  3. package/package.json +2 -1
package/README.md CHANGED
@@ -43,19 +43,19 @@ npx ai-builder add agent git-town/code_reviewer
43
43
 
44
44
  ```bash
45
45
  # Install an agent
46
- ai-builder add agent git-town/code_reviewer
46
+ npx ai-builder add agent git-town/code_reviewer
47
47
 
48
48
  # Install a command
49
- ai-builder add command truffle-ai/quality-checks
49
+ npx ai-builder add command truffle-ai/quality-checks
50
50
 
51
51
  # Install a skill
52
- ai-builder add skill anthropic/pdf
52
+ npx ai-builder add skill anthropic/pdf
53
53
 
54
54
  # Search for artifacts
55
- ai-builder search "test"
55
+ npx ai-builder search "test"
56
56
 
57
57
  # List installed artifacts
58
- ai-builder list
58
+ npx ai-builder list
59
59
  ```
60
60
 
61
61
  ---
@@ -67,7 +67,7 @@ ai-builder list
67
67
  Install an artifact from the registry:
68
68
 
69
69
  ```bash
70
- ai-builder add <type> <author/slug>
70
+ npx ai-builder add <type> <author/slug>
71
71
  ```
72
72
 
73
73
  **Types:** `skill`, `agent`, `command`, `stack`
@@ -76,26 +76,26 @@ ai-builder add <type> <author/slug>
76
76
 
77
77
  ```bash
78
78
  # Install an agent
79
- ai-builder add agent git-town/code_reviewer
79
+ npx ai-builder add agent git-town/code_reviewer
80
80
 
81
81
  # Install a command
82
- ai-builder add command truffle-ai/quality-checks
82
+ npx ai-builder add command truffle-ai/quality-checks
83
83
 
84
84
  # Install a skill
85
- ai-builder add skill anthropic/mcp-builder
85
+ npx ai-builder add skill anthropic/mcp-builder
86
86
 
87
87
  # Force reinstall (overwrite existing)
88
- ai-builder add agent git-town/code_reviewer --force
88
+ npx ai-builder add agent git-town/code_reviewer --force
89
89
  ```
90
90
 
91
91
  **Stacks** bundle multiple artifacts together:
92
92
 
93
93
  ```bash
94
94
  # Install a stack (prompts for confirmation)
95
- ai-builder add stack my-stack
95
+ npx ai-builder add stack my-stack
96
96
 
97
97
  # Skip confirmation
98
- ai-builder add stack my-stack --yes
98
+ npx ai-builder add stack my-stack --yes
99
99
  ```
100
100
 
101
101
  ### Remove
@@ -103,18 +103,18 @@ ai-builder add stack my-stack --yes
103
103
  Remove an installed artifact:
104
104
 
105
105
  ```bash
106
- ai-builder remove <type> <author/slug>
107
- ai-builder rm <type> <author/slug> # alias
106
+ npx ai-builder remove <type> <author/slug>
107
+ npx ai-builder rm <type> <author/slug> # alias
108
108
  ```
109
109
 
110
110
  **Examples:**
111
111
 
112
112
  ```bash
113
113
  # Remove an agent
114
- ai-builder remove agent git-town/code_reviewer
114
+ npx ai-builder remove agent git-town/code_reviewer
115
115
 
116
116
  # Skip confirmation
117
- ai-builder rm agent git-town/code_reviewer --yes
117
+ npx ai-builder rm agent git-town/code_reviewer --yes
118
118
  ```
119
119
 
120
120
  ### List
@@ -122,17 +122,17 @@ ai-builder rm agent git-town/code_reviewer --yes
122
122
  List all installed artifacts:
123
123
 
124
124
  ```bash
125
- ai-builder list
126
- ai-builder ls # alias
125
+ npx ai-builder list
126
+ npx ai-builder ls # alias
127
127
  ```
128
128
 
129
129
  **Options:**
130
130
 
131
131
  ```bash
132
132
  # Filter by type
133
- ai-builder list --type agent
134
- ai-builder list --type skill
135
- ai-builder list --type command
133
+ npx ai-builder list --type agent
134
+ npx ai-builder list --type skill
135
+ npx ai-builder list --type command
136
136
  ```
137
137
 
138
138
  ### Search
@@ -140,20 +140,20 @@ ai-builder list --type command
140
140
  Search the registry for artifacts:
141
141
 
142
142
  ```bash
143
- ai-builder search <query>
143
+ npx ai-builder search <query>
144
144
  ```
145
145
 
146
146
  **Options:**
147
147
 
148
148
  ```bash
149
149
  # Filter by type
150
- ai-builder search "review" --type agent
150
+ npx ai-builder search "review" --type agent
151
151
 
152
152
  # Filter by task category
153
- ai-builder search "nextjs" --task frontend
153
+ npx ai-builder search "nextjs" --task frontend
154
154
 
155
155
  # Limit results
156
- ai-builder search "database" --limit 5
156
+ npx ai-builder search "database" --limit 5
157
157
  ```
158
158
 
159
159
  ---
package/dist/index.js CHANGED
@@ -10,14 +10,19 @@ import chalk from "chalk";
10
10
  import ora from "ora";
11
11
 
12
12
  // src/services/api.ts
13
+ import { createCliLogger } from "@aibuilder/logger/adapters/cli";
13
14
  var API_BASE = process.env.AI_BUILDER_API_URL || "https://aibuilder.sh/api";
15
+ var logger = createCliLogger({ base: { module: "cli:api" } });
14
16
  async function resolveArtifact(type, slug) {
15
17
  const url = `${API_BASE}/resolve?type=${encodeURIComponent(type)}&slug=${encodeURIComponent(slug)}`;
18
+ logger.debug({ type, slug, url }, "Resolving artifact");
16
19
  const response = await fetch(url);
17
20
  if (!response.ok) {
18
21
  const errorBody = await response.json().catch(() => ({ error: "Unknown error" }));
22
+ logger.error({ type, slug, status: response.status }, "Failed to resolve artifact");
19
23
  throw new Error(errorBody.error || `Failed to resolve artifact: ${response.status}`);
20
24
  }
25
+ logger.debug({ type, slug }, "Artifact resolved successfully");
21
26
  return response.json();
22
27
  }
23
28
  async function searchArtifacts(options) {
@@ -30,11 +35,15 @@ async function searchArtifacts(options) {
30
35
  if (options.task) params.set("task", options.task);
31
36
  if (options.limit) params.set("limit", options.limit.toString());
32
37
  const url = `${API_BASE}/artifacts?${params.toString()}`;
38
+ logger.debug({ options, url }, "Searching artifacts");
33
39
  const response = await fetch(url);
34
40
  if (!response.ok) {
41
+ logger.error({ status: response.status, options }, "Search failed");
35
42
  throw new Error(`Failed to search artifacts: ${response.status}`);
36
43
  }
37
- return response.json();
44
+ const result = await response.json();
45
+ logger.debug({ resultCount: result.artifacts.length, total: result.total }, "Search completed");
46
+ return result;
38
47
  }
39
48
  async function trackInstall(type, slug, cliVersion) {
40
49
  try {
@@ -43,17 +52,23 @@ async function trackInstall(type, slug, cliVersion) {
43
52
  headers: { "Content-Type": "application/json" },
44
53
  body: JSON.stringify({ type, slug, cliVersion })
45
54
  });
46
- } catch {
55
+ logger.debug({ type, slug, cliVersion }, "Install tracked");
56
+ } catch (error) {
57
+ logger.debug({ err: error, type, slug }, "Install tracking failed (non-critical)");
47
58
  }
48
59
  }
49
60
  async function resolveStack(slug) {
50
61
  const url = `${API_BASE}/stacks/${encodeURIComponent(slug)}`;
62
+ logger.debug({ slug, url }, "Resolving stack");
51
63
  const response = await fetch(url);
52
64
  if (!response.ok) {
53
65
  const errorBody = await response.json().catch(() => ({ error: "Unknown error" }));
66
+ logger.error({ slug, status: response.status }, "Failed to resolve stack");
54
67
  throw new Error(errorBody.error || `Failed to resolve stack: ${response.status}`);
55
68
  }
56
- return response.json();
69
+ const result = await response.json();
70
+ logger.debug({ slug, artifactCount: result.artifactCount }, "Stack resolved successfully");
71
+ return result;
57
72
  }
58
73
 
59
74
  // src/services/installer.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-builder",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "CLI for installing Claude Code artifacts from aibuilder.sh",
5
5
  "type": "module",
6
6
  "bin": {
@@ -22,6 +22,7 @@
22
22
  "access": "public"
23
23
  },
24
24
  "dependencies": {
25
+ "@aibuilder/logger": "workspace:*",
25
26
  "chalk": "^5.3.0",
26
27
  "commander": "^12.1.0",
27
28
  "ora": "^8.1.0"