import"../../errors-pXKbCKbL.js";import"../../runner-DYk4q6mP.js";import"../../base-FY_XeKpj.js";import"../../claude-DsuN4tnK.js";import"../../codex-9KXsEKx4.js";import"../../gemini-DKTklp3n.js";import{t as e}from"../../dispatcher-CbGO-tBH.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=`
    Quick launcher for Claude Code, Codex, or Gemini CLI with yolo mode enabled by default.

    Just run "xling x" to start Claude Code instantly!

    Claude Code is launched by default. Use --tool flag to launch other tools.

    Yolo mode is ENABLED by default, which skips permission prompts:
    - Claude Code: --dangerously-skip-permissions
    - Codex: --dangerously-bypass-approvals-and-sandbox
    - Gemini CLI: -y

    Resume options:
    - Use -c/--continue to continue the last conversation/session
    - Use -r/--resume to show a list of conversations/sessions to resume

    Pass additional arguments after -- to forward them to the tool.

    Examples:
      $ xling x                          # Start Claude Code (fastest way!)
      $ xling x -c                       # Continue last Claude conversation
      $ xling x -r                       # Resume a Claude conversation (list)
      $ xling x -s hxi                   # Start Claude with hxi settings variant
      $ xling x -t codex -c              # Continue last Codex session
      $ xling x -t codex -s oss          # Start Codex with oss profile
      $ xling x --tool codex             # Start Codex
      $ xling x -t gemini                # Start Gemini CLI
      $ xling x -t gemini -c             # Resume latest Gemini session
      $ xling x --no-yolo                # Start Claude without yolo
      $ xling x -- chat "Hello"          # Start Claude with arguments
      $ xling x -t codex -C /path        # Start Codex in specific directory
  `;static examples=[{description:`Start Claude Code instantly (default)`,command:`<%= config.bin %> <%= command.id %>`},{description:`Continue last conversation`,command:`<%= config.bin %> <%= command.id %> -c`},{description:`Resume a conversation from list`,command:`<%= config.bin %> <%= command.id %> -r`},{description:`Start Claude with hxi settings variant`,command:`<%= config.bin %> <%= command.id %> -s hxi`},{description:`Continue last Codex session`,command:`<%= config.bin %> <%= command.id %> -t codex -c`},{description:`Start Codex with oss profile`,command:`<%= config.bin %> <%= command.id %> -t codex -s oss`},{description:`Start Gemini CLI (auto-accept actions)`,command:`<%= config.bin %> <%= command.id %> -t gemini`},{description:`Resume latest Gemini session`,command:`<%= config.bin %> <%= command.id %> -t gemini -c`},{description:`Start Claude without yolo mode`,command:`<%= config.bin %> <%= command.id %> --no-yolo`},{description:`Start Claude and pass arguments`,command:`<%= config.bin %> <%= command.id %> -- chat "Hello, how are you?"`},{description:`Start Codex in specific directory`,command:`<%= config.bin %> <%= command.id %> -t codex -C /path/to/project`}];static flags={tool:n.string({description:`AI CLI tool to launch`,char:`t`,options:[`claude`,`codex`,`gemini`],default:`claude`}),yolo:n.boolean({description:`Enable yolo mode (skip permission prompts)`,default:!0,allowNo:!0}),continue:n.boolean({description:`Continue last conversation/session`,char:`c`,exclusive:[`resume`]}),resume:n.boolean({description:`Resume from conversation/session list`,char:`r`,exclusive:[`continue`]}),cwd:n.string({description:`Working directory for the launched process`,char:`C`}),settings:n.string({description:`Settings configuration (Claude: variant name or file path; Codex: profile name; Gemini: model name)`,char:`s`})};static strict=!1;async run(){let{flags:t,argv:n}=await this.parse(r),i=n.indexOf(`--`),a=i>=0?n.slice(i+1):[];try{let n=await new e().execute({tool:t.tool,yolo:t.yolo,continue:t.continue,resume:t.resume,cwd:t.cwd,settings:t.settings,args:a});n.success?(this.log(n.message??`Launched successfully`),n.command&&t.yolo&&this.log(`\nCommand: ${n.command}`)):this.error(n.message??`Launch failed`,{exit:1})}catch(e){this.error(e.message,{exit:1})}}};export{r as default};