swixter 0.0.10 → 0.0.11

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/cli/index.js +15 -3
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -13261,7 +13261,7 @@ var CONFIG_VERSION = "2.0.0", EXPORT_VERSION = "1.0.0";
13261
13261
  var init_versions2 = () => {};
13262
13262
 
13263
13263
  // src/constants/meta.ts
13264
- var APP_VERSION = "0.0.10";
13264
+ var APP_VERSION = "0.0.11";
13265
13265
  var init_meta = () => {};
13266
13266
 
13267
13267
  // src/constants/install.ts
@@ -20485,7 +20485,7 @@ async function handleApplyPrompt(options) {
20485
20485
  var import_picocolors5 = __toESM(require_picocolors(), 1);
20486
20486
  import { spawn } from "node:child_process";
20487
20487
  function spawnCLI(options) {
20488
- const { command, args, env, displayName } = options;
20488
+ const { command, args, env, displayName, onExit } = options;
20489
20489
  const finalEnv = env ? { ...process.env, ...env } : process.env;
20490
20490
  const child = spawn(command, args, {
20491
20491
  env: finalEnv,
@@ -20493,6 +20493,7 @@ function spawnCLI(options) {
20493
20493
  shell: true
20494
20494
  });
20495
20495
  child.on("exit", (code) => {
20496
+ onExit?.();
20496
20497
  process.exit(code || 0);
20497
20498
  });
20498
20499
  child.on("error", (error46) => {
@@ -20500,6 +20501,7 @@ function spawnCLI(options) {
20500
20501
  console.log(import_picocolors5.default.red(`✗ Run failed: ${error46.message}`));
20501
20502
  console.log(import_picocolors5.default.dim(`Please ensure ${displayName} CLI is installed`));
20502
20503
  console.log();
20504
+ onExit?.();
20503
20505
  process.exit(1);
20504
20506
  });
20505
20507
  }
@@ -21741,6 +21743,13 @@ async function cmdRun(args) {
21741
21743
  }
21742
21744
  return true;
21743
21745
  });
21746
+ const tmp = await import("node:os");
21747
+ const path = await import("node:path");
21748
+ const fs = await import("node:fs/promises");
21749
+ const settingsContent = JSON.stringify({ env }, null, 2);
21750
+ const tmpFile = path.join(tmp.tmpdir(), `swixter-settings-${Date.now()}.json`);
21751
+ await fs.writeFile(tmpFile, settingsContent, "utf-8");
21752
+ claudeArgs.push("--settings", tmpFile);
21744
21753
  console.log();
21745
21754
  console.log(import_picocolors8.default.dim(`Using profile: ${import_picocolors8.default.cyan(profile.name)} (${preset?.displayName})`));
21746
21755
  console.log(import_picocolors8.default.dim(`Base URL: ${import_picocolors8.default.yellow(baseURL || "Default")}`));
@@ -21749,7 +21758,10 @@ async function cmdRun(args) {
21749
21758
  command: "claude",
21750
21759
  args: claudeArgs,
21751
21760
  env,
21752
- displayName: CODER_CONFIG.displayName
21761
+ displayName: CODER_CONFIG.displayName,
21762
+ onExit: () => {
21763
+ fs.unlink(tmpFile).catch(() => {});
21764
+ }
21753
21765
  });
21754
21766
  }
21755
21767
  async function cmdInstall(args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swixter",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "CLI tool for managing AI coding assistant configurations - easily switch between providers (Claude Code, Codex, Continue) with Anthropic, Ollama, or custom APIs",
5
5
  "main": "dist/cli/index.js",
6
6
  "module": "dist/cli/index.js",