MAC 电脑快速打开claude code 终端

实现效果

我们直接在文件夹上右键,直接打开claude

实现路径

选择快捷操作

选择文件或文件夹 位于选择 访达

拖动运行applescript到中间的窗口

添加下面的脚本

这个脚本访是使用iterm打开,如果使用其他终端打开,可以询问豆包改代码

复制代码
on run {input, parameters}
	set targetPath to POSIX path of (item 1 of input)
	-- 用 iTerm2 打开目录并执行 claude 命令
	tell application "iTerm"
		create window with default profile
		tell current window
			tell current session
				write text "cd " & quoted form of targetPath
				write text "claude"
			end tell
		end tell
	end tell
	
	return input
end run

如果需要添加claude 无需确认权限的模式可是使用下面的脚本

复制代码
on run {input, parameters}
	set targetPath to POSIX path of (item 1 of input)
	-- 用 iTerm2 打开目录并执行 claude 命令
	tell application "iTerm"
		create window with default profile
		tell current window
			tell current session
				write text "cd " & quoted form of targetPath
				write text "claude --dangerously-skip-permissions"
			end tell
		end tell
	end tell
	
	return input
end run
相关推荐
Web Security Loop6 小时前
MAC卸载JDK环境
java·macos·jdk
IS6831 天前
视频文案提取技术全景:ASR vs OCR,哪种方案更适合你?
ide·macos·xcode
安且惜2 天前
Windows或mac支持本地抓包
windows·macos
做萤石二次开发的哈哈2 天前
开发者如何调用 ERTC iOS API 完成 SDK 初始化配置?
macos·objective-c·cocoa
AUV11072 天前
Mac 录屏自动缩放怎么设置才不乱跳:自动片段、固定区域与鼠标跟随调试
macos·计算机外设
程序员良辰2 天前
【Mac快速切换JDK】Mac 使用 Homebrew + jenv 快速切换 JDK 版本
java·开发语言·macos
coding4u3 天前
Mac 外接显示器完全指南:从插上线到调好每个参数
macos·计算机外设·文件管理·显示器·策略模式·quick look扩展
zhyf1193 天前
(Mac)Homebrew部署Obsidian+Claudian+Excalidraw
macos
chuan.bai3 天前
Java RAG 实战(第 3 篇):从交互式聊天到多轮上下文
java·人工智能·macos·ai
Chennn__3 天前
开源项目:Recorder — 本地离线 macOS 录音转文字(通用/课堂/雅思,可选 Ollama)
macos