codex && claude code mirror  :  aicoding.sh

 -  参数

参数

全写

作用

示例

-m

--model

指定使用的模型(默认可能是 gpt-3.5)

codex -m gpt-4 "Explain utils.ts"

-a

--ask-for-approval

在执行任务前提示确认,避免直接修改

codex -a "Refactor user service"

-i

--image

附加图片输入(可多张,逗号分隔)

codex -i screenshot.png "Explain error"codex --image img1.png,img2.jpg "Summarize diagrams"

-C

--cd

指定工作目录,而不用 cd 切换

codex -C ./backend "Refactor auth service"

--full-auto

全自动模式:生成文件、安装依赖、运行、提交

codex --full-auto "Build todo-list app"

resume

恢复交互会话

codex resume --lastcodex resume <SESSION_ID>

exec

非交互模式,直接运行并输出结果

codex exec "Write script to fetch weather API"

completion

生成 Shell 自动补全脚本

codex completion bashcodex completion zsh

--last

恢复最近一次会话(配合 resume 使用)

codex resume --last

- 任务 & 参数

输入

Codex 行为

codex "Refactor Dashboard component to React Hooks"

将类组件重构为函数式组件,并运行测试

codex "Generate SQL migrations for adding a users table"

推断 ORM,生成迁移文件并在沙盒数据库中运行

codex "Write unit tests for utils/date.ts"

自动生成单元测试并运行,直到全部通过

codex "Bulk-rename *.jpeg -> *.jpg with git mv"

批量重命名文件并更新引用

codex "Explain regex ^(?=.*[A-Z]).{8,}$"

输出逐步的人类可读解释

codex "Upgrade project to React 18"

更新依赖并解决兼容性问题

codex "Write Dockerfile for Node.js Express app"

生成并测试 Dockerfile

codex "Add GitHub Actions CI for testing and linting"

配置 CI 流程

codex "Implement JWT authentication in login route"

添加登录鉴权逻辑

codex "Translate README.md into Chinese"

翻译文档

codex "Convert utils.js to TypeScript"

将文件改写为 TypeScript

codex "Implement pagination in users API endpoint"

添加分页接口

codex "Migrate CSS to TailwindCSS"

自动迁移样式

codex "Explain error: Cannot read property 'map' of undefined"

分析错误原因并给出修复方法

codex "Setup Jest + Testing Library for React project"

配置测试框架

codex "Summarize this codebase"

输出代码架构摘要

codex "Detect unused dependencies in package.json"

查找未使用的依赖

codex "Generate README.md with installation steps"

自动生成项目文档

- 带参数的常用用法

输入

Codex 行为

codex -m gpt-4 "Explain utils.ts"

指定模型运行(默认可能是 gpt-3.5)

codex -a "Refactor user service"

执行前先询问确认(Ask-for-approval 模式)

codex exec "Write script to fetch weather API"

非交互模式,直接执行并输出结果

codex resume

打开交互式 session 选择器

codex resume --last

恢复最近一次会话

codex resume <SESSION_ID>

恢复指定 ID 的会话

codex -i screenshot.png "Explain this error"

上传单张图片作为输入

codex --image img1.png,img2.jpg "Summarize diagrams"

上传多张图片作为输入

codex --cd ./backend "Refactor auth service"

在指定目录作为工作根目录执行

codex completion bash

生成 Bash 自动补全脚本

codex completion zsh

生成 Zsh 自动补全脚本

codex completion fish

生成 Fish 自动补全脚本

codex --full-auto "create todo-list app"

全自动模式:生成代码、安装依赖、运行并提交

codex "Carefully review this repo, and propose 3 PRs"

输出高价值的改进建议


-  指令示例

输入

Codex 行为

codex "Refactor Dashboard component to React Hooks"

将类组件重构为函数式组件,并运行测试

codex "Generate SQL migrations for adding a users table"

推断 ORM,生成迁移文件并在沙盒数据库中运行

codex "Write unit tests for utils/date.ts"

自动生成单元测试并运行,直到全部通过

codex "Bulk-rename *.jpeg -> *.jpg with git mv"

安全重命名并更新代码引用

codex "Explain regex ^(?=.*[A-Z]).{8,}$"

输出逐步的人类可读解释

codex "Review repo and propose 3 high impact PRs"

生成高价值的改进建议

codex "Look for vulnerabilities and create a security report"

查找并解释潜在安全问题

codex "Optimize performance of fetchData function"

分析性能瓶颈并改进实现

codex "Add dark mode toggle to the Settings page"

修改 UI 并添加主题切换功能

codex "Translate README.md into Chinese"

自动生成中文文档

codex "Convert JavaScript utils.js to TypeScript"

将文件改写为 TypeScript

codex "Implement pagination in users API endpoint"

为接口添加分页功能

codex "Fix ESLint and Prettier issues in src/ folder"

自动修复代码风格问题

codex "Upgrade project to React 18 and fix breaking changes"

更新依赖并解决兼容性问题

codex "Write Dockerfile for Node.js Express app"

生成 Dockerfile 并测试运行

codex "Add GitHub Actions CI for testing and linting"

配置 CI 流程

codex "Generate OpenAPI spec from Express routes"

从现有路由生成 OpenAPI 文档

codex "Explain how useEffect works in React"

输出详细解释与示例

codex "Migrate CSS files to TailwindCSS"

自动转换样式代码

codex "Implement JWT authentication in login route"

添加用户认证逻辑

codex "Create Python script for batch renaming files"

生成脚本并测试运行

codex "Write unit tests for shopping-cart reducer"

自动生成 reducer 的测试用例

codex "Generate GraphQL schema for blog app"

自动推断并输出 schema 定义

codex "Explain difference between var, let, const"

给出对比说明

codex "Add debounce to search input in Header component"

优化搜索输入逻辑

codex "Refactor monolith repo into microservices"

输出迁移建议和初步代码结构

codex "Implement infinite scroll on posts page"

修改前端逻辑实现滚动加载

codex "Summarize this codebase"

输出代码架构摘要

codex "Detect unused dependencies in package.json"

查找未使用的依赖

codex "Generate README.md with installation steps"

自动生成项目文档

codex "Setup Jest + Testing Library for React project"

配置测试框架

codex "Explain error: Cannot read property 'map' of undefined"

分析错误原因并给出修复方法

Logo

欢迎加入DeepSeek 技术社区。在这里,你可以找到志同道合的朋友,共同探索AI技术的奥秘。

更多推荐