@@ -40,6 +40,7 @@ import { type ComponentGetOptions } from "./component/get.ts";
4040import { type ComponentUpdateOptions } from "./component/update.ts" ;
4141import { type ComponentDeleteOptions } from "./component/delete.ts" ;
4242import { type ComponentSearchOptions } from "./component/search.ts" ;
43+ import { callTui } from "./command/tui.ts" ;
4344
4445/** Current version of the SI CLI */
4546const VERSION = "0.1.0" ;
@@ -175,7 +176,9 @@ function buildCommand() {
175176 // deno-lint-ignore no-explicit-any
176177 . command ( "template" , buildTemplateCommand ( ) as any )
177178 // deno-lint-ignore no-explicit-any
178- . command ( "whoami" , buildWhoamiCommand ( ) as any ) ;
179+ . command ( "whoami" , buildWhoamiCommand ( ) as any )
180+ // deno-lint-ignore no-explicit-any
181+ . command ( "tui" , buildTuiCommand ( ) as any ) ;
179182}
180183
181184/**
@@ -267,7 +270,7 @@ function buildRemoteSchemaCommand() {
267270 "--builtins" ,
268271 "Include builtin schemas (schemas you don't own). By default, builtins are skipped." ,
269272 )
270- . action ( async ( { root, apiBaseUrl, apiToken, builtins } , ...schemaNames ) => {
273+ . action ( async ( { root, apiBaseUrl, apiToken } , ...schemaNames ) => {
271274 const project = createProject ( root ) ;
272275 const apiCtx = await createApiContext ( apiBaseUrl , apiToken ) ;
273276 let finalSchemaNames ;
@@ -282,7 +285,6 @@ function buildRemoteSchemaCommand() {
282285 project ,
283286 apiCtx ,
284287 finalSchemaNames ,
285- builtins ?? false ,
286288 ) ;
287289 } ) ,
288290 )
@@ -355,6 +357,22 @@ function buildWhoamiCommand() {
355357 } ) ;
356358}
357359
360+ /**
361+ * Builds the tui command.
362+ *
363+ * @returns A SubCommand to start the TUI
364+ * @internal
365+ */
366+ function buildTuiCommand ( ) {
367+ return createSubCommand ( )
368+ . description ( "Starts the TUI" )
369+ . action ( async ( { apiBaseUrl, apiToken } ) => {
370+ const apiCtx = await createApiContext ( apiBaseUrl , apiToken ) ;
371+
372+ await callTui ( Context . instance ( ) , apiCtx ) ;
373+ } ) ;
374+ }
375+
358376/**
359377 * Builds the project init subcommands.
360378 *
0 commit comments