@struere/cli 0.2.3 → 0.2.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 +6 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -76,11 +76,13 @@ function getSyncUrl() {
|
|
|
76
76
|
|
|
77
77
|
class ApiClient {
|
|
78
78
|
baseUrl;
|
|
79
|
-
|
|
79
|
+
tokenOverride;
|
|
80
|
+
constructor(baseUrl, token) {
|
|
80
81
|
this.baseUrl = baseUrl || getApiUrl();
|
|
82
|
+
this.tokenOverride = token;
|
|
81
83
|
}
|
|
82
84
|
async request(path, options = {}) {
|
|
83
|
-
const token = getToken();
|
|
85
|
+
const token = this.tokenOverride || getToken();
|
|
84
86
|
const apiKey = getApiKey();
|
|
85
87
|
const headers = {
|
|
86
88
|
"Content-Type": "application/json",
|
|
@@ -243,7 +245,7 @@ async function browserLoginInternal(spinner) {
|
|
|
243
245
|
try {
|
|
244
246
|
const { token } = await authPromise;
|
|
245
247
|
spinner.text = "Fetching user info";
|
|
246
|
-
const api = new ApiClient;
|
|
248
|
+
const api = new ApiClient(undefined, token);
|
|
247
249
|
const { user, organization } = await api.getMe();
|
|
248
250
|
const credentials = {
|
|
249
251
|
token,
|
|
@@ -2114,7 +2116,7 @@ var whoamiCommand = new Command11("whoami").description("Show current logged in
|
|
|
2114
2116
|
});
|
|
2115
2117
|
|
|
2116
2118
|
// src/index.ts
|
|
2117
|
-
program.name("struere").description("Struere CLI - Build, test, and deploy AI agents").version("0.2.
|
|
2119
|
+
program.name("struere").description("Struere CLI - Build, test, and deploy AI agents").version("0.2.4");
|
|
2118
2120
|
program.addCommand(initCommand);
|
|
2119
2121
|
program.addCommand(loginCommand);
|
|
2120
2122
|
program.addCommand(logoutCommand);
|