var s=(e,t,n)=>new Promise((i,o)=>{var a=r=>{try{d(n.next(r))}catch(m){o(m)}},p=r=>{try{d(n.throw(r))}catch(m){o(m)}},d=r=>r.done?i(r.value):Promise.resolve(r.value).then(a,p);d((n=n.apply(e,t)).next())});var u=()=>{let e;return t=>s(void 0,null,function*(){if(e)return e;try{let{stdout:n}=yield t({command:"curl",args:["-sfL","-H","Accept: application/json","https://start.spring.io/metadata/client"]});return e=JSON.parse(n),e}catch(n){return}})},g=u(),l={ttl:1e3*60*60*24},c=",",f={cache:l,getQueryTerm:e=>e.slice(e.lastIndexOf(c)+c.length),trigger:(e,t)=>e.lastIndexOf(c)!==t.lastIndexOf(c),custom:(e,t)=>s(void 0,null,function*(){var o;let n=yield g(t);if(!n)return[];let i=new Set((o=e[e.length-1])==null?void 0:o.split(c));return n.dependencies.values.flatMap(({values:a})=>a).filter(({id:a})=>!i.has(a)).sort((a,p)=>a.name.localeCompare(p.name)).map(a=>({name:a.id,displayName:a.name,description:a.description}))})},h={cache:l,custom:(e,t)=>s(void 0,null,function*(){let n=yield g(t);return n?n.bootVersion.values.map(i=>({name:i.id,displayName:i.name})):[]})},v={cache:l,custom:(e,t)=>s(void 0,null,function*(){let n=yield g(t);return n?n.javaVersion.values.map(i=>({name:i.id,displayName:i.name})):[]})},y={name:"spring",description:"The Spring Boot CLI is a command line tool that you can use to bootstrap a new project from start.spring.io or encode a password",icon:"https://start.spring.io/images/icon-48x48.png",subcommands:[{name:"init",description:"Initialize a new project using Spring Initializr",options:[{name:["-a","---artifact-id"],description:"Project coordinates",args:{name:"Name"}},{name:["-b","--boot-version"],description:"Spring Boot version",args:{name:"Version",generators:h,debounce:!0}},{name:"--build",description:"Build system to use",args:{name:"System",suggestions:["maven","gradle"],default:"maven"}},{name:["-d","--dependencies"],description:"Comma-separated list of dependency identifiers to include in the generated project",args:{name:"Dependencies",generators:f,isVariadic:!0,debounce:!0}},{name:"--description",description:"Project description",insertValue:"--description '{cursor}'",args:{name:"description"}},{name:["-f","--force"],description:"Force overwrite of existing files",isDangerous:!0},{name:"--format",description:"Format of the generated content",args:{name:"Format",suggestions:["build","project"],default:"build"}},{name:["-g","--group-id"],description:"Project coordinates",args:{name:"Group ID"}},{name:["-j","--java-version"],description:"Language level",args:{name:"Version",generators:v,debounce:!0}},{name:"--list",description:"List the capabilities of the service"},{name:["-n","--name"],description:"Project name",args:{name:"Name"}},{name:["-p","--packaging"],description:"Project packaging",args:{name:"Packaging",suggestions:["jar","war"]}},{name:"--package-name",description:"Package name",args:{name:"Name"}},{name:["-t","--type"],description:"Project type",args:{name:"Type",suggestions:[{name:"gradle-build",description:"Generate a Gradle build file"},{name:"gradle-project",description:"Generate a Gradle based project archive using the Groovy DSL"},{name:"gradle-project-kotlin",description:"Generate a Gradle based project archive using the Kotlin DSL"},{name:"maven-build",description:"Generate a Maven pom.xml"},{name:"maven-project",description:"Generate a Maven based project archive"}],default:"gradle-project"}},{name:"--target",description:"URL of the service to use",args:{name:"URL",default:"https://start.spring.io"}},{name:["-v","--version"],description:"Project version",args:{name:"Version"}},{name:["-x","--extract"],description:"Extract the project archive. Inferred if a location is specified without an extension"}]},{name:"encodepassword",description:"Encode a password for use with Spring Security",options:[{name:["-a","--algorithm"],description:"The algorithm to use",args:{name:"Algorithm",suggestions:["default","bcrypt","pbkdf2"],default:"default"}}],args:{name:"Password"}},{name:"shell",description:"Start a nested shell"},{name:"help",description:"Show help for other commands",args:{name:"Command",template:"help"}}],options:[{name:"--help",description:"Show help for spring"},{name:"--version",description:"Get spring CLI version"},{name:"--debug",description:"Print additional status information for the command you are running",isPersistent:!0}]},b=y;export{b as default};
