@meistrari/tela-cli 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/package.json +1 -1
- package/src/commands/metadata.ts +6 -0
- package/src/program.ts +25 -0
- package/src/version.ts +3 -0
package/README.md
CHANGED
|
@@ -26,6 +26,12 @@ Examples:
|
|
|
26
26
|
- `tela` — Render the available repositories in a human-readable table
|
|
27
27
|
- `tela --json` — Emit the available repositories as JSON
|
|
28
28
|
|
|
29
|
+
## Version
|
|
30
|
+
|
|
31
|
+
Examples:
|
|
32
|
+
- `tela --version` — Print the current Tela CLI version
|
|
33
|
+
- `tela -v` — Print the current Tela CLI version
|
|
34
|
+
|
|
29
35
|
## Commands
|
|
30
36
|
|
|
31
37
|
### `setup`
|
package/package.json
CHANGED
package/src/commands/metadata.ts
CHANGED
|
@@ -188,6 +188,12 @@ export function renderReadmeMarkdown(): string {
|
|
|
188
188
|
'- `tela` — Render the available repositories in a human-readable table',
|
|
189
189
|
'- `tela --json` — Emit the available repositories as JSON',
|
|
190
190
|
'',
|
|
191
|
+
'## Version',
|
|
192
|
+
'',
|
|
193
|
+
'Examples:',
|
|
194
|
+
'- `tela --version` — Print the current Tela CLI version',
|
|
195
|
+
'- `tela -v` — Print the current Tela CLI version',
|
|
196
|
+
'',
|
|
191
197
|
'## Commands',
|
|
192
198
|
'',
|
|
193
199
|
]
|
package/src/program.ts
CHANGED
|
@@ -108,6 +108,7 @@ import {
|
|
|
108
108
|
stepList,
|
|
109
109
|
table,
|
|
110
110
|
} from './ui.ts'
|
|
111
|
+
import { CLI_VERSION } from './version.ts'
|
|
111
112
|
|
|
112
113
|
type PromptModule = FeedbackPromptModule
|
|
113
114
|
|
|
@@ -286,6 +287,7 @@ function renderRootHelp(program: Command): string {
|
|
|
286
287
|
['Flag', 'Description'],
|
|
287
288
|
[
|
|
288
289
|
['--verbose', 'Include raw evidence for failures where available'],
|
|
290
|
+
['-v, --version', 'Show current Tela CLI version'],
|
|
289
291
|
['-h, --help', 'Show command help'],
|
|
290
292
|
],
|
|
291
293
|
renderOptions,
|
|
@@ -335,6 +337,27 @@ function installCustomHelp(program: Command): void {
|
|
|
335
337
|
})
|
|
336
338
|
}
|
|
337
339
|
|
|
340
|
+
function installCommanderOutput(program: Command, deps: CliDeps): void {
|
|
341
|
+
program.configureOutput({
|
|
342
|
+
writeOut: (message) => {
|
|
343
|
+
if (deps.writeStdout) {
|
|
344
|
+
deps.writeStdout(message)
|
|
345
|
+
return
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
process.stdout.write(message)
|
|
349
|
+
},
|
|
350
|
+
writeErr: (message) => {
|
|
351
|
+
if (deps.writeStderr) {
|
|
352
|
+
deps.writeStderr(message)
|
|
353
|
+
return
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
process.stderr.write(message)
|
|
357
|
+
},
|
|
358
|
+
})
|
|
359
|
+
}
|
|
360
|
+
|
|
338
361
|
function emitBootstrap(runtime: CommandRuntime, title: string, summary: string): void {
|
|
339
362
|
runtime.emit(bootstrapPane(title, summary, { decorate: runtime.decorate }))
|
|
340
363
|
}
|
|
@@ -1968,8 +1991,10 @@ export function createProgram(deps: CliDeps = {}): Command {
|
|
|
1968
1991
|
.name('tela')
|
|
1969
1992
|
.description('Tela CLI workspace and auth helper')
|
|
1970
1993
|
.showHelpAfterError()
|
|
1994
|
+
.version(CLI_VERSION, '-v, --version', 'show current Tela CLI version')
|
|
1971
1995
|
.option('--verbose', 'include raw evidence on failures')
|
|
1972
1996
|
|
|
1997
|
+
installCommanderOutput(program, deps)
|
|
1973
1998
|
installCustomHelp(program)
|
|
1974
1999
|
|
|
1975
2000
|
addStandardReadOptions(program).action(async (commandOptions: GlobalCliOptions) => {
|
package/src/version.ts
ADDED