[GH-ISSUE #305] 对接入codex部分的启动别名建议 #104

Open
opened 2026-10-26 09:45:29 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @greeopia on GitHub (Jul 19, 2026).
Original GitHub issue: https://github.com/deepseek-ai/awesome-deepseek-agent/issues/305

(见https://github.com/deepseek-ai/awesome-deepseek-agent/blob/main/docs/codex.zh-CN.md)
rt,我认为可以用一个函数来简化启动流程,因为通过
Image
这种方式启动,会覆盖已安装的mcp服务器(其实是覆盖$HOME/.codex/config.toml)。
所以我建议使用函数来启动codex(lz使用wsl2->ubuntu24.04LTS:zsh奥,用win的和fish的可以让ai改写(?))

[greenpia@bi7dyv] [03:05:48] [~]
➜ cat ~/.zshrc | tail -n +129 | head -n 162

---------- Moon Bridge / Codex ----------

mb() {
local project="${1:-$PWD}"
local root="/opt/moon-bridge"
local config="$root/config.yml" #这三行根据自己的情况进行修改

# 后台启动 Moon Bridge
(
    cd "$root"
    exec ./moonbridge --config config.yml >/dev/null 2>&1 #这里moonbridge是可执行文件(见文末图片)
) &
local server_pid=$!

# Ctrl+C 或 codex 退出时自动关闭 Moon Bridge
trap 'kill "$server_pid" 2>/dev/null' EXIT INT TERM

# 等待 Moon Bridge 启动(最多 10 秒)
for _ in {1..100}; do
    if curl -fsS http://127.0.0.1:38440/v1/models >/dev/null 2>&1; then
        break
    fi
    sleep 0.1
done

# 启动 Codex
codex \
    --cd "$project" \
    --sandbox workspace-write \
    --ask-for-approval on-request

kill "$server_pid" 2>/dev/null
wait "$server_pid" 2>/dev/null
trap - EXIT INT TERM

}
#下面这两行不用看2333

Added by codebase-memory-mcp install

export PATH="/home/greenpia/.local/bin:$PATH"

Image
Originally created by @greeopia on GitHub (Jul 19, 2026). Original GitHub issue: https://github.com/deepseek-ai/awesome-deepseek-agent/issues/305 (见https://github.com/deepseek-ai/awesome-deepseek-agent/blob/main/docs/codex.zh-CN.md) rt,我认为可以用一个函数来简化启动流程,因为通过 <img width="881" height="203" alt="Image" src="https://github.com/user-attachments/assets/2e3a9619-e86c-4066-a6dc-e2db7f68e705" /> 这种方式启动,会覆盖已安装的mcp服务器(其实是覆盖$HOME/.codex/config.toml)。 所以我建议使用函数来启动codex(lz使用wsl2->ubuntu24.04LTS:zsh奥,用win的和fish的可以让ai改写(?)) [greenpia@bi7dyv] [03:05:48] [~] ➜ cat ~/.zshrc | tail -n +129 | head -n 162 # ---------- Moon Bridge / Codex ---------- mb() { local project="${1:-$PWD}" local root="/opt/moon-bridge" local config="$root/config.yml" #这三行根据自己的情况进行修改 # 后台启动 Moon Bridge ( cd "$root" exec ./moonbridge --config config.yml >/dev/null 2>&1 #这里moonbridge是可执行文件(见文末图片) ) & local server_pid=$! # Ctrl+C 或 codex 退出时自动关闭 Moon Bridge trap 'kill "$server_pid" 2>/dev/null' EXIT INT TERM # 等待 Moon Bridge 启动(最多 10 秒) for _ in {1..100}; do if curl -fsS http://127.0.0.1:38440/v1/models >/dev/null 2>&1; then break fi sleep 0.1 done # 启动 Codex codex \ --cd "$project" \ --sandbox workspace-write \ --ask-for-approval on-request kill "$server_pid" 2>/dev/null wait "$server_pid" 2>/dev/null trap - EXIT INT TERM } #下面这两行不用看2333 # Added by codebase-memory-mcp install export PATH="/home/greenpia/.local/bin:$PATH" <img width="535" height="308" alt="Image" src="https://github.com/user-attachments/assets/74162db7-25a7-49b6-8afe-6d272919c9ba" />
Author
Owner

@greeopia commented on GitHub (Jul 19, 2026):

还是直接看非预览版md吧(

<!-- gh-comment-id:5017030805 --> @greeopia commented on GitHub (Jul 19, 2026): 还是直接看非预览版md吧(
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/awesome-deepseek-agent#104
No description provided.