xling 0.8.2 → 0.9.0
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/README.md +7 -0
- package/dist/base-BPSqk5ri.js +1 -0
- package/dist/{base-Cov20PP9.d.ts → base-CxP5zx2U.d.ts} +2 -2
- package/dist/{base-DcAlCBYZ.js → base-DTfJeAL2.js} +1 -1
- package/dist/{base-jI7rfzg2.d.ts → base-DjEQ7jRo.d.ts} +2 -2
- package/dist/claude-CA8e4ttR.js +1 -0
- package/dist/claude-DWXHrlbr.js +1 -0
- package/dist/{codex-BgdYXtjI.js → codex-CeecDPCd.js} +1 -1
- package/dist/codex-CsSN6D2f.js +1 -0
- package/dist/commands/council/index.d.ts +13 -0
- package/dist/commands/council/index.js +5 -0
- package/dist/commands/discuss/index.js +7 -7
- package/dist/commands/git/prc.js +1 -1
- package/dist/commands/git/prr.js +1 -1
- package/dist/commands/git/prv.js +1 -1
- package/dist/commands/git/worktree.js +1 -1
- package/dist/commands/git/wta.js +1 -1
- package/dist/commands/git/wtl.js +1 -1
- package/dist/commands/git/wtp.js +1 -1
- package/dist/commands/git/wtr.js +1 -1
- package/dist/commands/git/wts.js +1 -1
- package/dist/commands/p/index.js +1 -1
- package/dist/commands/proxy/index.d.ts +13 -0
- package/dist/commands/proxy/index.js +16 -0
- package/dist/commands/settings/auth.d.ts +14 -0
- package/dist/commands/settings/auth.js +8 -0
- package/dist/commands/settings/get.js +2 -2
- package/dist/commands/settings/inspect.js +1 -1
- package/dist/commands/settings/list.js +1 -1
- package/dist/commands/settings/set.js +1 -1
- package/dist/commands/settings/switch.js +9 -4
- package/dist/commands/sx/index.js +1 -1
- package/dist/commands/version/index.js +1 -1
- package/dist/commands/x/index.js +1 -1
- package/dist/config-HujHce5l.d.ts +127 -0
- package/dist/config-bqLy-CvP.js +1 -0
- package/dist/{create-BBfcINwf.js → create-CSR6dBbG.js} +1 -1
- package/dist/{dispatcher-DOcaKRSO.js → dispatcher-B3LVp_HG.js} +1 -1
- package/dist/{dispatcher-D4ePtIM5.js → dispatcher-CixO5fFs.js} +1 -1
- package/dist/{dispatcher-C6w4nMdO.js → dispatcher-jdh4erR9.js} +1 -1
- package/dist/domain/git.d.ts +1 -1
- package/dist/domain/git.js +1 -1
- package/dist/domain/interfaces.d.ts +2 -2
- package/dist/domain/types.d.ts +1 -1
- package/dist/domain/validators.d.ts +1 -1
- package/dist/domain/xling/config.d.ts +2 -2
- package/dist/domain/xling/config.js +1 -1
- package/dist/domain/xling/template.d.ts +28 -3
- package/dist/domain/xling/template.js +1 -1
- package/dist/{editor-kAruR--O.js → editor-CRub_kaY.js} +1 -1
- package/dist/engine-fskaJGPP.d.ts +57 -0
- package/dist/errorClassifier-Cvr-_iPQ.js +1 -0
- package/dist/errorClassifier-zGSmZYk7.d.ts +22 -0
- package/dist/fsStore-Dp7kL3Gm.js +1 -0
- package/dist/{gemini-dI69XM9L.js → gemini-DVNV-89A.js} +1 -1
- package/dist/{gemini-C8R4mnaF.js → gemini-Im27-JQu.js} +1 -1
- package/dist/{interfaces-BDGyS5xA.d.ts → interfaces-BELb31PG.d.ts} +1 -1
- package/dist/loadBalancer-DDsh2Xtn.js +1 -0
- package/dist/loadBalancer-OqUfneiH.d.ts +46 -0
- package/dist/logger-DkNeikyB.js +1 -0
- package/dist/{pr-BNSF6xjC.js → pr-YuVCqLA5.js} +1 -1
- package/dist/{providerRegistry-DpaJ70yJ.d.ts → providerRegistry-B09S7PrT.d.ts} +1 -1
- package/dist/providerRegistry-DrzY3JDw.js +1 -0
- package/dist/router-BS0zXgkv.js +6 -0
- package/dist/{router-Ch4ucd37.d.ts → router-DEd1ltJB.d.ts} +3 -3
- package/dist/{runner-BKtr_kIB.js → runner-ITvpapv-.js} +1 -1
- package/dist/runner-hq-k7-9Y.js +53 -0
- package/dist/server--SAoX5aU.js +1 -0
- package/dist/server-Byz1RwvS.d.ts +10 -0
- package/dist/server-Dhpqbbu7.js +1 -0
- package/dist/services/council/runner.d.ts +106 -0
- package/dist/services/council/runner.js +1 -0
- package/dist/services/discuss/engine.d.ts +5 -59
- package/dist/services/discuss/engine.js +1 -1
- package/dist/services/discuss/room.d.ts +4 -4
- package/dist/services/discuss/server.js +1 -1
- package/dist/services/git/create.d.ts +1 -1
- package/dist/services/git/create.js +1 -1
- package/dist/services/git/dispatcher.d.ts +1 -1
- package/dist/services/git/dispatcher.js +1 -1
- package/dist/services/git/pr.d.ts +1 -1
- package/dist/services/git/pr.js +1 -1
- package/dist/services/git/utils.js +1 -1
- package/dist/services/git/view.d.ts +1 -1
- package/dist/services/git/view.js +1 -1
- package/dist/services/git/worktree.d.ts +1 -1
- package/dist/services/git/worktree.js +1 -1
- package/dist/services/launch/adapters/base.d.ts +3 -3
- package/dist/services/launch/adapters/base.js +1 -1
- package/dist/services/launch/adapters/claude.d.ts +3 -3
- package/dist/services/launch/adapters/claude.js +1 -1
- package/dist/services/launch/adapters/codex.d.ts +3 -3
- package/dist/services/launch/adapters/codex.js +1 -1
- package/dist/services/launch/adapters/gemini.d.ts +3 -3
- package/dist/services/launch/adapters/gemini.js +1 -1
- package/dist/services/launch/dispatcher.d.ts +2 -2
- package/dist/services/launch/dispatcher.js +1 -1
- package/dist/services/prompt/client.d.ts +2 -2
- package/dist/services/prompt/client.js +1 -1
- package/dist/services/prompt/providerRegistry.d.ts +2 -2
- package/dist/services/prompt/providerRegistry.js +1 -1
- package/dist/services/prompt/router.d.ts +4 -4
- package/dist/services/prompt/router.js +1 -1
- package/dist/services/prompt/types.d.ts +1 -1
- package/dist/services/prompt/types.js +1 -1
- package/dist/services/proxy/errorClassifier.d.ts +4 -0
- package/dist/services/proxy/errorClassifier.js +1 -0
- package/dist/services/proxy/index.d.ts +6 -0
- package/dist/services/proxy/index.js +1 -0
- package/dist/services/proxy/loadBalancer.d.ts +4 -0
- package/dist/services/proxy/loadBalancer.js +1 -0
- package/dist/services/proxy/server.d.ts +4 -0
- package/dist/services/proxy/server.js +1 -0
- package/dist/services/proxy/transformer.d.ts +219 -0
- package/dist/services/proxy/transformer.js +1 -0
- package/dist/services/proxy/types.d.ts +3 -0
- package/dist/services/proxy/types.js +1 -0
- package/dist/services/settings/adapters/base.d.ts +3 -3
- package/dist/services/settings/adapters/base.js +1 -1
- package/dist/services/settings/adapters/claude.d.ts +3 -3
- package/dist/services/settings/adapters/claude.js +1 -1
- package/dist/services/settings/adapters/codex.d.ts +30 -5
- package/dist/services/settings/adapters/codex.js +1 -1
- package/dist/services/settings/adapters/gemini.d.ts +3 -3
- package/dist/services/settings/adapters/gemini.js +1 -1
- package/dist/services/settings/adapters/xling.d.ts +4 -4
- package/dist/services/settings/adapters/xling.js +1 -1
- package/dist/services/settings/dispatcher.d.ts +2 -2
- package/dist/services/settings/dispatcher.js +1 -1
- package/dist/services/settings/fsStore.d.ts +22 -2
- package/dist/services/settings/fsStore.js +1 -1
- package/dist/services/settings/templates/claudeDefault.d.ts +1 -1
- package/dist/services/settings/templates/claudeDefault.js +1 -1
- package/dist/services/shortcuts/runner.d.ts +2 -2
- package/dist/services/shortcuts/runner.js +1 -1
- package/dist/services/shortcuts/types.d.ts +2 -2
- package/dist/services/shortcuts/types.js +1 -1
- package/dist/template-CNWPigzN.js +1 -0
- package/dist/transformer-DedIktrl.js +6 -0
- package/dist/types-C5iSt5QT.d.ts +110 -0
- package/dist/{types-CHmdfik_.d.ts → types-CtryAP4C.d.ts} +1 -1
- package/dist/ui/assets/{StreamdownWrapper-85-DVGAw.js → StreamdownWrapper-GACXJGXU.js} +1 -1
- package/dist/ui/assets/index-Do9ZHsY_.js +28 -0
- package/dist/ui/assets/index-dfO7UXF4.css +1 -0
- package/dist/ui/assets/vendor-react-OvXVS5lI.js +1 -0
- package/dist/ui/assets/vendor-ui-bs9CQPvP.js +45 -0
- package/dist/ui/index.html +4 -4
- package/dist/utils/editor.js +1 -1
- package/dist/utils/errors.js +1 -1
- package/dist/utils/format.d.ts +1 -1
- package/dist/utils/format.js +1 -1
- package/dist/utils/logger.js +1 -1
- package/dist/utils/runner.d.ts +1 -1
- package/dist/utils/runner.js +1 -1
- package/dist/{utils-fZFbegTi.js → utils-BTx8InlR.js} +1 -1
- package/dist/{view-B-KUlkOE.js → view-Oc9e1Buj.js} +1 -1
- package/dist/{worktree-kPFmGS4M.js → worktree-CMlUbATz.js} +3 -3
- package/dist/xling-D8au8ueX.js +1 -0
- package/package.json +5 -6
- package/dist/base-DwIM_KEe.js +0 -1
- package/dist/claude-3dBll5Qj.js +0 -1
- package/dist/claude-r_OBLpie.js +0 -1
- package/dist/codex-DU9NPJ_R.js +0 -1
- package/dist/config-Dli09U5D.d.ts +0 -137
- package/dist/config-wBxWk9IE.js +0 -1
- package/dist/fsStore-C7lDKAi8.js +0 -1
- package/dist/providerRegistry-EcwOdkyC.js +0 -1
- package/dist/router-CybEHGWG.js +0 -6
- package/dist/server-eKfNqdR2.js +0 -1
- package/dist/template-rBFZDhSo.js +0 -1
- package/dist/ui/assets/index-BobaVxve.css +0 -1
- package/dist/ui/assets/index-DCSNgPGt.js +0 -4
- package/dist/ui/assets/vendor-react-labSKdyf.js +0 -8
- package/dist/ui/assets/vendor-ui-Bgu4xzPa.js +0 -45
- package/dist/xling-DjNCdCxD.js +0 -1
- /package/dist/{claudeDefault-BSADnitS.js → claudeDefault-7I5R7M9m.js} +0 -0
- /package/dist/{client--Ei8JqYq.js → client-B2lwQe9s.js} +0 -0
- /package/dist/{engine-l4DdF1xj.js → engine-BfeqowlE.js} +0 -0
- /package/dist/{errors-BsRYmeoX.js → errors-K31FHK8S.js} +0 -0
- /package/dist/{format-DpZWIKxF.js → format-BHc8ftok.js} +0 -0
- /package/dist/{git-CxRi16Dz.js → git-BuLy4Y64.js} +0 -0
- /package/dist/{git-Cnnbp_zM.d.ts → git-C8c1GrMJ.d.ts} +0 -0
- /package/dist/{runner-Bi0tzEG6.js → runner-BthmKjXb.js} +0 -0
- /package/dist/{types-D-56vF36.js → types-Bj9yrqq6.js} +0 -0
- /package/dist/{types-BcSk48A6.js → types-DX3D0cu3.js} +0 -0
- /package/dist/{types-BJcWKU1M.d.ts → types-K-yZlAsP.d.ts} +0 -0
- /package/dist/{types-D3EhAl-r.d.ts → types-QxjkHQON.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ Together, `xling` is more than just a tool; it's an intelligent partner that amp
|
|
|
27
27
|
- **Unified Interface**: Launch AI CLIs, route prompts, and manage settings with one tool
|
|
28
28
|
- **Prompt Router**: `xling p` fan-outs requests across providers with fallback and streaming support
|
|
29
29
|
- **Multi-Model Roundtable**: `xling discuss` runs multi-agent debates via CLI or Web UI
|
|
30
|
+
- **React 19 Web UI**: `discuss --ui` serves a Vite-built React 19 + Tailwind 4 interface on port 3000
|
|
30
31
|
- **Quick Launcher**: Just type `xling x` to start Claude Code instantly with yolo mode
|
|
31
32
|
- **Command Shortcuts**: Define custom aliases for frequently used commands with `sx`
|
|
32
33
|
- **Multiple Scopes**: Support for user, project, local, and system-level configurations
|
|
@@ -76,6 +77,12 @@ place.
|
|
|
76
77
|
- `git:wta|wtl|wtp|wtr|wts`: Manage git worktrees (add/list/prune/remove/switch) with guard rails and subshell support.
|
|
77
78
|
- `version`: Print the installed xling version.
|
|
78
79
|
|
|
80
|
+
### Web UI (React 19)
|
|
81
|
+
|
|
82
|
+
- `discuss --ui` serves a React 19 + React DOM 19 interface built with Vite 7 and Tailwind CSS 4 from `dist/ui` (port 3000 by default).
|
|
83
|
+
- Build the bundle with `bun run build` (runs `build:ui`) or `bun run build:ui` after frontend changes so the CLI can find `dist/ui`.
|
|
84
|
+
- For live UI development, run `bunx vite dev --config vite.config.ts --host --port 3000` from the repo root; keep the port aligned with the discuss server default.
|
|
85
|
+
|
|
79
86
|
### Command Documentation (inline excerpt)
|
|
80
87
|
|
|
81
88
|
#### Launching AI tools
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./errors-K31FHK8S.js";import{o as t,p as n,s as r,u as i}from"./fsStore-Dp7kL3Gm.js";var a=class{async list(t){if(!this.validateScope(t))throw new e(t);let n=this.resolvePath(t);return{type:`entries`,entries:this.readConfig(n),filePath:n}}async switchProfile(e,t,n){throw Error(`Tool ${this.toolId} does not support profile switching`)}async inspect(n){if(!this.validateScope(n))throw new e(n);let i=this.resolvePath(n);if(!t(i))return{path:i,exists:!1};let a=r(i),o=this.readConfig(i);return{path:i,exists:!0,content:JSON.stringify(o,null,2),size:a?.size,lastModified:a?.lastModified}}async edit(e,t){throw Error(`Tool ${this.toolId} does not support edit for ${e}`)}readConfig(e){return i(e)}writeConfig(e,t,r=!0){n(e,t,r)}};export{a as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as LaunchCommandSpec, g as ToolId } from "./types-
|
|
2
|
-
import { t as LaunchAdapter } from "./interfaces-
|
|
1
|
+
import { a as LaunchCommandSpec, g as ToolId } from "./types-K-yZlAsP.js";
|
|
2
|
+
import { t as LaunchAdapter } from "./interfaces-BELb31PG.js";
|
|
3
3
|
|
|
4
4
|
//#region src/services/launch/adapters/base.d.ts
|
|
5
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./runner-
|
|
1
|
+
import{n as e,t}from"./runner-BthmKjXb.js";var n=class{async validateAvailability(){return t(this.executable)}async getVersion(){try{return await e(this.executable)}catch{return`unknown`}}};export{n as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as SettingsListData, g as ToolId, h as SwitchOptions, i as InspectResult, l as Scope, m as SettingsResult, r as EditOptions, t as ConfigObject } from "./types-
|
|
2
|
-
import { n as SettingsAdapter } from "./interfaces-
|
|
1
|
+
import { f as SettingsListData, g as ToolId, h as SwitchOptions, i as InspectResult, l as Scope, m as SettingsResult, r as EditOptions, t as ConfigObject } from "./types-K-yZlAsP.js";
|
|
2
|
+
import { n as SettingsAdapter } from "./interfaces-BELb31PG.js";
|
|
3
3
|
|
|
4
4
|
//#region src/services/settings/adapters/base.d.ts
|
|
5
5
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e,u as t}from"./errors-K31FHK8S.js";import{n,t as r}from"./editor-CRub_kaY.js";import{t as i}from"./format-BHc8ftok.js";import{a,f as o,p as s,s as c}from"./fsStore-Dp7kL3Gm.js";import{t as l}from"./base-BPSqk5ri.js";import{t as u}from"./claudeDefault-7I5R7M9m.js";import*as d from"node:fs";import*as f from"node:path";var p=class extends l{toolId=`claude`;async list(t){if(!this.validateScope(t))throw new e(t);let n=o(this.resolvePath(t)),r=f.dirname(n),i=f.basename(n),a=[this.#e(n,t,!0)];if(d.existsSync(r)){let e=d.readdirSync(r,{withFileTypes:!0});for(let n of e){if(!n.isFile()||n.name===i||!this.#r(n.name))continue;let e=f.join(r,n.name);a.push(this.#e(e,t,!1))}}return{type:`files`,files:this.#i(a)}}resolvePath(e){switch(e){case`user`:return`~/.claude/settings.json`;case`project`:return`.claude/settings.json`;case`local`:return`.claude/settings.local.json`;default:throw Error(`Unsupported scope for Claude: ${e}`)}}validateScope(e){return[`user`,`project`,`local`].includes(e)}async switchProfile(n,r,a){if(!this.validateScope(n))throw new e(n);let s=r.trim();if(!s)throw Error(`Variant name cannot be empty`);let c=o(this.resolvePath(n)),l=f.dirname(c),u=this.#a(l,s,c);if(!u)throw new t(s);let d=this.readConfig(u),p={};try{p=this.readConfig(c)}catch{p={}}let m=i(p,d);if(a?.preview)return{success:!0,preview:!0,filePath:c,diff:m??void 0,data:{from:u,to:c,hasChanges:!!m},message:m?`Preview generated. Review diff before applying.`:`Current settings already match the selected variant.`};if(!m)return{success:!0,message:`Current settings already match the selected variant.`,filePath:c};let h=a?.backup??!1;return this.writeConfig(c,d,h),{success:!0,message:`Switched to ${f.basename(u)}`,filePath:c,data:{from:u,to:c}}}async edit(t,i){if(!this.validateScope(t))throw new e(t);let c=o(this.resolvePath(t)),l=f.dirname(c),u=i.name?.trim(),p=n(i.ide);a(l);let m=c,h=`default`;if(u&&u!==``&&u!==`default`){let e=this.#a(l,u,c);if(e)m=e;else if(m=f.join(l,`settings.${u}.json`),!d.existsSync(m)){let e=this.#n(c);s(m,e,!1)}h=u}else if(!d.existsSync(m)){let e=this.#n(c);s(m,e,!1)}return await r(p,m),{success:!0,message:`Opened ${h} settings in ${p}`,filePath:m,data:{variant:h,ide:p}}}#e(e,t,n){let r=c(e);return{filename:f.basename(e),variant:this.#t(e),path:e,scope:t,active:n,exists:!!r,size:r?.size,lastModified:r?.lastModified}}#t(e){let t=f.basename(e),n=t.match(/^settings(?:[._-](.+))?\.json$/);return n?n[1]??`default`:t.replace(/\.json$/,``)}#n(e){try{if(d.existsSync(e)){let t=d.readFileSync(e,`utf-8`);return JSON.parse(t)}}catch{}return{...u}}#r(e){return/^settings[._-].+\.json$/.test(e)}#i(e){return e.sort((e,t)=>e.active&&!t.active?-1:!e.active&&t.active?1:e.variant.localeCompare(t.variant))}#a(e,t,n){let r=[],i=e=>{r.includes(e)||r.push(e)};t===`default`&&i(n),t.endsWith(`.json`)?i(f.isAbsolute(t)?t:f.join(e,t)):(i(f.join(e,`settings.${t}.json`)),i(f.join(e,`settings-${t}.json`)),i(f.join(e,`settings_${t}.json`)));for(let e of r)if(d.existsSync(e))return e;return null}};export{p as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./base-DTfJeAL2.js";import*as t from"node:fs";import*as n from"node:path";import*as r from"node:os";var i=class extends e{toolId=`claude`;executable=`claude`;buildCommandSpec(e){let t=[];if(e.continue?t.push(`-c`):e.resume&&t.push(`-r`),e.settings){let n=this.#e(e.settings);t.push(`--settings`,n)}return{executable:this.executable,baseArgs:t,yoloArgs:e.yolo?[`--dangerously-skip-permissions`]:void 0}}#e(e){if(e.trim().startsWith(`{`)||n.isAbsolute(e)||e.endsWith(`.json`))return e;let i=n.join(r.homedir(),`.claude`),a=n.join(i,`settings.${e}.json`);if(t.existsSync(a))return a;let o=n.join(i,`settings-${e}.json`);return t.existsSync(o)?o:a}};export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./base-
|
|
1
|
+
import{t as e}from"./base-DTfJeAL2.js";var t=class extends e{toolId=`codex`;executable=`codex`;buildCommandSpec(e){let t=[];if(e.settings){let n=this.#e(e.settings);t.push(...n)}return e.continue?t.push(`resume`,`--last`):e.resume&&t.push(`resume`),{executable:this.executable,baseArgs:t,yoloArgs:e.yolo?[`--dangerously-bypass-approvals-and-sandbox`]:void 0}}#e(e){let t=[];if(e.includes(`=`)){let n=e.split(`;`).map(e=>e.trim());for(let e of n)e&&t.push(`-c`,e)}else t.push(`-c`,`model=${e}`);return t}};export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./errors-K31FHK8S.js";import{a as t,c as n,d as r,f as i,m as a,o,r as s,t as c}from"./fsStore-Dp7kL3Gm.js";import{t as l}from"./base-BPSqk5ri.js";const u=`~/.codex/auth-profiles`,d=`~/.codex/auth.json`;var f=class extends l{toolId=`codex`;async list(t){if(!this.validateScope(t))throw new e(t);let n=this.resolvePath(t),r=this.readConfig(n);return{type:`entries`,entries:this.#n(r),filePath:n}}resolvePath(e){switch(e){case`user`:return`~/.codex/config.toml`;default:throw Error(`Unsupported scope for Codex: ${e}`)}}validateScope(e){return e===`user`}async switchProfile(t,n,r){if(!this.validateScope(t))throw new e(t);return this.isAuthProfile(n)?this.#e(n):this.#t(t,n)}listAuthProfiles(){return n(u).filter(e=>e.endsWith(`.json`)).map(e=>e.replace(`.json`,``))}isAuthProfile(e){return o(`${u}/${e}.json`)}saveAuthProfile(e,n=!1){let r=`${u}/${e}.json`;return o(d)?!n&&o(r)?{success:!1,message:`Profile "${e}" already exists. Use --force to overwrite.`}:(t(u),c(d,r),s(d),{success:!0,message:`Saved current auth as profile: ${e}\nauth.json has been removed. You can now login with another account.`,filePath:i(r)}):{success:!1,message:`No auth.json found. Please run 'codex login' first.`}}deleteAuthProfile(e){let t=`${u}/${e}.json`;return o(t)?(s(t),{success:!0,message:`Deleted auth profile: ${e}`}):{success:!1,message:`Auth profile "${e}" not found.`}}getAllSwitchableProfiles(e){let t=this.resolvePath(e),n=[];try{let e=this.readConfig(t),r=e.model_providers;p(r)&&(n=Object.keys(r));let i=e.profiles;p(i)&&(n=[...new Set([...n,...Object.keys(i)])])}catch{}let r=this.listAuthProfiles();return{providers:n,authProfiles:r}}#e(e){let t=`${u}/${e}.json`,n=`~/.codex/config.toml`;if(!o(t))return{success:!1,message:`Auth profile "${e}" not found.`};c(t,d);try{let e=this.readConfig(n);e.model_provider&&(delete e.model_provider,this.writeConfig(n,e))}catch{}return{success:!0,message:`Switched to auth profile: ${e}`,filePath:i(d)}}#t(e,t){let n=this.resolvePath(e);o(d)&&s(d);let r=this.readConfig(n),a=r.profiles,c=(p(a)?a:void 0)?.[t];if(p(c)){let e={...r};for(let[t,n]of Object.entries(c))e[t]=n;return e.current_profile=t,this.writeConfig(n,e),{success:!0,message:`Switched to profile: ${t}`,filePath:i(n)}}let l={...r,model_provider:t};return this.writeConfig(n,l),{success:!0,message:`Switched to provider: ${t}`,filePath:i(n)}}readConfig(e){return r(e)}writeConfig(e,t){a(e,t,!1)}#n(e){let t=e.model_providers;return p(t)?t:{}}};const p=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof Date);export{p as n,f as t};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command, Interfaces } from "@oclif/core";
|
|
2
|
+
|
|
3
|
+
//#region src/commands/council/index.d.ts
|
|
4
|
+
declare class CouncilCommand extends Command {
|
|
5
|
+
#private;
|
|
6
|
+
static summary: string;
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: Command.Example[];
|
|
9
|
+
static flags: Interfaces.FlagInput;
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { CouncilCommand as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import"../../errors-K31FHK8S.js";import"../../editor-CRub_kaY.js";import"../../logger-DkNeikyB.js";import{t as e}from"../../runner-hq-k7-9Y.js";import"../../fsStore-Dp7kL3Gm.js";import"../../base-BPSqk5ri.js";import"../../config-bqLy-CvP.js";import"../../template-CNWPigzN.js";import"../../xling-D8au8ueX.js";import"../../providerRegistry-DrzY3JDw.js";import"../../client-B2lwQe9s.js";import"../../types-Bj9yrqq6.js";import{n as t}from"../../router-BS0zXgkv.js";import{t as n}from"../../server--SAoX5aU.js";import"../../engine-BfeqowlE.js";import{Command as r,Flags as i}from"@oclif/core";import*as a from"node:readline";import*as o from"open";var s=class s extends r{static summary=`Ask multiple models the same question, have them judge peers, and pick the winner.`;static description=`Run a council: collect answers, cross-judge anonymously, and synthesize the best response.`;static examples=[{description:`CLI mode with explicit models`,command:`<%= config.bin %> <%= command.id %> --question "How to cache HTTP responses?" --models "gpt-4o,claude-3.5-sonnet"`},{description:`Provide separate judge set and final model`,command:`<%= config.bin %> <%= command.id %> --question "PostgreSQL tuning" --models "gpt-4o,claude-3.5-sonnet" --judges "gemini-2.0-pro-exp,claude-3.5-sonnet" --final-model "gpt-4o"`},{description:`Launch the Web UI`,command:`<%= config.bin %> <%= command.id %> --ui`}];static flags={ui:i.boolean({description:`Launch Web UI for council mode`,default:!1}),question:i.string({char:`q`,description:`Question to ask every model`}),models:i.string({char:`m`,description:`Comma-separated list of models to answer`}),judges:i.string({char:`j`,description:`Comma-separated list of judge models (defaults to models)`}),"final-model":i.string({description:`Model used to write the final synthesis (defaults to first judge)`}),json:i.boolean({description:`Print full JSON result`,default:!1})};async run(){let{flags:n}=await this.parse(s);if(n.ui){await this.#e();return}let r=n.question??await this.#n(`Question: `),i=c(n.models);i.length<2&&this.error(`Provide at least two models via --models`);let a=c(n.judges),o=n[`final-model`],l=await e(await t(),{question:r,models:i,judgeModels:a.length>0?a:void 0,finalModel:o});if(n.json){this.log(JSON.stringify(l,null,2));return}this.#t(l)}async#e(){this.log(`Starting Web UI...`);let e=3e3,t=(await n(e)).address(),r=`http://localhost:${typeof t==`object`&&t?t.port:e}`;return this.log(`Server running at ${r}`),await o.default(r),this.log(`Press Ctrl+C to stop`),new Promise(()=>{})}#t(e){this.log(`\nQuestion: ${e.question}`),this.log(`
|
|
2
|
+
Stage 1: Candidate responses`),e.stage1.forEach(e=>{this.log(`- ${e.label} (${e.model})`),this.log(l(e.content))}),e.aggregates.length>0&&(this.log(`
|
|
3
|
+
Leaderboard:`),e.aggregates.forEach((e,t)=>{this.log(`${t+1}. ${e.label} (${e.model}) — avg ${e.average} from ${e.votes} votes`)})),e.final&&this.log(`\nFinal (${e.final.model}):\n${l(e.final.content)}`)}async#n(e){let t=a.createInterface({input:process.stdin,output:process.stdout});return new Promise(n=>{t.question(e,e=>{t.close(),n(e.trim())})})}};function c(e){return e?e.split(`,`).map(e=>e.trim()).filter(Boolean):[]}function l(e){return e.split(`
|
|
4
|
+
`).map(e=>` ${e}`).join(`
|
|
5
|
+
`)}export{s as default};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import"../../errors-
|
|
1
|
+
import"../../errors-K31FHK8S.js";import"../../editor-CRub_kaY.js";import"../../logger-DkNeikyB.js";import"../../runner-hq-k7-9Y.js";import"../../fsStore-Dp7kL3Gm.js";import"../../base-BPSqk5ri.js";import"../../config-bqLy-CvP.js";import"../../template-CNWPigzN.js";import"../../xling-D8au8ueX.js";import"../../providerRegistry-DrzY3JDw.js";import"../../client-B2lwQe9s.js";import"../../types-Bj9yrqq6.js";import{n as e}from"../../router-BS0zXgkv.js";import{t}from"../../server--SAoX5aU.js";import{t as n}from"../../engine-BfeqowlE.js";import{Command as r,Flags as i}from"@oclif/core";import*as a from"node:readline";import*as o from"open";var s=class s extends r{static summary=`Run a roundtable between multiple AI models via CLI or Web UI`;static description=`Start a discussion between multiple AI models`;static examples=[{description:`CLI mode, pick topic/models interactively`,command:`<%= config.bin %> <%= command.id %>`},{description:`Provide topic and models up front (comma-separated)`,command:`<%= config.bin %> <%= command.id %> --topic "Rust vs Go" --models "gpt-4o,claude-3.5-sonnet"`},{description:`Round-robin turns with shorter per-turn timeout`,command:`<%= config.bin %> <%= command.id %> --strategy round-robin --timeout 10`},{description:`Launch the web UI`,command:`<%= config.bin %> <%= command.id %> --ui`}];static flags={ui:i.boolean({description:`Launch Web UI`,default:!1}),topic:i.string({char:`t`,description:`Topic to discuss`}),models:i.string({char:`m`,description:`Comma-separated list of models to participate`}),strategy:i.string({char:`s`,description:`Turn-taking strategy (random, round-robin)`,options:[`random`,`round-robin`],default:`random`}),timeout:i.integer({description:`Timeout per turn in seconds`,default:30})};async run(){let{flags:e}=await this.parse(s);e.ui?await this.#e():await this.#t(e)}async#e(){this.log(`Starting Web UI...`);let e=3e3,n=(await t(e)).address(),r=`http://localhost:${typeof n==`object`&&n?n.port:e}`;return this.log(`Server running at ${r}`),await o.default(r),this.log(`Press Ctrl+C to stop`),new Promise(()=>{})}async#t(t){let r=await e(),i=r.getRegistry().getAllModels(),o=t.topic,s=t.models?t.models.split(`,`):[];o||=await this.#n(`Enter topic: `),s.length===0&&(s=await this.#r(i)),s.length<2&&this.error(`At least 2 models are required for a discussion.`);let c=new n(r,{topic:o,strategy:t.strategy,timeoutMs:t.timeout*1e3});return s.forEach((e,t)=>{c.addParticipant({id:`model-${t}`,name:e,model:e,type:`ai`})}),c.addParticipant({id:`user`,name:`User`,type:`human`}),this.log(`\nStarting discussion on "${o}" with: ${s.join(`, `)}\n`),this.log(`Controls:`),this.log(` [Space] Pause/Resume`),this.log(` [m] Toggle Auto/Manual Mode`),this.log(` [n] Next Turn (Manual Mode)`),this.log(` [i] Interrupt / Speak`),this.log(` [s] Summarize & Stop`),this.log(` [q] Quit`),this.log(`
|
|
2
2
|
--------------------------------------------------
|
|
3
|
-
`),c.on(`turn-start`,e=>{let t=c.participants.find(t=>t.id===e);process.stdout.write(`\n\n[${t?.name}]: `)}),c.on(`message-chunk`,({delta:e})=>{process.stdout.write(e)}),c.on(`error`,({participantId:e,error:t})=>{let n=c.participants.find(t=>t.id===e);console.error(`\n[Error] ${n?.name}: ${t.message}`)}),c.on(`participant-dropped`,e=>{let t=c.participants.find(t=>t.id===e);console.error(`\n[System] ${t?.name} has left the chat (too many errors).`)}),c.start(),
|
|
3
|
+
`),c.on(`turn-start`,e=>{let t=c.participants.find(t=>t.id===e);process.stdout.write(`\n\n[${t?.name}]: `)}),c.on(`message-chunk`,({delta:e})=>{process.stdout.write(e)}),c.on(`error`,({participantId:e,error:t})=>{let n=c.participants.find(t=>t.id===e);console.error(`\n[Error] ${n?.name}: ${t.message}`)}),c.on(`participant-dropped`,e=>{let t=c.participants.find(t=>t.id===e);console.error(`\n[System] ${t?.name} has left the chat (too many errors).`)}),c.start(),a.emitKeypressEvents(process.stdin),process.stdin.isTTY&&(process.stdin.setRawMode(!0),process.stdin.resume()),process.on(`SIGINT`,()=>{c.stop(),process.exit()}),process.stdin.on(`keypress`,(e,t)=>{(async()=>{if(t.ctrl&&t.name===`c`&&process.exit(),t.name===`q`&&(c.stop(),process.exit()),t.name===`space`&&(c.status===`paused`?c.resume():c.pause(),this.log(`\n[System] Discussion ${c.status}`)),t.name===`m`){let e=c.mode===`auto`?`manual`:`auto`;c.setMode(e),this.log(`\n[System] Mode switched to ${e.toUpperCase()}`)}if(t.name===`n`)if(c.mode===`manual`){if(c.status===`discussing`||c.status===`paused`){let e=c.participants.filter(e=>e.type===`ai`),t=e[Math.floor(Math.random()*e.length)];c.setNextSpeaker(t.id)}}else this.log(`
|
|
4
4
|
[System] Switch to Manual mode [m] to use Next [n]`);if(t.name===`i`){c.pause(),process.stdin.setRawMode(!1),process.stdout.write(`
|
|
5
|
-
[User]: `);let e=
|
|
6
|
-
Select summarizer:`),e.forEach((e,t)=>this.log(`${t+1}. ${e.name}`));let t=
|
|
5
|
+
[User]: `);let e=a.createInterface({input:process.stdin,output:process.stdout});e.question(``,t=>{e.close(),t.trim()&&c.injectMessage(`user`,t),process.stdin.setRawMode(!0),c.resume()})}if(t.name===`s`){c.pause(),process.stdin.setRawMode(!1);let e=c.participants.filter(e=>e.type===`ai`);this.log(`
|
|
6
|
+
Select summarizer:`),e.forEach((e,t)=>this.log(`${t+1}. ${e.name}`));let t=a.createInterface({input:process.stdin,output:process.stdout});t.question(`Choice: `,n=>{(async()=>{t.close();let r=e[parseInt(n)-1];if(r){this.log(`\nGenerating summary with ${r.name}...\n`);try{let e=await c.generateSummary(r.id);this.log(`
|
|
7
7
|
=== SUMMARY ===
|
|
8
8
|
`),this.log(e),this.log(`
|
|
9
9
|
===============
|
|
10
|
-
`)}catch(e){this.log(`Error: ${e.message}`)}}process.exit()})()})}})()}),new Promise(()=>{})}async#n(e){let t=
|
|
11
|
-
`),e?i(e):r(a)},f=()=>{n.moveCursor(0,-c),n.clearScreenDown();let t=[`Select models (space = toggle, arrows = navigate, enter = confirm, q/Ctrl+C = cancel)`,``,...e.map((e,t)=>{let n=t===s,r=
|
|
10
|
+
`)}catch(e){this.log(`Error: ${e.message}`)}}process.exit()})()})}})()}),new Promise(()=>{})}async#n(e){let t=a.createInterface({input:process.stdin,output:process.stdout});return new Promise(n=>{t.question(e,e=>{t.close(),n(e)})})}async#r(e){if(e.length===0)return[];let t=process.stdin,n=process.stdout;if(!t.isTTY||!n.isTTY)throw Error(`Interactive selection requires a TTY. Use --models to provide values directly.`);return new Promise((r,i)=>{let o=new Set,s=0,c=0,l=``,u=!!t.isRaw,d=(e,a)=>{t.off(`keypress`,p),t.setRawMode&&t.setRawMode(u),t.pause(),n.write(`\x1B[?25h
|
|
11
|
+
`),e?i(e):r(a)},f=()=>{n.moveCursor(0,-c),n.clearScreenDown();let t=[`Select models (space = toggle, arrows = navigate, enter = confirm, q/Ctrl+C = cancel)`,``,...e.map((e,t)=>{let n=t===s,r=o.has(t),i=`${n?`➜`:` `} ${r?`[x]`:`[ ]`} ${e}`;return n?`\x1B[36m${i}\x1B[0m`:i}),``,`Selected: ${Array.from(o).map(t=>e[t]).join(`, `)||`none`}`];l&&t.push(`\x1B[33m${l}\x1B[0m`),n.write(t.join(`
|
|
12
12
|
`)+`
|
|
13
|
-
`),c=t.length,l=``},p=(t,n)=>{if(n){if(n.name===`c`&&n.ctrl||n.name===`q`){d(Error(`Selection cancelled.`));return}if(n.name===`up`){s=(s-1+e.length)%e.length,f();return}if(n.name===`down`){s=(s+1)%e.length,f();return}if(n.name===`space`){
|
|
13
|
+
`),c=t.length,l=``},p=(t,n)=>{if(n){if(n.name===`c`&&n.ctrl||n.name===`q`){d(Error(`Selection cancelled.`));return}if(n.name===`up`){s=(s-1+e.length)%e.length,f();return}if(n.name===`down`){s=(s+1)%e.length,f();return}if(n.name===`space`){o.has(s)?o.delete(s):o.add(s),f();return}if(n.name===`return`){if(o.size<2){l=`Select at least two models.`,f();return}d(void 0,Array.from(o).map(t=>e[t]))}}};a.emitKeypressEvents(t),t.resume(),t.setRawMode&&t.setRawMode(!0),n.write(`\x1B[?25l`),f(),t.on(`keypress`,p)})}};export{s as default};
|
package/dist/commands/git/prc.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"../../git-
|
|
1
|
+
import{t as e}from"../../git-BuLy4Y64.js";import"../../errors-K31FHK8S.js";import"../../runner-BthmKjXb.js";import"../../utils-BTx8InlR.js";import"../../pr-YuVCqLA5.js";import"../../view-Oc9e1Buj.js";import"../../worktree-CMlUbATz.js";import"../../create-CSR6dBbG.js";import{t}from"../../dispatcher-CixO5fFs.js";import{Command as n,Flags as r}from"@oclif/core";var i=class i extends n{static summary=`Create a pull request (PR Create)`;static description=`
|
|
2
2
|
Create a pull request using GitHub CLI.
|
|
3
3
|
Supports automatic browser preview with customizable browser selection.
|
|
4
4
|
`;static examples=[{description:`Create PR interactively`,command:`<%= config.bin %> <%= command.id %>`},{description:`Create PR with title and body`,command:`<%= config.bin %> <%= command.id %> --title "Feature X" --body "Implements feature X"`},{description:`Create PR and open in browser`,command:`<%= config.bin %> <%= command.id %> --web`},{description:`Create PR and preview in Safari`,command:`<%= config.bin %> <%= command.id %> --web --browser safari`},{description:`Create draft PR`,command:`<%= config.bin %> <%= command.id %> --draft --title "WIP: Feature X"`},{description:`Create PR with reviewers and labels`,command:`<%= config.bin %> <%= command.id %> --reviewer user1 --reviewer user2 --label bug --label urgent`}];static flags={title:r.string({char:`t`,description:`PR title`}),body:r.string({char:`b`,description:`PR body/description`}),base:r.string({description:`Base branch (default: repository default branch)`}),head:r.string({description:`Head branch (default: current branch)`}),draft:r.boolean({char:`d`,description:`Create as draft PR`,default:!1}),web:r.boolean({char:`w`,description:`Open PR in browser after creation`,default:!1}),browser:r.string({description:`Browser to use when --web is enabled`,options:[...e],default:`chrome`}),assignee:r.string({char:`a`,description:`Assign user(s) (can be used multiple times)`,multiple:!0}),reviewer:r.string({char:`r`,description:`Request reviewer(s) (can be used multiple times)`,multiple:!0}),label:r.string({char:`l`,description:`Add label(s) (can be used multiple times)`,multiple:!0})};async run(){let{flags:e}=await this.parse(i),n=new t,r={title:e.title,body:e.body,base:e.base,head:e.head,draft:e.draft,web:e.web,browser:e.browser,assignee:e.assignee,reviewer:e.reviewer,label:e.label};try{let e=await n.execute({command:`prc`,cwd:process.cwd(),data:r});this.log(`✓ ${e.message}`),e.details?.draft&&this.log(` Type: Draft PR`),e.details?.base&&this.log(` Base: ${e.details.base}`),e.details?.head&&this.log(` Head: ${e.details.head}`)}catch(e){this.error(e.message,{exit:1})}}};export{i as default};
|
package/dist/commands/git/prr.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../errors-
|
|
1
|
+
import"../../errors-K31FHK8S.js";import"../../runner-BthmKjXb.js";import"../../utils-BTx8InlR.js";import"../../pr-YuVCqLA5.js";import"../../view-Oc9e1Buj.js";import"../../worktree-CMlUbATz.js";import"../../create-CSR6dBbG.js";import{t as e}from"../../dispatcher-CixO5fFs.js";import{Args as t,Command as n,Flags as r}from"@oclif/core";var i=class i extends n{static summary=`Checkout a PR branch (PR Read/Retrieve)`;static description=`
|
|
2
2
|
Checkout a pull request branch using GitHub CLI (gh) or git fallback.
|
|
3
3
|
Automatically detects gh availability and falls back to git fetch if needed.
|
|
4
4
|
`;static examples=[{description:`Checkout PR using gh or git fallback`,command:`<%= config.bin %> <%= command.id %> 123`},{description:`Checkout PR to specific branch`,command:`<%= config.bin %> <%= command.id %> 456 --branch my-pr-branch`},{description:`Force git fallback with custom remote`,command:`<%= config.bin %> <%= command.id %> 789 --no-gh --remote upstream`},{description:`Checkout a PR from another repo (owner:repo#id)`,command:`<%= config.bin %> <%= command.id %> octo/demo-repo#321 --branch demo-pr`}];static args={id:t.string({description:`PR number or owner:repo#123 format`,required:!0})};static flags={branch:r.string({char:`b`,description:`Branch name (default: pr/<id>)`}),remote:r.string({char:`r`,description:`Remote name`,default:`origin`}),"no-gh":r.boolean({description:`Skip GitHub CLI, use git directly`,default:!1})};async run(){let{args:t,flags:n}=await this.parse(i),r=new e,a={id:t.id,branch:n.branch,strategy:n[`no-gh`]?`git`:`gh`,remote:n.remote};try{let e=await r.execute({command:`prr`,cwd:process.cwd(),data:a});this.log(`✓ ${e.message}`),e.details&&(this.log(` Strategy: ${e.details.strategy}`),this.log(` Branch: ${e.details.branch}`))}catch(e){this.error(e.message,{exit:1})}}};export{i as default};
|
package/dist/commands/git/prv.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"../../git-
|
|
1
|
+
import{t as e}from"../../git-BuLy4Y64.js";import"../../errors-K31FHK8S.js";import"../../runner-BthmKjXb.js";import"../../utils-BTx8InlR.js";import"../../pr-YuVCqLA5.js";import"../../view-Oc9e1Buj.js";import"../../worktree-CMlUbATz.js";import"../../create-CSR6dBbG.js";import{t}from"../../dispatcher-CixO5fFs.js";import{Args as n,Command as r,Flags as i}from"@oclif/core";var a=class a extends r{static summary=`Open PR in web browser (PR View)`;static description=`
|
|
2
2
|
Open a pull request in your web browser using GitHub CLI.
|
|
3
3
|
Supports multiple browsers: Chrome (default), Safari, Firefox, Arc, Edge, Dia.
|
|
4
4
|
`;static examples=[{description:`Open PR in Chrome (default)`,command:`<%= config.bin %> <%= command.id %> 123`},{description:`Open PR in Safari`,command:`<%= config.bin %> <%= command.id %> 456 --browser safari`},{description:`Open PR in Firefox`,command:`<%= config.bin %> <%= command.id %> 789 --browser firefox`},{description:`Open PR in Arc`,command:`<%= config.bin %> <%= command.id %> 999 --browser arc`},{description:`Open a PR from another repo in Edge`,command:`<%= config.bin %> <%= command.id %> octo/demo-repo#42 --browser edge`}];static args={id:n.string({description:`PR number`,required:!0})};static flags={browser:i.string({char:`b`,description:`Browser to use`,options:[...e],default:`chrome`})};async run(){let{args:e,flags:n}=await this.parse(a),r=new t,i={id:e.id,browser:n.browser};try{let e=await r.execute({command:`prv`,cwd:process.cwd(),data:i});this.log(`✓ ${e.message}`)}catch(e){this.error(e.message,{exit:1})}}};export{a as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../errors-
|
|
1
|
+
import"../../errors-K31FHK8S.js";import"../../runner-BthmKjXb.js";import"../../utils-BTx8InlR.js";import"../../pr-YuVCqLA5.js";import"../../view-Oc9e1Buj.js";import"../../worktree-CMlUbATz.js";import"../../create-CSR6dBbG.js";import{t as e}from"../../dispatcher-CixO5fFs.js";import{Command as t,Flags as n}from"@oclif/core";var r=class r extends t{static summary=`Manage git worktrees`;static description=`
|
|
2
2
|
Manage git worktrees: list existing worktrees, add new ones, remove, or prune stale entries.
|
|
3
3
|
Git worktrees allow multiple working directories from a single repository.
|
|
4
4
|
`;static examples=[{description:`List all worktrees in friendly format`,command:`<%= config.bin %> <%= command.id %> --list`},{description:`Add new worktree with auto-generated path`,command:`<%= config.bin %> <%= command.id %> --add --branch feature/login`},{description:`Add worktree with custom path`,command:`<%= config.bin %> <%= command.id %> -a -p ../repo-feature -b feature/login`},{description:`Switch to main worktree (outputs path for cd)`,command:`cd $(<%= config.bin %> <%= command.id %> -s)`},{description:`Switch to specific worktree by branch name`,command:`cd $(<%= config.bin %> <%= command.id %> -s -b feature/login)`},{description:`Remove worktree by branch name`,command:`<%= config.bin %> <%= command.id %> -r -b main`},{description:`Remove worktree by directory name`,command:`<%= config.bin %> <%= command.id %> -r -b xling-feature`},{description:`Remove worktree by path`,command:`<%= config.bin %> <%= command.id %> -r -p ../repo-feature`},{description:`Prune stale worktrees`,command:`<%= config.bin %> <%= command.id %> --prune`}];static flags={list:n.boolean({char:`l`,description:`List worktrees (default)`,default:!1}),add:n.boolean({char:`a`,description:`Add new worktree (auto-generates path if not specified)`,default:!1}),switch:n.boolean({char:`s`,description:`Get worktree path (outputs path only, use with: cd $(xling git:worktree -s -b <branch>))`,default:!1}),remove:n.boolean({char:`r`,description:`Remove worktree`,default:!1}),prune:n.boolean({description:`Prune stale worktrees`,default:!1}),path:n.string({char:`p`,description:`Worktree path (e.g., '../repo-feature' or absolute path). Auto-generated if not specified with --add.`}),branch:n.string({char:`b`,description:`Branch or worktree name. Defaults to main for --add and --switch. For --remove, intelligently matches branch or directory name.`}),force:n.boolean({char:`f`,description:`Force operation`,default:!1}),detach:n.boolean({description:`Detach HEAD in new worktree`,default:!1})};async run(){let{flags:t}=await this.parse(r),n=`list`;t.add?n=`add`:t.switch?n=`switch`:t.remove?n=`remove`:t.prune&&(n=`prune`);let i=new e,a={action:n,path:t.path,branch:t.branch,force:t.force,detach:t.detach};try{let e=await i.execute({command:`worktree`,cwd:process.cwd(),data:a});if(n===`switch`){this.log(e.message);return}this.log(`✓ ${e.message}`),e.details?.output&&this.log(`
|
package/dist/commands/git/wta.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../errors-
|
|
1
|
+
import"../../errors-K31FHK8S.js";import"../../runner-BthmKjXb.js";import"../../utils-BTx8InlR.js";import"../../pr-YuVCqLA5.js";import"../../view-Oc9e1Buj.js";import"../../worktree-CMlUbATz.js";import"../../create-CSR6dBbG.js";import{t as e}from"../../dispatcher-CixO5fFs.js";import{Command as t,Flags as n}from"@oclif/core";var r=class r extends t{static summary=`Add a new git worktree`;static description=`
|
|
2
2
|
Create a new git worktree with automatic path generation.
|
|
3
3
|
Defaults to main branch if not specified.
|
|
4
4
|
Use --select to choose a branch from an interactive list.
|
package/dist/commands/git/wtl.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../errors-
|
|
1
|
+
import"../../errors-K31FHK8S.js";import"../../runner-BthmKjXb.js";import"../../utils-BTx8InlR.js";import"../../pr-YuVCqLA5.js";import"../../view-Oc9e1Buj.js";import"../../worktree-CMlUbATz.js";import"../../create-CSR6dBbG.js";import{t as e}from"../../dispatcher-CixO5fFs.js";import{Command as t}from"@oclif/core";var n=class extends t{static summary=`List git worktrees`;static description=`
|
|
2
2
|
List all git worktrees in a friendly format.
|
|
3
3
|
Shows the path and branch for each worktree.
|
|
4
4
|
`;static examples=[{description:`List all worktrees`,command:`<%= config.bin %> <%= command.id %>`},{description:`List worktrees and filter for feature branches`,command:`<%= config.bin %> <%= command.id %> | grep feature/`},{description:`List worktrees from another repo directory`,command:`cd ~/projects/my-repo && <%= config.bin %> <%= command.id %>`}];async run(){let t=new e,n={action:`list`};try{let e=await t.execute({command:`worktree`,cwd:process.cwd(),data:n});this.log(`✓ ${e.message}`),e.details?.output&&this.log(`
|
package/dist/commands/git/wtp.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../errors-
|
|
1
|
+
import"../../errors-K31FHK8S.js";import"../../runner-BthmKjXb.js";import"../../utils-BTx8InlR.js";import"../../pr-YuVCqLA5.js";import"../../view-Oc9e1Buj.js";import"../../worktree-CMlUbATz.js";import"../../create-CSR6dBbG.js";import{t as e}from"../../dispatcher-CixO5fFs.js";import{Command as t}from"@oclif/core";var n=class extends t{static summary=`Prune stale git worktrees`;static description=`
|
|
2
2
|
Remove stale worktree administrative files.
|
|
3
3
|
This cleans up worktrees that have been manually deleted from the filesystem.
|
|
4
4
|
`;static examples=[{description:`Prune stale worktrees`,command:`<%= config.bin %> <%= command.id %>`},{description:`Clean up after manually deleting a worktree folder`,command:`cd ~/repo && <%= config.bin %> <%= command.id %>`},{description:`Prune then list worktrees to verify`,command:`<%= config.bin %> <%= command.id %> && <%= config.bin %> git:wtl`}];async run(){let t=new e,n={action:`prune`};try{let e=await t.execute({command:`worktree`,cwd:process.cwd(),data:n});this.log(`✓ ${e.message}`),e.details?.output&&this.log(`
|
package/dist/commands/git/wtr.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../errors-
|
|
1
|
+
import"../../errors-K31FHK8S.js";import"../../runner-BthmKjXb.js";import"../../utils-BTx8InlR.js";import"../../pr-YuVCqLA5.js";import"../../view-Oc9e1Buj.js";import"../../worktree-CMlUbATz.js";import"../../create-CSR6dBbG.js";import{t as e}from"../../dispatcher-CixO5fFs.js";import{Command as t,Flags as n}from"@oclif/core";var r=class r extends t{static summary=`Remove a git worktree`;static description=`
|
|
2
2
|
Remove a git worktree by branch name, directory name, or path.
|
|
3
3
|
Intelligently matches branch or directory names.
|
|
4
4
|
Use --select to pick which worktree to remove from an interactive list.
|
package/dist/commands/git/wts.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../errors-
|
|
1
|
+
import"../../errors-K31FHK8S.js";import"../../runner-BthmKjXb.js";import"../../utils-BTx8InlR.js";import"../../pr-YuVCqLA5.js";import"../../view-Oc9e1Buj.js";import"../../worktree-CMlUbATz.js";import"../../create-CSR6dBbG.js";import{t as e}from"../../dispatcher-CixO5fFs.js";import{Command as t,Flags as n}from"@oclif/core";import{spawn as r}from"node:child_process";var i=class i extends t{static summary=`Switch to a git worktree (opens subshell by default)`;static description=`
|
|
2
2
|
Find a matching worktree, then start a subshell rooted there.
|
|
3
3
|
Defaults to the main branch if no branch/directory is provided.
|
|
4
4
|
Use --path-only for scripting (outputs the path for cd $(...)).
|
package/dist/commands/p/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../errors-
|
|
1
|
+
import"../../errors-K31FHK8S.js";import"../../editor-CRub_kaY.js";import{i as e,t}from"../../runner-BthmKjXb.js";import"../../fsStore-Dp7kL3Gm.js";import"../../base-BPSqk5ri.js";import"../../config-bqLy-CvP.js";import"../../template-CNWPigzN.js";import{t as n}from"../../xling-D8au8ueX.js";import"../../providerRegistry-DrzY3JDw.js";import"../../client-B2lwQe9s.js";import{n as r,t as i}from"../../types-Bj9yrqq6.js";import{n as a}from"../../router-BS0zXgkv.js";import{Args as o,Command as s,Flags as c}from"@oclif/core";import*as l from"node:fs";import*as u from"node:readline";import*as d from"node:tty";var f=class f extends s{static description=`Execute a prompt via xling providers or hand off to codex exec / claude -p with yolo`;static examples=[{description:`Simple prompt`,command:`<%= config.bin %> <%= command.id %> "Explain quantum computing"`},{description:`Specify model`,command:`<%= config.bin %> <%= command.id %> --model gpt-4-turbo "Write a poem"`},{description:`Read from file`,command:`<%= config.bin %> <%= command.id %> -f README.md "Summarize this"`},{description:`Read from stdin`,command:`git diff | <%= config.bin %> <%= command.id %> --stdin "Review this diff"`},{description:`JSON output`,command:`<%= config.bin %> <%= command.id %> --json "What is 2+2?"`},{description:`Directly run codex exec (bypass xling providers)`,command:`<%= config.bin %> <%= command.id %> --tool codex "Summarize this repo"`},{description:`Use Claude Code CLI with yolo by default`,command:`<%= config.bin %> <%= command.id %> --tool claude "Review this diff"`},{description:`Shorthand for Codex backend (matches x command flag)`,command:`<%= config.bin %> <%= command.id %> -t codex "Hello"`},{description:`Use Gemini CLI headless prompt`,command:`<%= config.bin %> <%= command.id %> -t gemini "Summarize this diff"`}];static flags={tool:c.string({description:`Choose backend: xling router (default) or call codex/claude/gemini CLI directly`,options:[`xling`,`codex`,`claude`,`gemini`],required:!1,default:`xling`,char:`t`}),yolo:c.boolean({description:`Use yolo flags when calling codex/claude/gemini directly (skip permission prompts)`,required:!1,default:!0,allowNo:!0}),model:c.string({char:`m`,description:`Model to use (defaults to configured defaultModel)`,required:!1}),prompt:c.string({char:`p`,description:`Prompt text (alternative to positional arg)`,required:!1}),system:c.string({char:`s`,description:`System prompt`,required:!1}),file:c.string({char:`f`,description:`Read additional context from file`,required:!1,multiple:!0}),stdin:c.boolean({description:`Read prompt from stdin`,required:!1,default:!1}),temperature:c.string({char:`T`,description:`Temperature (0.0-2.0)`,required:!1}),"max-tokens":c.integer({description:`Maximum tokens to generate`,required:!1}),json:c.boolean({description:`Output as JSON`,required:!1,default:!1}),stream:c.boolean({description:`Stream output (default: true)`,required:!1,default:!0,allowNo:!0}),interactive:c.boolean({char:`i`,description:`Enter interactive chat mode after first response`,required:!1,default:!1})};static args={prompt:o.string({description:`The prompt text`,required:!1})};async run(){let{args:e,flags:t}=await this.parse(f),n=t.tool??`xling`,o=t.yolo!==!1;try{let r=await this.#s(e,t);if(r.trim()||this.error(`No prompt provided. Use argument, --prompt, --file, or --stdin`),n!==`xling`){this.#t(n,t),await this.#n(n,r,o,t);return}this.#e();let i={prompt:r,model:t.model,system:t.system,temperature:t.temperature?parseFloat(t.temperature):void 0,maxTokens:t[`max-tokens`],stream:t.stream},s=await a(),c,l,u;if(t.stream&&!t.json){let e=await s.executeStream(i);c=await this.#o(e);let n=await e.usage;l=n?{promptTokens:n.inputTokens??0,completionTokens:n.outputTokens??0,totalTokens:n.totalTokens??0}:void 0,u={provider:`streaming`,model:t.model||`default`}}else{let e=await s.execute(i);c=e.content,l=e.usage,u={provider:e.provider,model:e.model},t.json?this.log(JSON.stringify(e,null,2)):this.log(e.content)}!t.json&&l&&u&&this.log(`\n[${u.provider}/${u.model}] ${l.totalTokens} tokens (${l.promptTokens} prompt + ${l.completionTokens} completion)`);let d=this.#r(t),f=d;!d&&!t.json&&process.stdout.isTTY&&(f=await this.#i()),f&&await this.#a(r,c,t,s)}catch(e){e instanceof r?this.error(e.message):e instanceof i?this.error(`All providers failed:\n${e.errors.map(e=>` ${e.provider}: ${e.error.message}`).join(`
|
|
2
2
|
`)}`):this.error(e.message)}}#e(){let e=new n().resolvePath(`user`);l.existsSync(e.replace(`~`,process.env.HOME||``))||this.error(`Configuration not found at ${e}\n\nPlease create a configuration file with at least one provider.\nExample:\n{\n "prompt": {\n "providers": [\n {\n "name": "openai",\n "baseUrl": "https://api.openai.com/v1",\n "apiKey": "sk-...",\n "models": ["gpt-4", "gpt-4-turbo"]\n }\n ],\n "defaultModel": "gpt-4"\n }\n}`)}#t(e,t){t.interactive&&this.error(`Interactive mode is not supported when using --tool codex/claude/gemini. Remove --interactive or use the default xling router.`);let n=[];t.json&&n.push(`--json`),t.model&&e!==`gemini`&&n.push(`--model`),t.system&&n.push(`--system`),t.temperature!==void 0&&n.push(`--temperature`),t[`max-tokens`]!==void 0&&n.push(`--max-tokens`),t.stream===!1&&n.push(`--no-stream`),n.length>0&&this.warn(`Ignoring ${n.join(`, `)} when using direct CLI backend; codex/claude will apply their own defaults.`)}async#n(n,r,i,a){let o=n===`codex`?`codex`:n===`gemini`?`gemini`:`claude`;await t(o)||this.error(`Tool "${o}" is not installed or not found in PATH. Please install it before using --tool ${n}.`);let s=n===`codex`?[`exec`,r]:[`-p`,r];n===`gemini`&&a.model&&s.unshift(`-m`,a.model);let c={executable:o,baseArgs:s,yoloArgs:n===`codex`?i?[`--dangerously-bypass-approvals-and-sandbox`]:void 0:n===`gemini`?i?[`-y`]:void 0:i?[`--dangerously-skip-permissions`]:void 0};this.log(`[backend: ${n}] ${i?`yolo on`:`yolo off`} — handing output to ${o}`),await e(c)}#r(e){return e.interactive?!0:(process.stdout.isTTY&&process.stdin.isTTY,!1)}async#i(){return new Promise(e=>{let t=!1;try{let n=l.openSync(`/dev/tty`,`r+`),r=new d.ReadStream(n),i=new d.WriteStream(n),a=u.createInterface({input:r,output:i});a.question(`
|
|
3
3
|
Continue conversation? (y/N): `,o=>{t=!0;let s=o.trim().toLowerCase(),c=s===`y`||s===`yes`;c||(i??process.stdout).write(`
|
|
4
4
|
Okay, not continuing the conversation.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command, Interfaces } from "@oclif/core";
|
|
2
|
+
|
|
3
|
+
//#region src/commands/proxy/index.d.ts
|
|
4
|
+
declare class ProxyCommand extends Command {
|
|
5
|
+
#private;
|
|
6
|
+
static summary: string;
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: Command.Example[];
|
|
9
|
+
static flags: Interfaces.FlagInput;
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ProxyCommand as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import"../../errors-K31FHK8S.js";import"../../editor-CRub_kaY.js";import"../../fsStore-Dp7kL3Gm.js";import"../../base-BPSqk5ri.js";import"../../config-bqLy-CvP.js";import"../../template-CNWPigzN.js";import"../../xling-D8au8ueX.js";import"../../errorClassifier-Cvr-_iPQ.js";import"../../loadBalancer-DDsh2Xtn.js";import"../../transformer-DedIktrl.js";import{n as e,t}from"../../server-Dhpqbbu7.js";import{Command as n,Flags as r}from"@oclif/core";var i=class i extends n{static summary=`Start an OpenAI-compatible proxy server with load balancing and key rotation`;static description=`Boot a local proxy server that forwards requests to configured upstream AI providers.
|
|
2
|
+
|
|
3
|
+
Features:
|
|
4
|
+
- OpenAI-compatible API endpoints (/v1/chat/completions, /v1/messages, etc.)
|
|
5
|
+
- Multiple upstream providers with automatic failover
|
|
6
|
+
- Load balancing strategies: round-robin, random, weighted, failover
|
|
7
|
+
- API key rotation with automatic cooldown on errors
|
|
8
|
+
- Optional access key protection
|
|
9
|
+
|
|
10
|
+
Configuration is read from ~/.claude/xling.json under the 'proxy' section.`;static examples=[{description:`Start proxy server on default port (4320)`,command:`<%= config.bin %> <%= command.id %>`},{description:`Start on custom port with access key protection`,command:`<%= config.bin %> <%= command.id %> --port 8080 --access-key my-secret-key`},{description:`Bind to all interfaces for external access`,command:`<%= config.bin %> <%= command.id %> --host 0.0.0.0`},{description:`Start with verbose logging disabled`,command:`<%= config.bin %> <%= command.id %> --no-logger`}];static flags={port:r.integer({char:`p`,description:`Port for the proxy server`,default:t}),host:r.string({description:`Host/interface to bind`,default:`127.0.0.1`}),"access-key":r.string({char:`k`,description:`Access key for proxy authentication (overrides config file)`}),logger:r.boolean({description:`Enable request logging`,default:!0,allowNo:!0})};async run(){let{flags:t}=await this.parse(i);try{let n=await e({host:t.host,port:t.port,accessKey:t[`access-key`],logger:t.logger});this.#e(n,t[`access-key`]),this.log(`
|
|
11
|
+
Press Ctrl+C to stop the proxy server.`),await new Promise(()=>{})}catch(e){this.error(`Failed to start proxy server: ${e.message??e}`)}}#e(e,t){this.log(`Proxy server running at ${e.baseUrl}`),this.log(`Providers: ${e.providers.join(`, `)}`);let n=e.models.length>5?`${e.models.slice(0,5).join(`, `)} ...`:e.models.join(`, `);this.log(e.models.length?`Models: ${n}`:`No models detected.`),t&&(this.log(`
|
|
12
|
+
Access key protection: ENABLED`),this.log(`Include 'Authorization: Bearer <access-key>' in requests.`)),this.log(`
|
|
13
|
+
Endpoints:`),this.log(` ${e.baseUrl}/v1/chat/completions - OpenAI Chat API`),this.log(` ${e.baseUrl}/v1/responses - OpenAI Responses API (Codex)`),this.log(` ${e.baseUrl}/v1/messages - Anthropic Messages API`),this.log(` ${e.baseUrl}/v1/completions - OpenAI Completions API`),this.log(` ${e.baseUrl}/health - Health check`),this.log(` ${e.baseUrl}/stats - Provider statistics`),this.log(`
|
|
14
|
+
Usage with Claude Code:`),this.log(` Set ANTHROPIC_BASE_URL=${e.baseUrl} (without /v1 suffix)`),this.log(`
|
|
15
|
+
Usage with Codex (config.toml):`),this.log(` [model_providers.xling]`),this.log(` name = "xling"`),this.log(` base_url = "${e.baseUrl}"`),this.log(` wire_api = "responses"`),t&&this.log(` experimental_bearer_token = "<your-access-key>"`),this.log(`
|
|
16
|
+
Usage with curl:`),this.log(` curl ${e.baseUrl}/v1/chat/completions \\`),this.log(` -H "Content-Type: application/json" \\`),t&&this.log(` -H "Authorization: Bearer <access-key>" \\`),this.log(` -d '{"model": "gpt-4", "messages": [{"role": "user", "content": "Hello"}]}'`)}};export{i as default};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command, Interfaces } from "@oclif/core";
|
|
2
|
+
|
|
3
|
+
//#region src/commands/settings/auth.d.ts
|
|
4
|
+
|
|
5
|
+
declare class SettingsAuth extends Command {
|
|
6
|
+
#private;
|
|
7
|
+
static summary: string;
|
|
8
|
+
static description: string;
|
|
9
|
+
static examples: Command.Example[];
|
|
10
|
+
static flags: Interfaces.FlagInput;
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { SettingsAuth as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import"../../errors-K31FHK8S.js";import{r as e}from"../../format-BHc8ftok.js";import"../../fsStore-Dp7kL3Gm.js";import"../../base-BPSqk5ri.js";import{t}from"../../codex-CsSN6D2f.js";import{Command as n,Flags as r}from"@oclif/core";var i=class i extends n{static summary=`Manage auth profiles for Codex`;static description=`
|
|
2
|
+
Save, list, and delete auth profiles for Codex.
|
|
3
|
+
Use settings:switch to switch between auth profiles and providers.
|
|
4
|
+
|
|
5
|
+
Auth profiles allow you to save multiple Codex login credentials
|
|
6
|
+
and switch between them without having to logout and login again.
|
|
7
|
+
`;static examples=[{description:`List all saved auth profiles`,command:`<%= config.bin %> <%= command.id %> --tool codex`},{description:`Save current auth as a named profile`,command:`<%= config.bin %> <%= command.id %> --save personal --tool codex`},{description:`Overwrite an existing profile`,command:`<%= config.bin %> <%= command.id %> --save personal --tool codex --force`},{description:`Delete an auth profile`,command:`<%= config.bin %> <%= command.id %> --delete old-account --tool codex`}];static flags={tool:r.string({char:`t`,description:`AI CLI tool (currently only codex is supported)`,options:[`codex`],default:`codex`}),save:r.string({char:`s`,description:`Save current auth as a named profile`}),delete:r.string({char:`d`,description:`Delete an auth profile`}),force:r.boolean({char:`f`,description:`Overwrite existing profile without confirmation`,default:!1}),json:r.boolean({description:`Output JSON instead of text`,default:!1})};async run(){let{flags:e}=await this.parse(i);e.tool!==`codex`&&this.error(`Auth profile management is currently only supported for Codex.`,{exit:1});let n=new t,r=!!e.force,a=!!e.json,o=e.save,s=e.delete;o?await this.#t(n,o,{force:r,json:a}):s?await this.#n(n,s,{json:a}):await this.#e(n,{json:a})}async#e(t,n){let r=t.listAuthProfiles();if(n.json){this.log(e({profiles:r}));return}if(r.length===0){this.log(`No auth profiles found.`),this.log(`
|
|
8
|
+
To save your current auth, run:`),this.log(` xling settings:auth --save <name> --tool codex`);return}this.log(`Auth profiles:`);for(let e of r)this.log(` - ${e}`);this.log(`\nTotal: ${r.length} profile(s)`)}async#t(e,t,n){let r=e.saveAuthProfile(t,n.force);this.#r(r,n.json),r.success||this.exit(1)}async#n(e,t,n){let r=e.deleteAuthProfile(t);this.#r(r,n.json),r.success||this.exit(1)}#r(t,n){if(n){this.log(e(t));return}t.success?(this.log(t.message??`Operation completed successfully.`),t.filePath&&this.log(` File: ${t.filePath}`)):this.error(t.message??`Operation failed.`,{exit:1})}};export{i as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../errors-
|
|
1
|
+
import"../../errors-K31FHK8S.js";import"../../editor-CRub_kaY.js";import{r as e}from"../../format-BHc8ftok.js";import{f as t}from"../../fsStore-Dp7kL3Gm.js";import"../../base-BPSqk5ri.js";import"../../config-bqLy-CvP.js";import"../../template-CNWPigzN.js";import"../../xling-D8au8ueX.js";import"../../codex-CsSN6D2f.js";import"../../claudeDefault-7I5R7M9m.js";import{t as n}from"../../claude-CA8e4ttR.js";import"../../gemini-DVNV-89A.js";import{t as r}from"../../dispatcher-jdh4erR9.js";import{Args as i,Command as a,Flags as o}from"@oclif/core";import s from"node:fs";import c from"node:path";var l=class l extends a{static summary=`View the full configuration file`;static description=`
|
|
2
2
|
Print the entire configuration file for the selected tool/scope.
|
|
3
3
|
Use --json for structured output or --no-json for plain text.
|
|
4
|
-
`;static examples=[{description:`Print Claude user settings (raw file)`,command:`<%= config.bin %> <%= command.id %> --tool claude --scope user`},{description:`Inspect a Claude variant by name`,command:`<%= config.bin %> <%= command.id %> hxi --tool claude --scope user`},{description:`Dump Codex config as JSON for scripting`,command:`<%= config.bin %> <%= command.id %> --tool codex --json`},{description:`View xling prompt router config (if present)`,command:`<%= config.bin %> <%= command.id %> --tool xling --scope user`}];static args={name:i.string({description:`Claude variant name (optional). Example: settings:get hxi`,required:!1})};static flags={tool:o.string({char:`t`,description:`AI CLI tool to manage`,options:[`claude`,`codex`,`gemini`,`xling`],default:`claude`}),scope:o.string({char:`s`,description:`Configuration scope`,options:[`user`,`project`,`local`,`system`],default:`user`})};async run(){let{args:t,flags:n}=await this.parse(l);try{let r=n.tool,i=n.scope,a=r===`claude`&&t.name?await this.#t(i,t.name):await this.#e(r,i);if(n.json){this.log(e({success:!0,data:a}));return}if(!a.exists){this.warn(`Config file not found: ${a.path}`);return}a.content?this.log(a.content):this.log(`File is empty.`)}catch(e){this.error(e.message,{exit:1})}}async#e(e,t){return(await new r().execute({tool:e,scope:t,action:`inspect`})).data}async#t(e,r){let i=new n;if(!i.validateScope(e))throw Error(`Invalid scope for Claude: ${e}`);let a=r.trim();if(!a||a===`default`)return this.#e(`claude`,e);let o=t(i.resolvePath(e)),l=
|
|
4
|
+
`;static examples=[{description:`Print Claude user settings (raw file)`,command:`<%= config.bin %> <%= command.id %> --tool claude --scope user`},{description:`Inspect a Claude variant by name`,command:`<%= config.bin %> <%= command.id %> hxi --tool claude --scope user`},{description:`Dump Codex config as JSON for scripting`,command:`<%= config.bin %> <%= command.id %> --tool codex --json`},{description:`View xling prompt router config (if present)`,command:`<%= config.bin %> <%= command.id %> --tool xling --scope user`}];static args={name:i.string({description:`Claude variant name (optional). Example: settings:get hxi`,required:!1})};static flags={tool:o.string({char:`t`,description:`AI CLI tool to manage`,options:[`claude`,`codex`,`gemini`,`xling`],default:`claude`}),scope:o.string({char:`s`,description:`Configuration scope`,options:[`user`,`project`,`local`,`system`],default:`user`})};async run(){let{args:t,flags:n}=await this.parse(l);try{let r=n.tool,i=n.scope,a=r===`claude`&&t.name?await this.#t(i,t.name):await this.#e(r,i);if(n.json){this.log(e({success:!0,data:a}));return}if(!a.exists){this.warn(`Config file not found: ${a.path}`);return}a.content?this.log(a.content):this.log(`File is empty.`)}catch(e){this.error(e.message,{exit:1})}}async#e(e,t){return(await new r().execute({tool:e,scope:t,action:`inspect`})).data}async#t(e,r){let i=new n;if(!i.validateScope(e))throw Error(`Invalid scope for Claude: ${e}`);let a=r.trim();if(!a||a===`default`)return this.#e(`claude`,e);let o=t(i.resolvePath(e)),l=c.dirname(o),u=this.#n(l,a)??c.join(l,`settings.${a}.json`);if(!s.existsSync(u))return{path:u,exists:!1};let d=s.statSync(u);return{path:u,exists:!0,content:s.readFileSync(u,`utf-8`),size:d.size,lastModified:d.mtime}}#n(e,t){let n=[`settings.${t}.json`,`settings-${t}.json`];for(let t of n){let n=c.join(e,t);if(s.existsSync(n))return n}return null}};export{l as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../errors-
|
|
1
|
+
import"../../errors-K31FHK8S.js";import"../../editor-CRub_kaY.js";import{r as e}from"../../format-BHc8ftok.js";import"../../fsStore-Dp7kL3Gm.js";import"../../base-BPSqk5ri.js";import"../../config-bqLy-CvP.js";import"../../template-CNWPigzN.js";import"../../xling-D8au8ueX.js";import"../../codex-CsSN6D2f.js";import"../../claudeDefault-7I5R7M9m.js";import"../../claude-CA8e4ttR.js";import"../../gemini-DVNV-89A.js";import{t}from"../../dispatcher-jdh4erR9.js";import{Command as n,Flags as r}from"@oclif/core";var i=class i extends n{static summary=`Inspect configuration file status`;static description=`
|
|
2
2
|
Display information about the configuration file, including:
|
|
3
3
|
- File path
|
|
4
4
|
- Existence status
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../errors-
|
|
1
|
+
import"../../errors-K31FHK8S.js";import"../../editor-CRub_kaY.js";import{i as e,n as t,r as n}from"../../format-BHc8ftok.js";import"../../fsStore-Dp7kL3Gm.js";import"../../base-BPSqk5ri.js";import"../../config-bqLy-CvP.js";import"../../template-CNWPigzN.js";import"../../xling-D8au8ueX.js";import"../../codex-CsSN6D2f.js";import"../../claudeDefault-7I5R7M9m.js";import"../../claude-CA8e4ttR.js";import"../../gemini-DVNV-89A.js";import{t as r}from"../../dispatcher-jdh4erR9.js";import{Command as i,Flags as a}from"@oclif/core";var o=class o extends i{static summary=`List all settings for a tool`;static description=`
|
|
2
2
|
Display all configuration settings for the specified AI CLI tool.
|
|
3
3
|
Supports multiple scopes (user, project, local, system).
|
|
4
4
|
`;static examples=[{description:`List Claude user settings (YAML-style summary)`,command:`<%= config.bin %> <%= command.id %> --tool claude --scope user`},{description:`Show Codex providers in a table`,command:`<%= config.bin %> <%= command.id %> --tool codex --scope user --table`},{description:`Inspect Gemini project settings as JSON`,command:`<%= config.bin %> <%= command.id %> -t gemini -s project --json`},{description:`Check xling shortcut config location`,command:`<%= config.bin %> <%= command.id %> --tool xling --scope user`}];static flags={tool:a.string({char:`t`,description:`AI CLI tool to manage`,options:[`claude`,`codex`,`gemini`,`xling`],default:`claude`}),scope:a.string({char:`s`,description:`Configuration scope`,options:[`user`,`project`,`local`,`system`],default:`user`}),json:a.boolean({description:`Output JSON instead of text summary`,default:!1}),table:a.boolean({description:`Render table output instead of JSON`,default:!1})};async run(){let{flags:e}=await this.parse(o);try{let t=await new r().execute({tool:e.tool,scope:e.scope,action:`list`});if(e.table){this.#t(t.data);return}if(e.json){this.log(n(t));return}this.#e(t.data)}catch(e){this.error(e.message,{exit:1})}}#e(e){if(!e){this.log(`No settings found.`);return}if(e.type===`files`){if(e.files.length===0){this.log(`No settings files found.`);return}this.log(this.#n(e.files));return}if(Object.keys(e.entries).length===0){this.log(`No settings found.`);return}this.log(this.#r(e.entries,e.filePath))}#t(n){if(!n){this.log(`No settings found.`);return}if(n.type===`files`){if(n.files.length===0){this.log(`No settings files found.`);return}this.log(t(n.files));return}if(Object.keys(n.entries).length===0){this.log(`No settings found.`);return}this.log(e(n.entries)),this.log(`File: ${n.filePath}`)}#n(e){let t=e.map(e=>`${e.active?`* `:`- `}${e.variant} -> ${e.path}`+(e.exists?``:` (missing)`));return[`files:`].concat(t).join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../errors-
|
|
1
|
+
import"../../errors-K31FHK8S.js";import"../../editor-CRub_kaY.js";import{r as e}from"../../format-BHc8ftok.js";import"../../fsStore-Dp7kL3Gm.js";import"../../base-BPSqk5ri.js";import"../../config-bqLy-CvP.js";import"../../template-CNWPigzN.js";import"../../xling-D8au8ueX.js";import"../../codex-CsSN6D2f.js";import"../../claudeDefault-7I5R7M9m.js";import"../../claude-CA8e4ttR.js";import"../../gemini-DVNV-89A.js";import{t}from"../../dispatcher-jdh4erR9.js";import{Command as n,Flags as r}from"@oclif/core";var i=class i extends n{static summary=`Open settings files in your IDE`;static description=`
|
|
2
2
|
Create or open settings files for AI CLI tools in your preferred editor.
|
|
3
3
|
For Claude: provide --name to edit settings.<name>.json (default: settings.json).
|
|
4
4
|
For Xling: edits ~/.claude/xling.json configuration.
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import"../../errors-
|
|
1
|
+
import"../../errors-K31FHK8S.js";import"../../editor-CRub_kaY.js";import{r as e}from"../../format-BHc8ftok.js";import"../../fsStore-Dp7kL3Gm.js";import"../../base-BPSqk5ri.js";import"../../config-bqLy-CvP.js";import"../../template-CNWPigzN.js";import"../../xling-D8au8ueX.js";import{t}from"../../codex-CsSN6D2f.js";import"../../claudeDefault-7I5R7M9m.js";import"../../claude-CA8e4ttR.js";import"../../gemini-DVNV-89A.js";import{t as n}from"../../dispatcher-jdh4erR9.js";import{Args as r,Command as i,Flags as a}from"@oclif/core";import o from"node:readline/promises";import{stdin as s,stdout as c}from"node:process";var l=class l extends i{static summary=`Switch Codex profiles or Claude settings variants`;static description=`
|
|
2
2
|
Switch to a different profile configuration for Codex
|
|
3
3
|
or activate a specific settings.<variant>.json for Claude.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
|
|
5
|
+
For Codex, you can switch between:
|
|
6
|
+
- Auth profiles (saved login credentials)
|
|
7
|
+
- Model providers (API endpoints)
|
|
8
|
+
- Named profiles (from config.toml)
|
|
9
|
+
`;static examples=[{description:`Switch Codex to an auth profile (saved login)`,command:`<%= config.bin %> <%= command.id %> personal --tool codex`},{description:`Switch Codex to a provider`,command:`<%= config.bin %> <%= command.id %> my-provider --tool codex`},{description:`Interactive selection for Codex`,command:`<%= config.bin %> <%= command.id %> --tool codex`},{description:`Activate a Claude variant (user scope)`,command:`<%= config.bin %> <%= command.id %> hxi --tool claude --scope user`},{description:`Force-apply Claude variant and emit JSON for scripts`,command:`<%= config.bin %> <%= command.id %> hxi --tool claude --scope user --force --json`},{description:`Keep a backup while switching Claude settings`,command:`<%= config.bin %> <%= command.id %> stable --tool claude --backup`}];static args={profile:r.string({description:`Profile name to switch to`,required:!1})};static flags={tool:a.string({char:`t`,description:`AI CLI tool to manage`,options:[`claude`,`codex`,`gemini`,`xling`],default:`claude`}),scope:a.string({char:`s`,description:`Configuration scope`,options:[`user`,`project`,`local`,`system`],default:`user`}),json:a.boolean({description:`Output JSON instead of interactive text`,default:!1}),force:a.boolean({description:`Skip confirmation prompts (Claude only)`,default:!1}),backup:a.boolean({description:`Create a .bak backup when switching (Claude only)`,default:!1})};async run(){let{args:e,flags:t}=await this.parse(l),r=new n,i=e.profile;i||=(t.json&&this.error(`Profile is required when using --json output.`,{exit:1}),await this.#t(r,t));try{let e=t.tool===`claude`?await this.#e(r,i,t):await r.execute({tool:t.tool,scope:t.scope,action:`switch-profile`,profile:i});if(!e)return;this.#s(e,i,t)}catch(e){this.error(e.message,{exit:1})}}async#e(e,t,n){n.json&&!n.force&&this.error(`--json requires --force when switching Claude settings.`,{exit:1});let r=await e.execute({tool:`claude`,scope:n.scope,action:`switch-profile`,profile:t,switchOptions:{preview:!0}});if(r.diff)this.log(`Proposed changes:
|
|
10
|
+
`+r.diff);else return this.log(`No differences detected. Current settings already match the selected variant.`),r;let i=!!n.backup;if(!n.force&&!i){let e=await this.#a();if(e===`cancel`)return this.log(`Switch cancelled.`),null;i=e===`backup`}let a=await e.execute({tool:`claude`,scope:n.scope,action:`switch-profile`,profile:t,switchOptions:{backup:i}});return a.diff=r.diff,a}async#t(e,t){let n=t.tool,r=t.scope,i=[];n===`claude`?i=await this.#n(e,r):n===`codex`?i=await this.#r(r):this.error(`Interactive selection is not supported for tool: ${n}`,{exit:1}),i.length||this.error(`No available profiles found for the selected tool.`,{exit:1}),this.log(`Select a profile to switch to:`),i.forEach((e,t)=>{this.log(` ${t+1}) ${e}`)});let a=o.createInterface({input:s,output:c});try{for(;;){let e=(await a.question(`Enter number or name: `)).trim().toLowerCase(),t=Number.parseInt(e,10);if(Number.isInteger(t)&&t>=1&&t<=i.length){let e=i[t-1];return n===`codex`?this.#i(e):e}let r=i.find(t=>t.toLowerCase()===e);if(r)return n===`codex`?this.#i(r):r;if(n===`codex`){let t=i.find(t=>this.#i(t).toLowerCase()===e);if(t)return this.#i(t)}this.log(`Invalid selection. Please try again.`)}}finally{a.close()}}async#n(e,t){let n=await e.execute({tool:`claude`,scope:t,action:`list`});return this.#o(n.data)?n.data.files.filter(e=>!e.active).map(e=>e.variant).filter(Boolean):[]}async#r(e){let{providers:n,authProfiles:r}=new t().getAllSwitchableProfiles(e),i=[];if(r.length>0)for(let e of r)i.push(`[auth] ${e}`);if(n.length>0)for(let e of n)i.push(`[provider] ${e}`);return i}#i(e){let t=e.match(/^\[(auth|provider)\]\s+(.+)$/);return t?t[2]:e}async#a(){let e=o.createInterface({input:s,output:c});try{for(;;){let t=(await e.question(`Choose action ([o]verwrite/[b]ackup/[c]ancel): `)).trim().toLowerCase();if([`overwrite`,`backup`,`cancel`].includes(t))return t;if([`o`,`b`,`c`].includes(t))return{o:`overwrite`,b:`backup`,c:`cancel`}[t]}}finally{e.close()}}#o(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`files`&&`files`in e&&Array.isArray(e.files))}#s(t,n,r){if(r.json){this.log(e(t));return}if(t.preview){this.log(`Preview only. No changes applied.`),t.diff&&this.log(t.diff);return}this.log(t.message??`Switched to profile: ${n}`),t.filePath&&this.log(` File: ${t.filePath}`),t.diff&&this.log(`Applied diff:
|
|
11
|
+
`+t.diff)}};export{l as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../errors-
|
|
1
|
+
import"../../errors-K31FHK8S.js";import"../../editor-CRub_kaY.js";import"../../fsStore-Dp7kL3Gm.js";import"../../base-BPSqk5ri.js";import"../../config-bqLy-CvP.js";import"../../template-CNWPigzN.js";import"../../xling-D8au8ueX.js";import{n as e,t}from"../../types-DX3D0cu3.js";import{t as n}from"../../runner-ITvpapv-.js";import{Args as r,Command as i,Flags as a}from"@oclif/core";import o from"cli-table3";var s=class s extends i{static summary=`Shortcut eXecute - run predefined command shortcuts`;static description=`
|
|
2
2
|
Execute predefined command shortcuts configured in ~/.claude/xling.json.
|
|
3
3
|
|
|
4
4
|
Shortcuts allow you to create custom aliases for frequently used xling commands
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Command as e}from"@oclif/core";var t=`0.
|
|
1
|
+
import{Command as e}from"@oclif/core";var t=`0.9.0`,n=class extends e{static summary=`Show the current xling version`;static description=`Displays the version from package.json.`;static examples=[{description:`Print the installed CLI version`,command:`<%= config.bin %> <%= command.id %>`},{description:`Shortcut using the built-in flag`,command:`<%= config.bin %> --version`}];async run(){this.log(t??`unknown`)}};export{n as default};
|
package/dist/commands/x/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../errors-
|
|
1
|
+
import"../../errors-K31FHK8S.js";import"../../runner-BthmKjXb.js";import"../../base-DTfJeAL2.js";import"../../claude-DWXHrlbr.js";import"../../codex-CeecDPCd.js";import"../../gemini-Im27-JQu.js";import{t as e}from"../../dispatcher-B3LVp_HG.js";import{Command as t,Flags as n}from"@oclif/core";var r=class r extends t{static summary=`eXecute AI CLI tools (defaults to Claude Code with yolo)`;static description=`
|
|
2
2
|
Quick launcher for Claude Code, Codex, or Gemini CLI with yolo mode enabled by default.
|
|
3
3
|
|
|
4
4
|
Just run "xling x" to start Claude Code instantly!
|