@openma/cli 0.1.0-beta.1 → 0.1.0-beta.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.
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -43,7 +43,7 @@ function loadConfig() {
|
|
|
43
43
|
const stored = readCredentials();
|
|
44
44
|
if (envKey) {
|
|
45
45
|
return {
|
|
46
|
-
baseUrl: envBase || stored?.base_url || "
|
|
46
|
+
baseUrl: envBase || stored?.base_url || "https://openma.dev",
|
|
47
47
|
apiKey: envKey,
|
|
48
48
|
json: false,
|
|
49
49
|
source: "env"
|
|
@@ -67,12 +67,12 @@ function loadConfigOptional() {
|
|
|
67
67
|
const envKey = process.env.OMA_API_KEY;
|
|
68
68
|
const stored = readCredentials();
|
|
69
69
|
if (envKey) {
|
|
70
|
-
return { baseUrl: envBase || stored?.base_url || "
|
|
70
|
+
return { baseUrl: envBase || stored?.base_url || "https://openma.dev", apiKey: envKey, json: false, source: "env" };
|
|
71
71
|
}
|
|
72
72
|
if (stored) {
|
|
73
73
|
return { baseUrl: envBase || stored.base_url, apiKey: stored.token, json: false, source: "stored" };
|
|
74
74
|
}
|
|
75
|
-
return { baseUrl: envBase || "
|
|
75
|
+
return { baseUrl: envBase || "https://openma.dev", apiKey: "", json: false, source: "missing" };
|
|
76
76
|
}
|
|
77
77
|
async function apiFetch(config, path, init) {
|
|
78
78
|
const url = `${config.baseUrl}${path}`;
|
|
@@ -234,7 +234,7 @@ var commands = [
|
|
|
234
234
|
desc: "Open browser to authenticate; stores ~/.config/oma/credentials.json",
|
|
235
235
|
http: "POST /v1/me/cli-tokens (browser handoff via /cli/login)",
|
|
236
236
|
async run(_config, args) {
|
|
237
|
-
const baseUrl = (flag(args, "--base-url") ?? process.env.OMA_BASE_URL ?? "https://
|
|
237
|
+
const baseUrl = (flag(args, "--base-url") ?? process.env.OMA_BASE_URL ?? "https://openma.dev").replace(/\/+$/, "");
|
|
238
238
|
await authLogin(baseUrl);
|
|
239
239
|
}
|
|
240
240
|
},
|
|
@@ -1667,7 +1667,7 @@ Usage:`);
|
|
|
1667
1667
|
oma api <resource> Show endpoints for a resource
|
|
1668
1668
|
|
|
1669
1669
|
Environment:
|
|
1670
|
-
OMA_BASE_URL API base (default:
|
|
1670
|
+
OMA_BASE_URL API base (default: https://openma.dev)
|
|
1671
1671
|
OMA_API_KEY API key \u2014 overrides stored credentials when set
|
|
1672
1672
|
XDG_CONFIG_HOME Base dir for credentials (default: ~/.config)
|
|
1673
1673
|
|