import"../../errors-pXKbCKbL.js";import"../../editor-BmJI32_P.js";import{i as e,n as t,r as n}from"../../format-a_tYXjv9.js";import"../../fsStore-BzLA1cBc.js";import"../../base-xqced3zT.js";import"../../config-Bphz_1Sc.js";import"../../template-Cpbt9qy8.js";import"../../xling-DyktHkvX.js";import"../../claudeDefault-B8XYzR_k.js";import"../../claude-F-aLoUUK.js";import"../../codex-BDB0z8Gw.js";import"../../gemini-CPA89gOH.js";import{t as r}from"../../dispatcher-1aCGdFHn.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=`
    Display all configuration settings for the specified AI CLI tool.
    Supports multiple scopes (user, project, local, system).
  `;static examples=[`<%= config.bin %> <%= command.id %> --tool claude --scope user`,`<%= config.bin %> <%= command.id %> --tool codex --scope user --table`,`<%= config.bin %> -t gemini -s project --no-json`];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(`
`)}#r(e,t){let n=[`entries:`];for(let[t,r]of Object.entries(e)){let e=this.#i(r);if(e.includes(`
`)){n.push(`- ${t}:`);for(let t of e.split(`
`))n.push(`  ${t}`)}else n.push(`- ${t}: ${e}`)}return n.push(`file: ${t}`),n.join(`
`)}#i(e){return e===null?`null`:typeof e==`object`?e instanceof Date?e.toISOString():JSON.stringify(e,null,2):String(e)}};export{o as default};