MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / registerVisCommand

Function registerVisCommand

apps/kimi-code/src/cli/sub/vis.ts:103–125  ·  view source on GitHub ↗
(parent: Command, overrides?: Partial<VisDeps>)

Source from the content-addressed store, hash-verified

101}
102
103export function registerVisCommand(parent: Command, overrides?: Partial<VisDeps>): void {
104 parent
105 .command('vis')
106 .description('Launch the session visualizer in your browser.')
107 .option('--port <number>', 'Port to bind. Default: auto-pick a free port.')
108 .option('--host <host>', 'Host to bind. Default: 127.0.0.1.')
109 .option('--no-open', 'Do not open the browser automatically.')
110 .argument('[sessionId]', 'Open directly to this session.')
111 .action(
112 async (
113 sessionId: string | undefined,
114 options: { port?: string; host?: string; open?: boolean },
115 ) => {
116 const port = options.port === undefined ? undefined : Number.parseInt(options.port, 10);
117 await handleVis(createDefaultVisDeps(overrides), {
118 open: options.open !== false,
119 ...(port === undefined || Number.isNaN(port) ? {} : { port }),
120 ...(options.host === undefined ? {} : { host: options.host }),
121 ...(sessionId === undefined ? {} : { sessionId }),
122 });
123 },
124 );
125}
126
127function createDefaultVisDeps(overrides: Partial<VisDeps> = {}): VisDeps {
128 return {

Callers 1

createProgramFunction · 0.90

Calls 2

handleVisFunction · 0.85
createDefaultVisDepsFunction · 0.85

Tested by

no test coverage detected