-
Notifications
You must be signed in to change notification settings - Fork 35
docs: prioritize docs and Termux Codex install #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 17 commits
d8b8705
6eb76a1
05342a1
e9c1acb
6e592a3
fe99d26
598d654
a98a451
723165e
8de10ca
3b649ce
c8b47f3
7cde993
7412b65
7e23d54
25f55f1
62d8af8
f52ae36
8fc8da6
c63e4c2
d58e831
31deeeb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ | |
| [](https://github.com/SakuraByteCore/codexmate/stargazers) | ||
| [](https://github.com/SakuraByteCore/codexmate/issues) | ||
|
|
||
| [快速开始](#快速开始) · [命令速查](#命令速查) · [Web 界面](#web-界面) · [MCP](#mcp) · [English](README.md) | ||
| [文档](https://sakurabytecore.github.io/codexmate/) · [快速开始](#快速开始) · [命令速查](#命令速查) · [Web 界面](#web-界面) · [MCP](#mcp) · [English](README.md) | ||
|
|
||
| </div> | ||
|
|
||
|
|
@@ -153,6 +153,21 @@ codexmate run | |
|
|
||
| > 安全提示:默认监听会在当前局域网暴露未鉴权的管理界面。若包含 API Key、provider 配置或 skills 管理,请仅在可信网络中使用;如需仅本机访问,可设置 `CODEXMATE_HOST=127.0.0.1` 或启动时传入 `--host 127.0.0.1`。 | ||
|
|
||
| ### 安装 Codex CLI / Claude Code(可选) | ||
|
|
||
| Codex Mate 支持透传调用官方 CLI(例如 `codexmate codex ...`),建议先安装: | ||
|
|
||
| ```bash | ||
| # Codex CLI(默认) | ||
| npm install -g @openai/codex | ||
|
|
||
| # Termux(Android)上的 Codex CLI | ||
| npm install -g @mmmbuto/codex-cli-termux@latest | ||
|
Comment on lines
+158
to
+165
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: The npm package Citations:
🌐 Web query:
💡 Result: The Citations:
🏁 Script executed: curl -s "https://registry.npmjs.org/@mmmbuto/codex-cli-termux" 2>/dev/null | head -50 || echo "Package info lookup attempted"Repository: SakuraByteCore/codexmate Length of output: 50381 🏁 Script executed: curl -s "https://registry.npmjs.org/@openai/codex" 2>/dev/null | head -50 || echo "Package info lookup attempted"Repository: SakuraByteCore/codexmate Length of output: 50382 Clarify that the Termux package is a community-maintained build, not official. Line 158 introduces "官方 CLI" (official CLI), which refers to Suggested wording adjustment-Codex Mate 支持透传调用官方 CLI(例如 `codexmate codex ...`),建议先安装:
+Codex Mate 支持透传调用对应的 CLI 工具(例如 `codexmate codex ...`),建议按平台安装:
-# Termux(Android)上的 Codex CLI
+# Termux(Android)兼容的 Codex CLI 构建
npm install -g `@mmmbuto/codex-cli-termux`@latest🤖 Prompt for AI Agents |
||
|
|
||
| # Claude Code | ||
| npm install -g @anthropic-ai/claude-code | ||
| ``` | ||
|
|
||
| ### 从源码运行 | ||
|
|
||
| ```bash | ||
|
|
||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,6 +78,13 @@ export function createInstallMethods() { | |
| }, | ||
|
|
||
| resolveInstallPlatform() { | ||
| const navUserAgent = typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' | ||
| ? navigator.userAgent.trim().toLowerCase() | ||
| : ''; | ||
| // Termux runs on Android; Codex CLI needs a Termux-friendly build. | ||
| if (navUserAgent.includes('termux') || navUserAgent.includes('android')) { | ||
| return 'termux'; | ||
| } | ||
|
Comment on lines
+81
to
+87
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: Check whether the app already exposes server/runtime platform information that can replace browser-UA detection.
# Expected: Find a backend/runtime platform source, or confirm one needs to be added.
rg -n -C3 "resolveInstallPlatform|navigator\.userAgent|navigator\.platform|process\.platform|installTargetCards|installStatusTargets" --iglob '*.js' --iglob '*.mjs' --iglob '*.html'Repository: SakuraByteCore/codexmate Length of output: 15198 🏁 Script executed: # Check if server exposes platform information to web-UI
rg -n "app\.platform|process\.platform|installStatusTargets|resolveInstallPlatform" --iglob '*.js' --iglob '*.mjs' -A2 -B2 | head -100Repository: SakuraByteCore/codexmate Length of output: 5794 🏁 Script executed: # Look for API endpoints or middleware that provides platform info
rg -n "express|app\.get|app\.post|router\." lib/ --iglob '*.js' | grep -i platformRepository: SakuraByteCore/codexmate Length of output: 50 🏁 Script executed: # Check app.js initialization around installStatusTargets
sed -n '240,280p' web-ui/app.jsRepository: SakuraByteCore/codexmate Length of output: 1878 🏁 Script executed: # Check server entry point and any initialization that provides platform info to web-UI
find . -maxdepth 2 -name "index.js" -o -name "server.js" -o -name "app.js" | grep -v node_modules | grep -v web-uiRepository: SakuraByteCore/codexmate Length of output: 50 🏁 Script executed: # Check if there's any middleware or route that sends platform to client
rg -n "res\.json|res\.send|platform" lib/ --iglob '*.js' | grep -E "(platform|json|send)" -A1 -B1 | head -80Repository: SakuraByteCore/codexmate Length of output: 342 🏁 Script executed: # Check the full buildInstallCommandMatrix function to see full scope of the issue
sed -n '96,140p' web-ui/modules/app.methods.install.mjsRepository: SakuraByteCore/codexmate Length of output: 2505 Don't infer the install target platform from the browser user agent. Line 85 switches to the Termux package whenever the viewing browser is Android. Since the web-UI is LAN-accessible, users can view a non-Termux host from Android—or a Termux host from desktop—so the generated commands target the wrong environment. The hardcoded package name in Replace browser-UA detection with either a server-reported runtime platform sent to the client on initialization, or an explicit platform selector in the UI. 🤖 Prompt for AI Agents |
||
| const navPlatform = typeof navigator !== 'undefined' && typeof navigator.platform === 'string' | ||
| ? navigator.platform.trim().toLowerCase() | ||
| : ''; | ||
|
|
@@ -86,8 +93,11 @@ export function createInstallMethods() { | |
| return 'linux'; | ||
| }, | ||
|
|
||
| buildInstallCommandMatrix(packageManager) { | ||
| buildInstallCommandMatrix(packageManager, platformOverride = '') { | ||
| const manager = this.normalizeInstallPackageManager(packageManager); | ||
| const platform = platformOverride ? String(platformOverride).trim().toLowerCase() : this.resolveInstallPlatform(); | ||
| const codexPackage = platform === 'termux' ? '@mmmbuto/codex-cli-termux' : '@openai/codex'; | ||
| const codexInstallPackage = platform === 'termux' ? '@mmmbuto/codex-cli-termux@latest' : '@openai/codex'; | ||
| const matrix = { | ||
| claude: { | ||
| install: '', | ||
|
|
@@ -104,34 +114,36 @@ export function createInstallMethods() { | |
| matrix.claude.install = 'pnpm add -g @anthropic-ai/claude-code'; | ||
| matrix.claude.update = 'pnpm up -g @anthropic-ai/claude-code'; | ||
| matrix.claude.uninstall = 'pnpm remove -g @anthropic-ai/claude-code'; | ||
| matrix.codex.install = 'pnpm add -g @openai/codex'; | ||
| matrix.codex.update = 'pnpm up -g @openai/codex'; | ||
| matrix.codex.uninstall = 'pnpm remove -g @openai/codex'; | ||
| matrix.codex.install = `pnpm add -g ${codexInstallPackage}`; | ||
| matrix.codex.update = `pnpm up -g ${codexPackage}`; | ||
| matrix.codex.uninstall = `pnpm remove -g ${codexPackage}`; | ||
| return matrix; | ||
| } | ||
| if (manager === 'bun') { | ||
| matrix.claude.install = 'bun add -g @anthropic-ai/claude-code'; | ||
| matrix.claude.update = 'bun update -g @anthropic-ai/claude-code'; | ||
| matrix.claude.uninstall = 'bun remove -g @anthropic-ai/claude-code'; | ||
| matrix.codex.install = 'bun add -g @openai/codex'; | ||
| matrix.codex.update = 'bun update -g @openai/codex'; | ||
| matrix.codex.uninstall = 'bun remove -g @openai/codex'; | ||
| matrix.codex.install = `bun add -g ${codexInstallPackage}`; | ||
| matrix.codex.update = `bun update -g ${codexPackage}`; | ||
| matrix.codex.uninstall = `bun remove -g ${codexPackage}`; | ||
| return matrix; | ||
| } | ||
| matrix.claude.install = 'npm install -g @anthropic-ai/claude-code'; | ||
| matrix.claude.update = 'npm update -g @anthropic-ai/claude-code'; | ||
| matrix.claude.uninstall = 'npm uninstall -g @anthropic-ai/claude-code'; | ||
| matrix.codex.install = 'npm install -g @openai/codex'; | ||
| matrix.codex.update = 'npm update -g @openai/codex'; | ||
| matrix.codex.uninstall = 'npm uninstall -g @openai/codex'; | ||
| matrix.codex.install = `npm install -g ${codexInstallPackage}`; | ||
| matrix.codex.update = platform === 'termux' | ||
| ? `npm install -g ${codexInstallPackage}` | ||
| : `npm update -g ${codexPackage}`; | ||
| matrix.codex.uninstall = `npm uninstall -g ${codexPackage}`; | ||
| return matrix; | ||
| }, | ||
|
|
||
| getInstallCommand(targetId, actionName) { | ||
| getInstallCommand(targetId, actionName, platformOverride = '') { | ||
| const targetKey = typeof targetId === 'string' ? targetId.trim() : ''; | ||
| if (!targetKey) return ''; | ||
| const action = this.normalizeInstallAction(actionName); | ||
| const currentMap = this.buildInstallCommandMatrix(this.installPackageManager); | ||
| const currentMap = this.buildInstallCommandMatrix(this.installPackageManager, platformOverride); | ||
| const current = currentMap[targetKey] && typeof currentMap[targetKey][action] === 'string' | ||
| ? currentMap[targetKey][action] | ||
| : ''; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: SakuraByteCore/codexmate
Length of output: 1035
Clarify package provenance in installation instructions.
Lines 155–162 state "official CLIs", but only
@openai/codexis officially maintained by OpenAI. The@mmmbuto/codex-cli-termuxpackage is a third-party Termux-compatible build maintained by a community contributor, not OpenAI. This distinction should be reflected in the documentation to avoid misleading users into treating both packages as equally official.Suggested wording adjustment
🤖 Prompt for AI Agents