Skip to content

Commit 5252825

Browse files
committed
Using node-which to resolve paths on windows
1 parent 4be667c commit 5252825

File tree

4 files changed

+29
-3
lines changed

4 files changed

+29
-3
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"chalk": "^5.3.0",
3131
"dotenv": "^16.4.5",
3232
"undici": "^5.28.4",
33+
"which": "^5.0.0",
3334
"xdg-app-paths": "^8.3.0",
3435
"zod": "^3.23.8"
3536
},

pnpm-lock.yaml

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/init.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import fs from 'node:fs'
1717
import { fileURLToPath } from 'url'
1818
import { createDialog, endSection, logRaw, startSection, updateStatus } from './utils/c3'
1919
import { mcpCloudflareVersion } from './utils/helpers'
20+
import which from 'which'
2021

2122
const __filename = fileURLToPath(import.meta.url)
2223

@@ -27,8 +28,8 @@ export async function init(accountTag: string | undefined) {
2728
createDialog([
2829
`👋 Welcome to ${chalk.yellow('mcp-server-cloudflare')} v${mcpCloudflareVersion}!`,
2930
`💁‍♀️ This ${chalk.green("'init'")} process will ensure you're connected to the Cloudflare API`,
30-
' and install the Cloudflare MCP Server into Claude Desktop',
31-
'ℹ️ For more information, visit https://github.com/cloudflare/mcp-server-cloudflare',
31+
` and install the Cloudflare MCP Server into Claude Desktop (${chalk.blue.underline('https://claude.ai/download')})`,
32+
`ℹ️ For more information, visit ${chalk.blue.underline('https://github.com/cloudflare/mcp-server-cloudflare')}`,
3233
`🧡 Let's get started.`,
3334
]),
3435
)
@@ -97,7 +98,7 @@ export async function init(accountTag: string | undefined) {
9798
'claude_desktop_config.json',
9899
)
99100
const cloudflareConfig = {
100-
command: (await execAsync('which node')).stdout.trim(),
101+
command: (await which('node')).stdout.trim(),
101102
args: [__filename, 'run', account],
102103
}
103104

src/utils/c3.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,9 @@ export const format = (
142142
export const endSection = (heading: string, subheading?: string) => {
143143
logRaw(`${gray(shapes.corners.bl)} ${brandColor(heading)} ${subheading ? dim(subheading) : ''}\n`)
144144
}
145+
146+
// Create a hyperlink in terminal
147+
// It works in iTerm2 and VSCode's terminal, but not macOS built-in terminal app
148+
export const hyperlink = (url: string, label = url) => {
149+
return `\u001B]8;;${url}\u001B\\${label}\u001B]8;;\u001B\\`
150+
}

0 commit comments

Comments
 (0)