var D=Object.defineProperty;var d=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var O=(n,i,e)=>i in n?D(n,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[i]=e,a=(n,i)=>{for(var e in i||(i={}))F.call(i,e)&&O(n,e,i[e]);if(d)for(var e of d(i))I.call(i,e)&&O(n,e,i[e]);return n};var u=(n,i,e)=>new Promise((s,m)=>{var l=o=>{try{p(e.next(o))}catch(c){m(c)}},y=o=>{try{p(e.throw(o))}catch(c){m(c)}},p=o=>o.done?s(o.value):Promise.resolve(o.value).then(l,y);p((e=e.apply(n,i)).next())});var r=n=>({script:["asdf","plugin-list"],postProcess:i=>i.split(`
`).map(e=>a({name:`${e}`,description:"Plugin name",priority:76,icon:"fig://icon?type=package"},n))}),T=n=>({custom:(i,e,s)=>u(void 0,null,function*(){let{stdout:m}=yield e({command:"ls",args:["-1",`${s.environmentVariables.HOME}/.asdf/repository/plugins`]});return m.split(`
`).map(l=>a({name:`${l}`,description:"Plugin name",priority:76,icon:"fig://icon?type=package"},n))})}),t=(n,i)=>a({script:e=>{let s=e[e.length-2];return["asdf","list",s]},postProcess:e=>e.split(`
`).reverse().map(s=>a({name:`${s}`.trim(),description:"Plugin version",priority:76,icon:"fig://icon?type=commit"},n))},i),_=(n,i)=>a({script:e=>{let s=e[e.length-2];return["asdf","list-all",s]},cache:{ttl:36e5},postProcess:e=>e.split(`
`).reverse().map(s=>a({name:`${s}`.trim(),description:"Plugin version",priority:76,icon:"fig://icon?type=commit"},n))},i),g=n=>({custom:(i,e,s)=>u(void 0,null,function*(){let{stdout:m}=yield e({command:"ls",args:["-1",`${s.environmentVariables.HOME}/.asdf/shims`]});return m.split(`
`).map(l=>a({name:`${l}`,description:"Shim name",priority:76,icon:"fig://icon?type=command"},n))})}),f={description:"Add a plugin from the plugin repo OR, add a Git repo as a plugin by specifying the name and repo url",args:[{name:"name",generators:T()},{name:"git-url",isOptional:!0}]},b={description:"List plugins registered on asdf-plugins repository with URLs"},v={description:"List installed plugins. Optionally show git urls and git-ref",options:[{name:"--urls",description:"Show git urls"},{name:"--refs",description:"Show git refs"}],subcommands:[a({name:"all"},b)]},h={description:"Remove plugin and package versions",args:{name:"name",generators:r({isDangerous:!0})}},S={description:"Update a plugin to latest commit on default branch or a particular git-ref",args:[{name:"name",isOptional:!0,isDangerous:!0},{name:"git-ref",isOptional:!0,isDangerous:!0}],options:[{name:"--all",description:"Update all plugins to latest commit on default branch",isDangerous:!0}]},P={description:"List all available (remote) versions of a package",args:[{name:"name",generators:r()},{name:"version",generators:t(),isOptional:!0}]},R={description:"List for given command which plugins and versions provide it",args:{name:"command",generators:g()}},H={name:"asdf",description:"Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more",subcommands:[{name:"plugin",description:"Plugin management sub-commands",subcommands:[a({name:"add"},f),a({name:"list"},v),a({name:"remove"},h),a({name:"update"},S)]},a({name:"plugin-add"},f),a({name:"plugin-list"},v),a({name:"plugin-list-all"},b),a({name:"plugin-remove"},h),a({name:"plugin-update"},S),{name:"install",description:"Install plugin at stated version, or all from .tools-versions",args:[{name:"name",generators:r(),isOptional:!0},{name:"version",suggestions:[{name:"latest",isDangerous:!0}],generators:_(void 0,{getQueryTerm:n=>n.includes("latest")?n.slice(n.indexOf(":")+1):n}),isOptional:!0}]},{name:"uninstall",description:"Remove a specific version of a package",args:[{name:"name",generators:r({isDangerous:!0})},{name:"version",generators:t({isDangerous:!0}),isOptional:!0}]},{name:"current",description:"Display current versions for named package (else all)",args:{name:"name",isOptional:!0,generators:r()}},{name:"where",description:"Display install path for given package at optional specified version",args:[{name:"name",generators:r()},{name:"version",generators:t(),isOptional:!0}]},{name:"which",description:"Display path to an executable",args:{name:"command",generators:g()}},{name:"local",description:"Set package local version",args:[{name:"name",generators:r()},{name:"version",generators:t()}]},{name:"global",description:"Set package global version",args:[{name:"name",generators:r()},{name:"version",generators:t()}]},{name:"shell",description:"Set the package version to ASDF_${LANG}_VERSION` in the current shell",args:[{name:"name",generators:r()},{name:"version",generators:t()}]},{name:"latest",description:"Display latest version available to install for a named package",args:[{name:"name",generators:r()},{name:"version",generators:t(),isOptional:!0}]},{name:"list",description:"List installed versions of a package",args:{name:"name",generators:r()},subcommands:[a({name:"all",priority:76+1},P)]},a({name:"list-all"},P),{name:"help",description:"Output documentation for plugin and tool",args:[{name:"name",generators:r()},{name:"version",generators:t(),isOptional:!0}]},{name:"exec",description:"Executes the command shim for the current version",args:{name:"command",generators:g(),isCommand:!0}},{name:"env",description:"Prints or runs an executable under a command environment",args:{name:"command",generators:g()}},{name:"info",description:"Print os, shell and asdf debug information"},{name:"reshim",description:"Recreate shims for version of a package",args:[{name:"name",generators:r(),isOptional:!0},{name:"version",generators:t(),isOptional:!0}]},{name:"shim",description:"Shim management sub-commands",subcommands:[a({name:"versions"},R)]},a({name:"shim-versions"},R),{name:"update",description:"Update ASDF to the latest stable release (unless --head)",options:[{name:"--head",description:"Using HEAD commit",isDangerous:!0}]},{name:"version",description:"Version for asdf"}],options:[{name:"--version",description:"Version for asdf"},{name:["-h","--help"],description:"Help for asdf"}]},E=H;export{E as default};
