openkbs 0.0.88 → 0.0.90
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/package.json +1 -1
- package/src/actions.js +17 -23
- package/src/index.js +1 -1
- package/templates/.claude/skills/openkbs/metadata.json +1 -1
- package/version.json +2 -2
package/package.json
CHANGED
package/src/actions.js
CHANGED
|
@@ -32,15 +32,16 @@ const SERVICES = {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* Find settings
|
|
36
|
-
* Returns
|
|
35
|
+
* Find settings (kbId, region) - checks settings.json locations and openkbs.json
|
|
36
|
+
* Returns object with kbId, region, etc.
|
|
37
37
|
*/
|
|
38
38
|
function findSettings() {
|
|
39
39
|
const paths = [
|
|
40
40
|
path.join(process.cwd(), 'settings.json'),
|
|
41
41
|
path.join(process.cwd(), 'app', 'settings.json'),
|
|
42
42
|
path.join(process.cwd(), 'functions', 'settings.json'),
|
|
43
|
-
path.join(process.cwd(), 'site', 'settings.json')
|
|
43
|
+
path.join(process.cwd(), 'site', 'settings.json'),
|
|
44
|
+
path.join(process.cwd(), 'openkbs.json')
|
|
44
45
|
];
|
|
45
46
|
|
|
46
47
|
for (const settingsPath of paths) {
|
|
@@ -1118,7 +1119,7 @@ async function fnAction(subCommand, args = []) {
|
|
|
1118
1119
|
}
|
|
1119
1120
|
|
|
1120
1121
|
if (!kbId) {
|
|
1121
|
-
return console.red('No KB found.
|
|
1122
|
+
return console.red('No KB found. Add kbId to openkbs.json or settings.json.');
|
|
1122
1123
|
}
|
|
1123
1124
|
|
|
1124
1125
|
const { kbToken } = await fetchKBJWT(kbId);
|
|
@@ -1488,7 +1489,7 @@ async function storageAction(subCommand, args = []) {
|
|
|
1488
1489
|
}
|
|
1489
1490
|
|
|
1490
1491
|
if (!kbId) {
|
|
1491
|
-
return console.red('No KB found.
|
|
1492
|
+
return console.red('No KB found. Add kbId to openkbs.json or settings.json.');
|
|
1492
1493
|
}
|
|
1493
1494
|
|
|
1494
1495
|
const { kbToken } = await fetchKBJWT(kbId);
|
|
@@ -1879,7 +1880,7 @@ async function postgresAction(subCommand, args = []) {
|
|
|
1879
1880
|
}
|
|
1880
1881
|
|
|
1881
1882
|
if (!kbId) {
|
|
1882
|
-
return console.red('No KB found.
|
|
1883
|
+
return console.red('No KB found. Add kbId to openkbs.json or settings.json.');
|
|
1883
1884
|
}
|
|
1884
1885
|
|
|
1885
1886
|
const { kbToken } = await fetchKBJWT(kbId);
|
|
@@ -2016,17 +2017,10 @@ async function siteAction(subCommand, args = []) {
|
|
|
2016
2017
|
let kbId = findKbId();
|
|
2017
2018
|
let siteDir = process.cwd();
|
|
2018
2019
|
|
|
2019
|
-
// If
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
if (fs.existsSync(siteSettingsPath)) {
|
|
2024
|
-
siteDir = siteDirPath;
|
|
2025
|
-
try {
|
|
2026
|
-
const settings = JSON.parse(fs.readFileSync(siteSettingsPath, 'utf8'));
|
|
2027
|
-
kbId = settings.kbId;
|
|
2028
|
-
} catch (e) {}
|
|
2029
|
-
}
|
|
2020
|
+
// If running from project root, use site/ subdirectory
|
|
2021
|
+
const siteDirPath = path.join(process.cwd(), 'site');
|
|
2022
|
+
if (fs.existsSync(siteDirPath)) {
|
|
2023
|
+
siteDir = siteDirPath;
|
|
2030
2024
|
}
|
|
2031
2025
|
|
|
2032
2026
|
if (!kbId) {
|
|
@@ -2035,7 +2029,7 @@ async function siteAction(subCommand, args = []) {
|
|
|
2035
2029
|
}
|
|
2036
2030
|
|
|
2037
2031
|
if (!kbId) {
|
|
2038
|
-
return console.red('No KB found.
|
|
2032
|
+
return console.red('No KB found. Add kbId to openkbs.json or settings.json.');
|
|
2039
2033
|
}
|
|
2040
2034
|
|
|
2041
2035
|
const { kbToken } = await fetchKBJWT(kbId);
|
|
@@ -2059,7 +2053,7 @@ async function siteAction(subCommand, args = []) {
|
|
|
2059
2053
|
console.log(' openkbs site push [folder] Upload files to S3 (defaults to current dir or site/)');
|
|
2060
2054
|
console.log(' openkbs site spa <path> Enable SPA fallback (e.g., /app/index.html)');
|
|
2061
2055
|
console.log(' openkbs site spa --disable Disable SPA fallback');
|
|
2062
|
-
console.log('\nRun from a
|
|
2056
|
+
console.log('\nRun from a directory with openkbs.json or settings.json containing kbId.');
|
|
2063
2057
|
}
|
|
2064
2058
|
}
|
|
2065
2059
|
|
|
@@ -2197,7 +2191,7 @@ async function pulseAction(subCommand, args = []) {
|
|
|
2197
2191
|
}
|
|
2198
2192
|
|
|
2199
2193
|
if (!kbId) {
|
|
2200
|
-
return console.red('No KB found.
|
|
2194
|
+
return console.red('No KB found. Add kbId to openkbs.json or settings.json.');
|
|
2201
2195
|
}
|
|
2202
2196
|
|
|
2203
2197
|
const { kbToken } = await fetchKBJWT(kbId);
|
|
@@ -2435,7 +2429,7 @@ async function elasticDeployAction() {
|
|
|
2435
2429
|
// Get KB token
|
|
2436
2430
|
const settings = findSettings();
|
|
2437
2431
|
if (!settings?.kbId) {
|
|
2438
|
-
return console.red('No kbId found.
|
|
2432
|
+
return console.red('No kbId found. Add kbId to openkbs.json or settings.json.');
|
|
2439
2433
|
}
|
|
2440
2434
|
|
|
2441
2435
|
const res = await fetchKBJWT(settings.kbId);
|
|
@@ -2532,7 +2526,7 @@ async function elasticDestroyAction() {
|
|
|
2532
2526
|
// Get KB token
|
|
2533
2527
|
const settings = findSettings();
|
|
2534
2528
|
if (!settings?.kbId) {
|
|
2535
|
-
return console.red('No kbId found.
|
|
2529
|
+
return console.red('No kbId found. Add kbId to openkbs.json or settings.json.');
|
|
2536
2530
|
}
|
|
2537
2531
|
|
|
2538
2532
|
const res = await fetchKBJWT(settings.kbId);
|
|
@@ -2655,7 +2649,7 @@ async function elasticStatusAction() {
|
|
|
2655
2649
|
// Get KB token
|
|
2656
2650
|
const settings = findSettings();
|
|
2657
2651
|
if (!settings?.kbId) {
|
|
2658
|
-
return console.red('No kbId found.
|
|
2652
|
+
return console.red('No kbId found. Add kbId to openkbs.json or settings.json.');
|
|
2659
2653
|
}
|
|
2660
2654
|
|
|
2661
2655
|
const res = await fetchKBJWT(settings.kbId);
|
package/src/index.js
CHANGED
|
@@ -268,7 +268,7 @@ Examples:
|
|
|
268
268
|
$ openkbs site push Push site/ folder (or current dir) to S3
|
|
269
269
|
$ openkbs site push ./dist Push specific folder to S3
|
|
270
270
|
|
|
271
|
-
Run from a directory
|
|
271
|
+
Run from a directory with openkbs.json or settings.json containing kbId.
|
|
272
272
|
`);
|
|
273
273
|
|
|
274
274
|
program
|
package/version.json
CHANGED