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

Function registerPsCommand

apps/kimi-code/src/cli/sub/server/ps.ts:39–52  ·  view source on GitHub ↗
(server: Command)

Source from the content-addressed store, hash-verified

37const USER_AGENT_MAX_WIDTH = 40;
38
39export function registerPsCommand(server: Command): void {
40 server
41 .command('ps')
42 .description('List clients currently connected to the running Kimi server.')
43 .option('--json', 'Print the raw connection list as JSON.')
44 .action(async (opts: { json?: boolean }) => {
45 try {
46 await handlePsCommand(opts);
47 } catch (error) {
48 process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
49 process.exit(1);
50 }
51 });
52}
53
54async function handlePsCommand(opts: { json?: boolean }): Promise<void> {
55 const lock = getLiveLock();

Callers 1

registerServerCommandFunction · 0.90

Calls 3

handlePsCommandFunction · 0.85
writeMethod · 0.65
exitMethod · 0.65

Tested by

no test coverage detected