File tree 4 files changed +15
-3
lines changed
4 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ npx ai-markdown-translator -i input.md -o output.md -l "Italian"
142
142
143
143
## 版本信息
144
144
145
- - ** 当前版本** :1.0.4
145
+ - ** 当前版本** :1.0.5
146
146
- ** NPM包** :[ ai-markdown-translator] ( https://www.npmjs.com/package/ai-markdown-translator )
147
147
148
148
## CI信息
Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ npx ai-markdown-translator -i input.md -o output.md -l "Italian"
142
142
143
143
## Version Information
144
144
145
- - ** Current Version** : 1.0.4
145
+ - ** Current Version** : 1.0.5
146
146
- ** NPM Package** : [ ai-markdown-translator] ( https://www.npmjs.com/package/ai-markdown-translator )
147
147
148
148
## CI Information
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " ai-markdown-translator" ,
3
- "version" : " 1.0.4 " ,
3
+ "version" : " 1.0.5 " ,
4
4
"description" : " CLI tool to translate Markdown files using OpenAI's language models while preserving the original formatting." ,
5
5
"main" : " dist/index.js" ,
6
6
"type" : " module" ,
Original file line number Diff line number Diff line change @@ -256,9 +256,21 @@ async function main() {
256
256
type : 'string' ,
257
257
default : process . env . MODEL || 'gpt-4o-mini' ,
258
258
} )
259
+ . option ( 'version' , {
260
+ alias : 'v' ,
261
+ description : '显示版本号' ,
262
+ type : 'boolean' ,
263
+ } )
259
264
. help ( )
260
265
. alias ( 'help' , 'h' ) . argv ;
261
266
267
+ if ( argv . version ) {
268
+ const packageJsonPath = path . join ( __dirname , '..' , 'package.json' ) ;
269
+ const packageJson = JSON . parse ( fs . readFileSync ( packageJsonPath , 'utf-8' ) ) ;
270
+ console . log ( `版本号: ${ packageJson . version } ` ) ;
271
+ process . exit ( 0 ) ;
272
+ }
273
+
262
274
try {
263
275
if ( ! argv [ 'openai-url' ] ) {
264
276
throw new Error ( '需要提供OpenAI URL。请通过--openai-url参数或OPENAI_URL环境变量提供。' ) ;
You can’t perform that action at this time.
0 commit comments