@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.
Files changed (2) hide show
  1. package/dist/index.js +6 -4
  2. 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
- constructor(baseUrl) {
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.3");
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@struere/cli",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "CLI tool for developing, testing, and deploying AI agents",
5
5
  "keywords": [
6
6
  "ai",