File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88## [ Unreleased]
99
1010### 2026-04-03
11+ - ** Feat** : ` geonic cli update ` コマンドを追加 — ` npm update -g ` のエイリアスとして CLI を最新版に更新可能に (#94 )
1112- ** Fix** : 複数ターミナルで同一プロファイルを使用時、refresh token rotation によりセッションが無効化される問題を修正 — トークンリフレッシュ前に config を再読み込みし、別プロセスが既にリフレッシュ済みならそのトークンを使用する (#93 )
1213
1314## [ 0.9.0] - 2026-03-25
Original file line number Diff line number Diff line change 1+ import { execSync } from "node:child_process" ;
12import { createRequire } from "node:module" ;
23import type { Command , Option } from "commander" ;
4+ import { printInfo , printSuccess } from "../output.js" ;
5+ import { withErrorHandler , resolveOptions } from "../helpers.js" ;
36import { addExamples } from "./help.js" ;
47
58function findOption (
@@ -275,4 +278,29 @@ export function registerCliCommand(program: Command): void {
275278 command : "geonic cli version" ,
276279 } ,
277280 ] ) ;
281+
282+ const update = cli
283+ . command ( "update" )
284+ . description ( "Update the CLI to the latest version" )
285+ . action (
286+ withErrorHandler ( async ( ...args : unknown [ ] ) => {
287+ const cmd = args [ args . length - 1 ] as Command ;
288+ const opts = resolveOptions ( cmd ) ;
289+ const updateCommand = "npm update -g @geolonia/geonicdb-cli" ;
290+ if ( opts . dryRun ) {
291+ printInfo ( `[dry-run] ${ updateCommand } ` ) ;
292+ return ;
293+ }
294+ printInfo ( "Updating @geolonia/geonicdb-cli..." ) ;
295+ execSync ( updateCommand , { stdio : "inherit" } ) ;
296+ printSuccess ( "Update complete." ) ;
297+ } ) ,
298+ ) ;
299+
300+ addExamples ( update , [
301+ {
302+ description : "Update CLI to the latest version" ,
303+ command : "geonic cli update" ,
304+ } ,
305+ ] ) ;
278306}
You can’t perform that action at this time.
0 commit comments