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

Function registerExportCommand

apps/kimi-code/src/cli/sub/export.ts:107–129  ·  view source on GitHub ↗
(parent: Command, deps?: Partial<ExportDeps>)

Source from the content-addressed store, hash-verified

105}
106
107export function registerExportCommand(parent: Command, deps?: Partial<ExportDeps>): void {
108 parent
109 .command('export')
110 .description('Export a session as a ZIP archive.')
111 .option('-o, --output <path>', 'Output ZIP path.')
112 .option('-y, --yes', 'Skip previous-session confirmation.')
113 .option(
114 '--no-include-global-log',
115 'Skip bundling the active global diagnostic log (~/.kimi-code/logs/kimi-code.log, not rotated .1 files). By default the global log is included.',
116 )
117 .argument('[sessionId]', 'Session id to export. Defaults to the most recent session.')
118 .action(
119 async (
120 sessionId: string | undefined,
121 options: { output?: string; yes?: boolean; includeGlobalLog?: boolean },
122 ) => {
123 await handleExport(createDefaultExportDeps(deps), sessionId, options.output, {
124 yes: options.yes === true,
125 includeGlobalLog: options.includeGlobalLog !== false,
126 });
127 },
128 );
129}
130
131function createDefaultExportDeps(overrides: Partial<ExportDeps> = {}): ExportDeps {
132 let harness: KimiHarness | undefined;

Callers 3

export.test.tsFile · 0.90
runKimiExportFunction · 0.90
createProgramFunction · 0.90

Calls 2

handleExportFunction · 0.85
createDefaultExportDepsFunction · 0.85

Tested by 1

runKimiExportFunction · 0.72