@caik.dev/cli 0.1.3 → 0.1.4
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/dist/index.js +5 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -133,7 +133,7 @@ import { readFileSync, writeFileSync, mkdirSync, chmodSync, existsSync } from "f
|
|
|
133
133
|
import { join } from "path";
|
|
134
134
|
import { homedir } from "os";
|
|
135
135
|
var DEFAULT_CONFIG = {
|
|
136
|
-
apiUrl: "https://caik.dev",
|
|
136
|
+
apiUrl: "https://www.caik.dev",
|
|
137
137
|
defaultLimit: 10,
|
|
138
138
|
version: 1
|
|
139
139
|
};
|
|
@@ -1035,7 +1035,7 @@ async function loadConfig() {
|
|
|
1035
1035
|
|
|
1036
1036
|
async function getApiUrl() {
|
|
1037
1037
|
const cfg = await loadConfig();
|
|
1038
|
-
return process.env.CAIK_API_URL || cfg.apiUrl || "https://caik.dev";
|
|
1038
|
+
return process.env.CAIK_API_URL || cfg.apiUrl || "https://www.caik.dev";
|
|
1039
1039
|
}
|
|
1040
1040
|
|
|
1041
1041
|
async function getApiKey() {
|
|
@@ -1619,7 +1619,8 @@ async function authenticate(apiUrl, port = 0) {
|
|
|
1619
1619
|
server.listen(port, async () => {
|
|
1620
1620
|
const actualPort = server.address().port;
|
|
1621
1621
|
const callbackUrl = `http://localhost:${actualPort}/callback`;
|
|
1622
|
-
const
|
|
1622
|
+
const cliCallbackUrl = `${apiUrl}/api/auth/cli-callback?redirect=${encodeURIComponent(callbackUrl)}&state=${encodeURIComponent(state)}`;
|
|
1623
|
+
const loginUrl = `${apiUrl}/cli-auth?continue=${encodeURIComponent(cliCallbackUrl)}`;
|
|
1623
1624
|
console.log(info(`Listening on http://localhost:${actualPort} for callback...`));
|
|
1624
1625
|
const opened = await openBrowser(loginUrl);
|
|
1625
1626
|
if (opened) {
|
|
@@ -3187,7 +3188,7 @@ try {
|
|
|
3187
3188
|
version = pkg.version;
|
|
3188
3189
|
} catch {
|
|
3189
3190
|
}
|
|
3190
|
-
var program = new Command().name("caik").description("CAIK \u2014 Collective AI Knowledge CLI\nSearch, install, and publish AI artifacts from your terminal.").version(version, "-v, --version").option("--api-url <url>", "API base URL (default: https://caik.dev)").option("--api-key <key>", "API key for authentication").option("--verbose", "Show detailed output including API calls").option("--json", "Output raw JSON (for scripting)");
|
|
3191
|
+
var program = new Command().name("caik").description("CAIK \u2014 Collective AI Knowledge CLI\nSearch, install, and publish AI artifacts from your terminal.").version(version, "-v, --version").option("--api-url <url>", "API base URL (default: https://www.caik.dev)").option("--api-key <key>", "API key for authentication").option("--verbose", "Show detailed output including API calls").option("--json", "Output raw JSON (for scripting)");
|
|
3191
3192
|
registerSearchCommand(program);
|
|
3192
3193
|
registerInstallCommand(program);
|
|
3193
3194
|
registerInitCommand(program);
|