@meistrari/tela-cli 0.5.0 → 0.7.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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/tela-cli",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "tela": "cli.ts"
@@ -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/ink/bark.tsx CHANGED
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource react */
1
2
  import { existsSync, mkdtempSync, rmSync } from 'node:fs'
2
3
  import { tmpdir } from 'node:os'
3
4
  import { join } from 'node:path'
@@ -237,4 +238,4 @@ export function BarkIntroScreen(props: {
237
238
  <Text dimColor>Preparing the workflow…</Text>
238
239
  </AppFrame>
239
240
  )
240
- }
241
+ }
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource react */
1
2
  import React, { useEffect, useMemo, useState, type ReactNode } from 'react'
2
3
  import { Box, Text } from 'ink'
3
4
  import { getTelaAsciiHeader } from '../ui.ts'
@@ -174,4 +175,4 @@ export function Callout(props: {
174
175
  return (
175
176
  <Text color={color[props.tone]}>{props.children}</Text>
176
177
  )
177
- }
178
+ }
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource react */
1
2
  import React from 'react'
2
3
  import { render, type Instance, type RenderOptions } from 'ink'
3
4
 
@@ -86,4 +87,4 @@ export function renderCommandScreen<T>(
86
87
  ...renderOptions,
87
88
  })
88
89
  })
89
- }
90
+ }
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource react */
1
2
  import React, { useEffect, useMemo, useState } from 'react'
2
3
  import { Box, Text, useInput } from 'ink'
3
4
  import type {
@@ -391,4 +392,4 @@ export function FeedbackOutcomeScreen(props: {
391
392
  </Section>
392
393
  </AppFrame>
393
394
  )
394
- }
395
+ }
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource react */
1
2
  import React, { useEffect, useRef, useState } from 'react'
2
3
  import { Text, useInput } from 'ink'
3
4
  import type { PushPreview } from '../../commands/push.ts'
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource react */
1
2
  import React, { useEffect, useMemo, useRef, useState } from 'react'
2
3
  import { Box, Text, useInput } from 'ink'
3
4
  import type {
@@ -288,4 +289,4 @@ export function RunChatHandoffScreen(props: RunChatHandoffScreenProps): React.Re
288
289
  </Callout>
289
290
  </AppFrame>
290
291
  )
291
- }
292
+ }
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource react */
1
2
  import React from 'react'
2
3
  import { Box, Text } from 'ink'
3
4
 
@@ -20,4 +21,4 @@ export function Breadcrumb(props: { entries: BreadcrumbEntry[] }): React.ReactEl
20
21
  ))}
21
22
  </Box>
22
23
  )
23
- }
24
+ }
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource react */
1
2
  import React, { useEffect, useMemo, useRef, useState } from 'react'
2
3
  import { useInput } from 'ink'
3
4
  import { ENVIRONMENT_PRESET_OPTIONS, resolveEnvironmentConfigForPreset } from '../../../config.ts'
@@ -608,4 +609,4 @@ function validateStep(
608
609
  case 'sshPrivateKeyPath':
609
610
  return validateSshPrivateKeyPath(values.sshPrivateKeyPath)
610
611
  }
611
- }
612
+ }
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource react */
1
2
  import React, { type ReactNode } from 'react'
2
3
  import { AppFrame, Section } from '../../components.tsx'
3
4
  import { Breadcrumb, type BreadcrumbEntry } from './breadcrumb.tsx'
@@ -27,4 +28,4 @@ export function StepFrame(props: StepFrameProps): React.ReactElement {
27
28
  </Section>
28
29
  </AppFrame>
29
30
  )
30
- }
31
+ }
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource react */
1
2
  import React from 'react'
2
3
  import { Text } from 'ink'
3
4
  import { AppFrame, Section } from '../../../components.tsx'
@@ -25,4 +26,4 @@ export function DoneStep(props: { result: SetupScreenResult }): React.ReactEleme
25
26
  </Section>
26
27
  </AppFrame>
27
28
  )
28
- }
29
+ }
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource react */
1
2
  import React from 'react'
2
3
  import { ENVIRONMENT_PRESET_OPTIONS } from '../../../../config.ts'
3
4
  import { SelectList } from '../../../components.tsx'
@@ -19,4 +20,4 @@ export function EnvironmentStep(props: { values: SetupFormValues }): React.React
19
20
  currentIndex={currentIndex}
20
21
  />
21
22
  )
22
- }
23
+ }
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource react */
1
2
  import React from 'react'
2
3
  import { Text } from 'ink'
3
4
  import { AppFrame, Section, SelectList } from '../../../components.tsx'
@@ -31,4 +32,4 @@ export function OrganizationStep(props: {
31
32
  </Section>
32
33
  </AppFrame>
33
34
  )
34
- }
35
+ }
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource react */
1
2
  import React from 'react'
2
3
  import { Text } from 'ink'
3
4
  import { DEVICE_FLOW_BROWSER_HELP } from '../../../../config.ts'
@@ -74,4 +75,4 @@ export function ReviewStep(props: {
74
75
  ) : null}
75
76
  </AppFrame>
76
77
  )
77
- }
78
+ }
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource react */
1
2
  import React from 'react'
2
3
  import { Text } from 'ink'
3
4
  import { DEVICE_FLOW_BROWSER_HELP } from '../../../../config.ts'
@@ -33,4 +34,4 @@ export function RunningStep(props: {
33
34
  {!provisioning ? <Callout tone="info">{DEVICE_FLOW_BROWSER_HELP}</Callout> : null}
34
35
  </AppFrame>
35
36
  )
36
- }
37
+ }
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource react */
1
2
  import React from 'react'
2
3
  import { Callout, SelectList } from '../../../components.tsx'
3
4
  import type { SelectedSshPublicKey } from '../../../../forgejo.ts'
@@ -44,4 +45,4 @@ export function SshKeyStep(props: {
44
45
  ) : null}
45
46
  </>
46
47
  )
47
- }
48
+ }
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource react */
1
2
  import React from 'react'
2
3
  import { TextEntry } from '../../../components.tsx'
3
4
 
@@ -14,4 +15,4 @@ export function TextFieldStep(props: {
14
15
  error={props.error}
15
16
  />
16
17
  )
17
- }
18
+ }
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource react */
1
2
  import React, { useEffect, useMemo, useRef, useState } from 'react'
2
3
  import { Box, Text, useInput } from 'ink'
3
4
  import type { BatchSyncFailure, SyncResult } from '../../types.ts'
@@ -279,4 +280,4 @@ export function SyncScreen(props: SyncScreenProps): React.ReactElement {
279
280
  ) : null}
280
281
  </AppFrame>
281
282
  )
282
- }
283
+ }
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
@@ -0,0 +1,3 @@
1
+ import packageJson from '../package.json' with { type: 'json' }
2
+
3
+ export const CLI_VERSION = packageJson.version