Skip to content

Commit 74cc528

Browse files
committed
refactor: rename CLI from dora to code
- Update CLI output, help text, and usage messages - Rename env vars from DORA_* to CODE_* - Update documentation to reflect new naming - Update test expectations
1 parent 7efff53 commit 74cc528

4 files changed

Lines changed: 36 additions & 36 deletions

File tree

.claude/CLAUDE.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ bun run build:npm # Generate npm packages for distribution
2323
## CLI Commands
2424

2525
```bash
26-
dora serve # Start MCP server (default)
27-
dora format <file> # Format a file using configured formatters
28-
dora format --stdin # Format via Claude Code hook (JSON input)
29-
dora lsp <file> # Get LSP diagnostics for a file
30-
dora lsp --stdin # LSP diagnostics via Claude Code hook
31-
dora version # Show version
32-
dora help # Show help
26+
code serve # Start MCP server (default)
27+
code format <file> # Format a file using configured formatters
28+
code format --stdin # Format via Claude Code hook (JSON input)
29+
code lsp <file> # Get LSP diagnostics for a file
30+
code lsp --stdin # LSP diagnostics via Claude Code hook
31+
code version # Show version
32+
code help # Show help
3333
```
3434

3535
## Environment Variables
3636

37-
- `DORA_PROJECT_PATH` - Project path (defaults to argv[2] or cwd)
38-
- `DORA_TIMEOUT` - Request timeout in ms (default: 30000)
37+
- `CODE_PROJECT_PATH` - Project path (defaults to argv[2] or cwd)
38+
- `CODE_TIMEOUT` - Request timeout in ms (default: 30000)
3939
- `CLAUDE_PROJECT_DIR` - Used in hook mode to determine project directory
4040

4141
## Architecture

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ cp node_modules/@pleaseai/code/hooks/hooks.json .claude/
5555

5656
```bash
5757
# Format a file
58-
dora format src/index.ts
58+
code format src/index.ts
5959

6060
# Get LSP diagnostics
61-
dora lsp src/index.ts
61+
code lsp src/index.ts
6262

6363
# Start MCP server
64-
dora serve
64+
code serve
6565
```
6666

6767
## Configuration
@@ -129,8 +129,8 @@ dora serve --project=/path/to/project
129129

130130
| Variable | Description | Default |
131131
|----------|-------------|---------|
132-
| `DORA_PROJECT_PATH` | Project directory | cwd |
133-
| `DORA_TIMEOUT` | Request timeout (ms) | 30000 |
132+
| `CODE_PROJECT_PATH` | Project directory | cwd |
133+
| `CODE_TIMEOUT` | Request timeout (ms) | 30000 |
134134

135135
## Development
136136

packages/code/src/__tests__/cli.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe("CLI", () => {
99
describe("version", () => {
1010
test("prints version", async () => {
1111
const result = await $`bun run ${CLI_PATH} version`.text()
12-
expect(result).toMatch(/dora \d+\.\d+\.\d+/)
12+
expect(result).toMatch(/code \d+\.\d+\.\d+/)
1313
})
1414
})
1515

packages/code/src/cli.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
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

1616
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
@@ -81,13 +81,13 @@ async function readStdinJson(): Promise<HookInput> {
8181
}
8282

8383
async 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

9393
async 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

133133
function versionCommand(): void {
134-
console.log(`dora ${VERSION}`)
134+
console.log(`code ${VERSION}`)
135135
}
136136

137137
function helpCommand(): void {
138138
console.log(`
139-
dora - MCP server for JetBrains IDE integration
139+
code - MCP server and CLI for AI-assisted coding
140140
141141
Usage:
142-
dora [command] [options]
142+
code [command] [options]
143143
144144
Commands:
145145
serve Start MCP server (default)
@@ -153,8 +153,8 @@ Options:
153153
--timeout=<ms> Request timeout in ms (default: 30000)
154154
155155
Environment:
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

243243
main().catch((error) => {
244-
console.error("[dora] Error:", error)
244+
console.error("[code] Error:", error)
245245
process.exit(1)
246246
})

0 commit comments

Comments
 (0)