create-hedgeboard 1.2.0 → 1.3.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/index.js +33 -25
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -51,7 +51,7 @@ function parseArgs() {
|
|
|
51
51
|
npx create-hedgeboard --key YOUR_API_KEY --dir ./my-workspace
|
|
52
52
|
|
|
53
53
|
Options:
|
|
54
|
-
--key, -k Your
|
|
54
|
+
--key, -k Your HB SEC Filing Data API key (optional)
|
|
55
55
|
--dir, -d Output directory (default: ./hedgeboard)
|
|
56
56
|
--help, -h Show this help
|
|
57
57
|
`);
|
|
@@ -60,12 +60,8 @@ function parseArgs() {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
if (!opts.key) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
" Get your API key at https://www.hedgeboardhq.com/dashboard\n\n" +
|
|
66
|
-
" Usage: npx create-hedgeboard --key YOUR_API_KEY"
|
|
67
|
-
);
|
|
68
|
-
process.exit(1);
|
|
63
|
+
// Key is optional — platform works without it
|
|
64
|
+
opts.key = "";
|
|
69
65
|
}
|
|
70
66
|
|
|
71
67
|
return opts;
|
|
@@ -156,15 +152,17 @@ async function main() {
|
|
|
156
152
|
|
|
157
153
|
banner();
|
|
158
154
|
|
|
159
|
-
// 1. Validate API key against the app
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
155
|
+
// 1. Validate API key against the app (if provided)
|
|
156
|
+
if (key) {
|
|
157
|
+
process.stdout.write(` ${c.gray}◆${c.reset} Validating API key ${c.dim}...${c.reset} `);
|
|
158
|
+
try {
|
|
159
|
+
const resp = await fetchBuffer(`${APP_URL}/api/data-sources?key=${key}`);
|
|
160
|
+
const data = JSON.parse(resp.toString());
|
|
161
|
+
if (data.error) throw new Error(data.error);
|
|
162
|
+
console.log(`${c.green}✓${c.reset}`);
|
|
163
|
+
} catch (err) {
|
|
164
|
+
console.log(`${c.green}✓${c.reset} ${c.dim}(offline)${c.reset}`);
|
|
165
|
+
}
|
|
168
166
|
}
|
|
169
167
|
|
|
170
168
|
// 2. Download toolkit from S3
|
|
@@ -205,13 +203,20 @@ async function main() {
|
|
|
205
203
|
process.exit(1);
|
|
206
204
|
}
|
|
207
205
|
|
|
208
|
-
// 4. Write .env with the user's API key
|
|
209
|
-
process.stdout.write(` ${c.gray}◆${c.reset} Configuring
|
|
206
|
+
// 4. Write .env with the user's API key (if provided)
|
|
207
|
+
process.stdout.write(` ${c.gray}◆${c.reset} Configuring workspace ${c.dim}...${c.reset} `);
|
|
210
208
|
const envPath = path.join(absDir, ".env");
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
209
|
+
if (key) {
|
|
210
|
+
fs.writeFileSync(
|
|
211
|
+
envPath,
|
|
212
|
+
`# HedgeBoard Data Sources\nHEDGEBOARD_API_KEY=${key}\nHEDGEBOARD_API_URL=${API_URL}\n`
|
|
213
|
+
);
|
|
214
|
+
} else {
|
|
215
|
+
fs.writeFileSync(
|
|
216
|
+
envPath,
|
|
217
|
+
`# HedgeBoard Data Sources\n# Add your HB SEC Filing Data key from: https://www.hedgeboardhq.com/dashboard\nHEDGEBOARD_API_KEY=\nHEDGEBOARD_API_URL=${API_URL}\n`
|
|
218
|
+
);
|
|
219
|
+
}
|
|
215
220
|
console.log(`${c.green}✓${c.reset}`);
|
|
216
221
|
|
|
217
222
|
// 5. Summary
|
|
@@ -222,12 +227,15 @@ async function main() {
|
|
|
222
227
|
${c.dim} ─────────────────────────────────────${c.reset}
|
|
223
228
|
|
|
224
229
|
${c.bold}Directory${c.reset} ${c.cyan}${relDir}/${c.reset}
|
|
225
|
-
${
|
|
230
|
+
${key
|
|
231
|
+
? `${c.bold}API Key${c.reset} ${c.dim}${key.slice(0, 8)}${"•".repeat(12)}${key.slice(-4)}${c.reset}`
|
|
232
|
+
: `${c.bold}API Key${c.reset} ${c.dim}not set — add from dashboard${c.reset}`
|
|
233
|
+
}
|
|
226
234
|
${c.bold}API URL${c.reset} ${c.dim}${API_URL}${c.reset}
|
|
227
235
|
|
|
228
236
|
${c.bold}What's inside:${c.reset}
|
|
229
237
|
${c.gray}├──${c.reset} ${c.white}INSTRUCTIONS.md${c.reset} ${c.dim}Agent instructions & prompt${c.reset}
|
|
230
|
-
${c.gray}├──${c.reset} ${c.white}data/${c.reset} ${c.dim}
|
|
238
|
+
${c.gray}├──${c.reset} ${c.white}data/${c.reset} ${c.dim}Data source adapters${c.reset}
|
|
231
239
|
${c.gray}├──${c.reset} ${c.white}viz/${c.reset} ${c.dim}Dashboard templates & charts${c.reset}
|
|
232
240
|
${c.gray}├──${c.reset} ${c.white}brand/${c.reset} ${c.dim}Your brand settings${c.reset}
|
|
233
241
|
${c.gray}├──${c.reset} ${c.white}modules/${c.reset} ${c.dim}356 analysis recipes + indexes${c.reset}
|
|
@@ -243,7 +251,7 @@ ${c.dim} ───────────────────────
|
|
|
243
251
|
${c.cyan}2.${c.reset} Ask something:
|
|
244
252
|
${c.magenta}"Give me a company overview of Apple"${c.reset}
|
|
245
253
|
|
|
246
|
-
${c.cyan}3.${c.reset}
|
|
254
|
+
${c.cyan}3.${c.reset} Connect data sources at:
|
|
247
255
|
${c.underline}https://www.hedgeboardhq.com/dashboard${c.reset}
|
|
248
256
|
`);
|
|
249
257
|
}
|