@@ -25,9 +25,12 @@ const cancel = new AbortController()
2525
2626const cli = yargs ( hideBin ( process . argv ) )
2727 . scriptName ( "opencode" )
28- . version ( Installation . VERSION )
28+ . help ( "help" , "show help" )
29+ . alias ( "help" , "h" )
30+ . version ( "version" , "show version number" , Installation . VERSION )
31+ . alias ( "version" , "v" )
2932 . option ( "print-logs" , {
30- describe : "Print logs to stderr" ,
33+ describe : "print logs to stderr" ,
3134 type : "boolean" ,
3235 } )
3336 . middleware ( async ( ) => {
@@ -40,7 +43,7 @@ const cli = yargs(hideBin(process.argv))
4043 . usage ( "\n" + UI . logo ( ) )
4144 . command ( {
4245 command : "$0 [project]" ,
43- describe : "start opencode TUI " ,
46+ describe : "start opencode tui " ,
4447 builder : ( yargs ) =>
4548 yargs . positional ( "project" , {
4649 type : "string" ,
@@ -89,21 +92,21 @@ const cli = yargs(hideBin(process.argv))
8992 } ,
9093 } )
9194
92- ; ( async ( ) => {
93- if ( Installation . VERSION === "dev" ) return
94- if ( Installation . isSnapshot ( ) ) return
95- const config = await Config . global ( )
96- if ( config . autoupdate === false ) return
97- const latest = await Installation . latest ( )
98- if ( Installation . VERSION === latest ) return
99- const method = await Installation . method ( )
100- if ( method === "unknown" ) return
101- await Installation . upgrade ( method , latest )
102- . then ( ( ) => {
103- Bus . publish ( Installation . Event . Updated , { version : latest } )
104- } )
105- . catch ( ( ) => { } )
106- } ) ( )
95+ ; ( async ( ) => {
96+ if ( Installation . VERSION === "dev" ) return
97+ if ( Installation . isSnapshot ( ) ) return
98+ const config = await Config . global ( )
99+ if ( config . autoupdate === false ) return
100+ const latest = await Installation . latest ( )
101+ if ( Installation . VERSION === latest ) return
102+ const method = await Installation . method ( )
103+ if ( method === "unknown" ) return
104+ await Installation . upgrade ( method , latest )
105+ . then ( ( ) => {
106+ Bus . publish ( Installation . Event . Updated , { version : latest } )
107+ } )
108+ . catch ( ( ) => { } )
109+ } ) ( )
107110
108111 await proc . exited
109112 server . stop ( )
0 commit comments