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
相关推荐
大象AI共学17 小时前
想在手机上读 Obsidian?Mac → iPhone / 安卓的零成本方案
macos·智能手机·iphone
sysinside2 天前
如何创建可引导的 macOS Golden Gate 27 安装介质
macos
Dr.Buho2 天前
macOS 27 升级教程:兼容机型、三种安装方法与降级提示
经验分享·macos
sysinside2 天前
macOS Golden Gate 27.0 (26A428) 正式版 Boot ISO 原版可引导映像下载
macos
黑科技iOS上架3 天前
Cocos应用App Store4.3被拒怎么自查
macos·ios·objective-c·cocoa·审核·ios混淆·cocos混淆
典典分享指南3 天前
AI 配图的排版规范
macos·docker·github·vim·visual studio
:-)4 天前
修改mac电脑用户名
macos
Είναι η κοπέλα4 天前
本地大模型部署完全指南:Ollama / vLLM / llama.cpp / MLX 四大引擎横评与选型实战
macos·llama·vllm
那年窗外下的雪.4 天前
AIDC 学习日志|第 25 天|设备输出反推、MAC Flapping 与 EAD 撤销
前端·网络·git·学习·macos
星辰即远方4 天前
RunLoop初步了解
macos·objective-c·cocoa