11#!/usr/bin/env bun
22/**
3- * Dora CLI - Entry Point
3+ * Code CLI - Entry Point
44 *
55 * Commands:
6- * dora [serve] Start MCP server (default)
7- * dora format <file> Format a file
8- * dora lsp <file> Get LSP diagnostics for a file
9- * dora version Show version
6+ * code [serve] Start MCP server (default)
7+ * code format <file> Format a file
8+ * code lsp <file> Get LSP diagnostics for a file
9+ * code version Show version
1010 *
1111 * Hook mode (--stdin):
12- * dora format --stdin Read hook input from stdin
13- * dora lsp --stdin Read hook input from stdin
12+ * code format --stdin Read hook input from stdin
13+ * code lsp --stdin Read hook input from stdin
1414 */
1515
1616import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
@@ -81,13 +81,13 @@ async function readStdinJson(): Promise<HookInput> {
8181}
8282
8383async function serveCommand ( projectPath : string , timeout : number ) : Promise < void > {
84- console . error ( `[dora ] Starting MCP server for project: ${ projectPath } ` )
84+ console . error ( `[code ] Starting MCP server for project: ${ projectPath } ` )
8585
8686 const server = await createDoraServer ( { projectPath, timeout } )
8787 const transport = new StdioServerTransport ( )
8888
8989 await server . connect ( transport )
90- console . error ( "[dora ] MCP server connected and ready" )
90+ console . error ( "[code ] MCP server connected and ready" )
9191}
9292
9393async function formatCommand ( filePath : string , projectDir : string , isHookMode : boolean ) : Promise < void > {
@@ -118,7 +118,7 @@ async function lspCommand(filePath: string, projectDir: string, isHookMode: bool
118118 console . log ( JSON . stringify ( {
119119 hookSpecificOutput : {
120120 hookEventName : "PostToolUse" ,
121- additionalContext : `[dora lsp]: ${ report } ` ,
121+ additionalContext : `[code lsp]: ${ report } ` ,
122122 } ,
123123 } ) )
124124 } else {
@@ -131,15 +131,15 @@ async function lspCommand(filePath: string, projectDir: string, isHookMode: bool
131131}
132132
133133function versionCommand ( ) : void {
134- console . log ( `dora ${ VERSION } ` )
134+ console . log ( `code ${ VERSION } ` )
135135}
136136
137137function helpCommand ( ) : void {
138138 console . log ( `
139- dora - MCP server for JetBrains IDE integration
139+ code - MCP server and CLI for AI-assisted coding
140140
141141Usage:
142- dora [command] [options]
142+ code [command] [options]
143143
144144Commands:
145145 serve Start MCP server (default)
@@ -153,8 +153,8 @@ Options:
153153 --timeout=<ms> Request timeout in ms (default: 30000)
154154
155155Environment:
156- DORA_PROJECT_PATH Project path
157- DORA_TIMEOUT Request timeout in ms
156+ CODE_PROJECT_PATH Project path
157+ CODE_TIMEOUT Request timeout in ms
158158` )
159159}
160160
@@ -163,13 +163,13 @@ async function main(): Promise<void> {
163163
164164 const projectDir =
165165 ( flags [ "project" ] as string ) ??
166- process . env [ "DORA_PROJECT_PATH " ] ??
166+ process . env [ "CODE_PROJECT_PATH " ] ??
167167 process . cwd ( )
168168
169169 const timeout = flags [ "timeout" ]
170170 ? parseInt ( flags [ "timeout" ] as string , 10 )
171- : process . env [ "DORA_TIMEOUT " ]
172- ? parseInt ( process . env [ "DORA_TIMEOUT " ] , 10 )
171+ : process . env [ "CODE_TIMEOUT " ]
172+ ? parseInt ( process . env [ "CODE_TIMEOUT " ] , 10 )
173173 : 30000
174174
175175 switch ( command ) {
@@ -192,7 +192,7 @@ async function main(): Promise<void> {
192192 }
193193
194194 if ( ! file ) {
195- console . error ( "Usage: dora format <file> | dora format --stdin" )
195+ console . error ( "Usage: code format <file> | code format --stdin" )
196196 process . exit ( 1 )
197197 }
198198 await formatCommand ( file , dir , isHookMode )
@@ -214,7 +214,7 @@ async function main(): Promise<void> {
214214 }
215215
216216 if ( ! file ) {
217- console . error ( "Usage: dora lsp <file> | dora lsp --stdin" )
217+ console . error ( "Usage: code lsp <file> | code lsp --stdin" )
218218 process . exit ( 1 )
219219 }
220220 await lspCommand ( file , dir , isHookMode )
@@ -241,6 +241,6 @@ async function main(): Promise<void> {
241241}
242242
243243main ( ) . catch ( ( error ) => {
244- console . error ( "[dora ] Error:" , error )
244+ console . error ( "[code ] Error:" , error )
245245 process . exit ( 1 )
246246} )
0 commit comments