@@ -14,7 +14,11 @@ import { logger } from './utils/logger';
1414 * Wraps a command execution with error handling
1515 */
1616// eslint-disable-next-line @typescript-eslint/ban-types
17- async function wrapCommand ( command : Function , options : Record < string , unknown > ) {
17+ async function wrapCommand (
18+ // eslint-disable-next-line @typescript-eslint/ban-types
19+ command : Function ,
20+ options : Record < string , unknown > ,
21+ ) {
1822 options . cwd = options . cwd || process . cwd ( ) ;
1923
2024 try {
@@ -43,9 +47,13 @@ export function bootstrapCli() {
4347 cli
4448 . command ( 'd' , 'Quickly launch on-demand development build for monorepo' )
4549 . alias ( 'dev' )
46- . option ( '--exclude <packages>' , 'Comma-separated list of packages to exclude' , {
47- default : '' ,
48- } )
50+ . option (
51+ '--exclude <packages>' ,
52+ 'Comma-separated list of packages to exclude' ,
53+ {
54+ default : '' ,
55+ } ,
56+ )
4957 . option (
5058 '--packages, --pkg <packages>' ,
5159 'Comma-separated list of packages to start by default' ,
@@ -87,46 +95,70 @@ export function bootstrapCli() {
8795 . option ( '--run-in-band' , 'Whether to publish package in series' , {
8896 default : false ,
8997 } )
90- . option ( '--ignore-scripts' , 'Ignore npm scripts during release and patch process' , {
91- default : false ,
92- } )
98+ . option (
99+ '--ignore-scripts' ,
100+ 'Ignore npm scripts during release and patch process' ,
101+ {
102+ default : false ,
103+ } ,
104+ )
93105 . option ( '--tag-prefix <prefix>' , 'Prefix for git tags' , {
94106 default : 'v' ,
95107 } )
96- . option ( '--canary' , 'Skip version/tag selection and auto-generate canary version' , {
97- default : false ,
98- } )
108+ . option (
109+ '--canary' ,
110+ 'Skip version/tag selection and auto-generate canary version' ,
111+ {
112+ default : false ,
113+ } ,
114+ )
99115 . option ( '--use-ai' , 'Use AI to generate changelog' , {
100116 default : false ,
101117 } )
102118 . option ( '--provider <provider>' , 'LLM provider to use (default: openai)' )
103119 . option ( '--model <model>' , 'LLM model to use (default: gpt-4o)' )
104120 . option ( '--apiKey, --api-key <apiKey>' , 'Custom API key for LLM' )
105121 . option ( '--baseURL, --base-url <baseURL>' , 'Custom base URL for LLM' )
106- . option ( '--filter-scopes <scopes>' , 'Comma-separated list of scopes to include in changelog' , {
107- default : 'tars,agent,tarko,o-agent,tars-stack,browser,infra,mcp,all' ,
108- } )
122+ . option (
123+ '--filter-scopes <scopes>' ,
124+ 'Comma-separated list of scopes to include in changelog' ,
125+ {
126+ default : 'tars,agent,tarko,o-agent,tars-stack,browser,infra,mcp,all' ,
127+ } ,
128+ )
109129 . option (
110130 '--filter-types <types>' ,
111131 'Comma-separated list of commit types to include in changelog' ,
112132 {
113133 default : 'feat,fix' ,
114134 } ,
115135 )
116- . option ( '--create-github-release' , 'Create GitHub release after successful release' , {
117- default : false ,
118- } )
119- . option ( '--auto-create-release-branch' , 'Automatically create release branch before release' , {
120- default : false ,
121- } )
136+ . option (
137+ '--create-github-release' ,
138+ 'Create GitHub release after successful release' ,
139+ {
140+ default : false ,
141+ } ,
142+ )
143+ . option (
144+ '--auto-create-release-branch' ,
145+ 'Automatically create release branch before release' ,
146+ {
147+ default : false ,
148+ } ,
149+ )
122150 . alias ( 'release' )
123151 . action ( ( opts ) => {
124152 // Process filter options
125153 if ( opts . filterScopes ) {
126- opts . filterScopes = opts . filterScopes . split ( ',' ) . map ( ( s : string ) => s . trim ( ) ) ;
154+ opts . filterScopes = opts . filterScopes
155+ . split ( ',' )
156+ . map ( ( s : string ) => s . trim ( ) ) ;
127157 }
128158 if ( opts . filterTypes && opts . filterTypes . trim ( ) ) {
129- opts . filterTypes = opts . filterTypes . split ( ',' ) . map ( ( s : string ) => s . trim ( ) ) ;
159+ opts . filterTypes = opts . filterTypes
160+ . split ( ',' )
161+ . map ( ( s : string ) => s . trim ( ) ) ;
130162 } else {
131163 opts . filterTypes = [ ] ;
132164 }
@@ -136,9 +168,13 @@ export function bootstrapCli() {
136168 // Patch command
137169 cli
138170 . command ( 'p' , 'Patch the failure of release process' )
139- . option ( '--patch-version <version>' , 'Version (e.g. 1.0.0, 2.0.0-alpha.9)' , {
140- // There is no default value here, because the default is read from package.json
141- } )
171+ . option (
172+ '--patch-version <version>' ,
173+ 'Version (e.g. 1.0.0, 2.0.0-alpha.9)' ,
174+ {
175+ // There is no default value here, because the default is read from package.json
176+ } ,
177+ )
142178 . option ( '--tag <tag>' , 'Tag (e.g. latest, next, beta)' )
143179 . option ( '--run-in-band' , 'Whether to publish package in series' , {
144180 default : false ,
@@ -158,6 +194,9 @@ export function bootstrapCli() {
158194 // Changelog command
159195 cli
160196 . command ( 'changelog' , 'Create changelog' )
197+ . option ( '--dry-run' , 'Preview execution without making changes' , {
198+ default : false ,
199+ } )
161200 . option ( '--changelog-version <version>' , 'Version' , {
162201 // There is no default value here, because the default is read from package.json
163202 } )
@@ -186,9 +225,13 @@ export function bootstrapCli() {
186225 . option ( '--model <model>' , 'LLM model to use (default: gpt-4o)' )
187226 . option ( '--apiKey, --api-key <apiKey>' , 'Custom API key for LLM' )
188227 . option ( '--baseURL, --base-url <baseURL>' , 'Custom base URL for LLM' )
189- . option ( '--filter-scopes <scopes>' , 'Comma-separated list of scopes to include in changelog' , {
190- default : 'tars,agent,tarko,o-agent,tars-stack,browser,infra,mcp,all' ,
191- } )
228+ . option (
229+ '--filter-scopes <scopes>' ,
230+ 'Comma-separated list of scopes to include in changelog' ,
231+ {
232+ default : 'tars,agent,tarko,o-agent,tars-stack,browser,infra,mcp,all' ,
233+ } ,
234+ )
192235 . option (
193236 '--filter-types <types>' ,
194237 'Comma-separated list of commit types to include in changelog' ,
@@ -203,10 +246,14 @@ export function bootstrapCli() {
203246 }
204247 // Process filter options
205248 if ( opts . filterScopes ) {
206- opts . filterScopes = opts . filterScopes . split ( ',' ) . map ( ( s : string ) => s . trim ( ) ) ;
249+ opts . filterScopes = opts . filterScopes
250+ . split ( ',' )
251+ . map ( ( s : string ) => s . trim ( ) ) ;
207252 }
208253 if ( opts . filterTypes && opts . filterTypes . trim ( ) ) {
209- opts . filterTypes = opts . filterTypes . split ( ',' ) . map ( ( s : string ) => s . trim ( ) ) ;
254+ opts . filterTypes = opts . filterTypes
255+ . split ( ',' )
256+ . map ( ( s : string ) => s . trim ( ) ) ;
210257 } else {
211258 opts . filterTypes = [ ] ;
212259 }
0 commit comments