[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-microsoft--Codex-CLI":3,"tool-microsoft--Codex-CLI":64},[4,17,27,35,44,52],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",154349,2,"2026-04-13T23:32:16",[13,14,15],"开发框架","Agent","语言模型","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":10,"last_commit_at":23,"category_tags":24,"status":16},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[25,14,26,13],"插件","图像",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":10,"last_commit_at":33,"category_tags":34,"status":16},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[25,13],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":41,"last_commit_at":42,"category_tags":43,"status":16},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,3,"2026-04-06T11:19:32",[15,26,14,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":10,"last_commit_at":50,"category_tags":51,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,15],{"id":53,"name":54,"github_repo":55,"description_zh":56,"stars":57,"difficulty_score":10,"last_commit_at":58,"category_tags":59,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",85092,"2026-04-10T11:13:16",[26,60,61,25,14,62,15,13,63],"数据工具","视频","其他","音频",{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":70,"readme_en":71,"readme_zh":72,"quickstart_zh":73,"use_case_zh":74,"hero_image_url":75,"owner_login":76,"owner_name":77,"owner_avatar_url":78,"owner_bio":79,"owner_company":80,"owner_location":80,"owner_email":81,"owner_twitter":82,"owner_website":83,"owner_url":84,"languages":85,"stars":98,"forks":99,"last_commit_at":100,"license":101,"difficulty_score":10,"env_os":102,"env_gpu":103,"env_ram":103,"env_deps":104,"category_tags":109,"github_topics":80,"view_count":10,"oss_zip_url":80,"oss_zip_packed_at":80,"status":16,"created_at":110,"updated_at":111,"faqs":112,"releases":153},7299,"microsoft\u002FCodex-CLI","Codex-CLI","CLI tool that uses Codex to turn natural language commands into their Bash\u002FZShell\u002FPowerShell equivalents","Codex-CLI 是一款创新的命令行辅助工具，它利用 OpenAI 的 Codex 大语言模型，将用户输入的自然语言指令实时转换为 Bash、Zsh 或 PowerShell 等 Shell 的具体执行命令。\n\n长期以来，命令行界面（CLI）虽然功能强大，但要求用户必须精准掌握复杂的计算机语法和指令，这对非专业人士构成了较高的使用门槛。Codex-CLI 正是为了解决这一痛点而生，它让用户能够像日常对话一样输入“查看我的 IP 地址”或“切换时区”，只需按下快捷键，工具便会自动生成符合当前 Shell 习惯的标准命令供用户确认执行，极大地降低了操作难度。\n\n这款工具特别适合希望提升工作效率的开发者、系统管理员，以及想要尝试命令行操作但苦于记不住复杂指令的技术爱好者。其独特的技术亮点在于支持“多轮对话”模式：它能记忆上下文信息，允许用户在后续指令中使用代词（如“把它改回太平洋时间”），模型能准确理解指代对象并生成对应命令，使交互过程更加流畅自然。\n\n需要注意的是，Codex-CLI 生成的命令基于概率预测，偶尔可能出现偏差。因此在执行自动生成的命令前，建议用户先审阅确认，以确保操作安全","Codex-CLI 是一款创新的命令行辅助工具，它利用 OpenAI 的 Codex 大语言模型，将用户输入的自然语言指令实时转换为 Bash、Zsh 或 PowerShell 等 Shell 的具体执行命令。\n\n长期以来，命令行界面（CLI）虽然功能强大，但要求用户必须精准掌握复杂的计算机语法和指令，这对非专业人士构成了较高的使用门槛。Codex-CLI 正是为了解决这一痛点而生，它让用户能够像日常对话一样输入“查看我的 IP 地址”或“切换时区”，只需按下快捷键，工具便会自动生成符合当前 Shell 习惯的标准命令供用户确认执行，极大地降低了操作难度。\n\n这款工具特别适合希望提升工作效率的开发者、系统管理员，以及想要尝试命令行操作但苦于记不住复杂指令的技术爱好者。其独特的技术亮点在于支持“多轮对话”模式：它能记忆上下文信息，允许用户在后续指令中使用代词（如“把它改回太平洋时间”），模型能准确理解指代对象并生成对应命令，使交互过程更加流畅自然。\n\n需要注意的是，Codex-CLI 生成的命令基于概率预测，偶尔可能出现偏差。因此在执行自动生成的命令前，建议用户先审阅确认，以确保操作安全。作为一个开源项目，它为探索大模型在终端交互中的应用提供了极佳的实践参考。","# Codex CLI - Natural Language Command Line Interface\n\nThis project uses [GPT-3 Codex](https:\u002F\u002Fopenai.com\u002Fblog\u002Fopenai-codex\u002F) to convert natural language commands into commands in PowerShell, Z shell and Bash.\n\n![Codex Cli GIF](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmicrosoft_Codex-CLI_readme_e0d25348a93f.gif)\n\n\nThe Command Line Interface (CLI) was the first major User Interface we used to interact with machines. It's incredibly powerful, you can do almost anything with a CLI, but it requires the user to express their intent extremely precisely. The user needs to _know the language of the computer_. \n\nWith the advent of Large Language Models (LLMs), particularly those that have been trained on code, it's possible to interact with a CLI using Natural Language (NL). In effect, these models understand natural language _and_ code well enough that they can translate from one to another. \n\nThis project aims to offer a cross-shell NL->Code experience to allow users to interact with their favorite CLI using NL. The user enters a command, like \"what's my IP address\", hits `Ctrl + G` and gets a suggestion for a command idiomatic to the shell they're using. The project uses the GPT-3 Codex model off-the-shelf, meaning the model has not been explicitly trained for the task. Instead we rely on a discipline called prompt engineering (see [section](#prompt-engineering-and-context-files) below) to coax the right commands from Codex. \n\n**Note: The model can still make mistakes! Don't run a command if you don't understand it. If you're not sure what a command does, hit `Ctrl + C` to cancel it**.\n\nThis project took technical inspiration from the [zsh_codex](https:\u002F\u002Fgithub.com\u002Ftom-doerr\u002Fzsh_codex) project, extending its functionality to span multiple shells and to customize the prompts passed to the model (see prompt engineering section below).\n\n## Statement of Purpose\nThis repository aims to grow the understanding of using Codex in applications by providing an example of implementation and references to support the [Microsoft Build conference in 2022](https:\u002F\u002Fmybuild.microsoft.com\u002F). It is not intended to be a released product. Therefore, this repository is not for discussing OpenAI API or requesting new features.\n\n## Requirements\n* [Python 3.7.1+](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002F)\n    * \\[Windows\\]: Python is added to PATH.\n* An [OpenAI account](https:\u002F\u002Fopenai.com\u002Fapi\u002F)\n    * [OpenAI API Key](https:\u002F\u002Fbeta.openai.com\u002Faccount\u002Fapi-keys).\n    * [OpenAI Organization Id](https:\u002F\u002Fbeta.openai.com\u002Faccount\u002Forg-settings). If you have multiple organizations, please update your [default organization](https:\u002F\u002Fbeta.openai.com\u002Faccount\u002Fapi-keys) to the one that has access to codex engines before getting the organization Id.\n    * [OpenAI Engine Id](https:\u002F\u002Fbeta.openai.com\u002Fdocs\u002Fengines\u002Fcodex-series-private-beta). It provides access to a model. For example, `code-davinci-002` or `code-cushman-001`. See [here](#what-openai-engines-are-available-to-me) for checking available engines.\n\n## Installation\n\nPlease follow the installation instructions for PowerShell, bash or zsh from [here](.\u002FInstallation.md).\n\n## Usage\n\nOnce configured for your shell of preference, you can use the Codex CLI by writing a comment (starting with `#`) into your shell, and then hitting `Ctrl + G`.\n\nThe Codex CLI supports two primary modes: single-turn and multi-turn.\n\nBy default, multi-turn mode is off. It can be toggled on and off using the `# start multi-turn` and `# stop multi-turn` commands.\n\nIf the multi-turn mode is on, the Codex CLI will \"remember\" past interactions with the model, allowing you to refer back to previous actions and entities. If, for example, you asked the Codex CLI to change your time zone to mountain, and then said \"change it back to pacific\", the model would have the context from the previous interaction to know that \"it\" is the user's timezone:\n\n```powershell\n# change my timezone to mountain\ntzutil \u002Fs \"Mountain Standard Time\"\n\n# change it back to pacific\ntzutil \u002Fs \"Pacific Standard Time\"\n```\n\nThe tool creates a `current_context.txt` file that keeps track of past interactions, and passes them to the model on each subsequent command. \n\nWhen multi-turn mode is off, this tool will not keep track of interaction history. There are tradeoffs to using multi-turn mode - though it enables compelling context resolution, it also increases overhead. If, for example, the model produces the wrong script for the job, the user will want to remove that from the context, otherwise future conversation turns will be more likely to produce the wrong script again. With multi-turn mode off, the model will behave completely deterministically - the same command will always produce the same output. \n\nAny time the model seems to output consistently incorrect commands, you can use the `# stop multi-turn` command to stop the model from remembering past interactions and load in your default context. Alternatively, the `# default context` command does the same while preserving the multi-turn mode as on.\n\n## Commands\n\n| Command | Description |\n|--|--|\n| `start multi-turn` | Starts a multi-turn experience |\n| `stop multi-turn` | Stops a multi-turn experience and loads default context |\n| `load context \u003Cfilename>` | Loads the context file from `contexts` folder |\n| `default context` | Loads default shell context |\n| `view context` | Opens the context file in a text editor |\n| `save context \u003Cfilename>` | Saves the context file to `contexts` folder, if name not specified, uses current date-time |\n| `show config` | Shows the current configuration of your interaction with the model |\n| `set \u003Cconfig-key> \u003Cconfig-value>` | Sets the configuration of your interaction with the model |\n\n\nFeel free to improve your experience by changing the token limit, engine id and temperature using the set command. For example, `# set engine cushman-codex`, `# set temperature 0.5`, `# set max_tokens 50`.\n\n## Prompt Engineering and Context Files\n\nThis project uses a discipline called _prompt engineering_ to coax GPT-3 Codex to generate commands from natural language. Specifically, we pass the model a series of examples of NL->Commands, to give it a sense of the kind of code it should be writing, and also to nudge it towards generating commands idiomatic to the shell you're using. These examples live in the `contexts` directory. See snippet from the PowerShell context below:\n\n```powershell\n# what's the weather in New York?\n(Invoke-WebRequest -uri \"wttr.in\u002FNewYork\").Content\n\n# make a git ignore with node modules and src in it\n\"node_modules\nsrc\" | Out-File .gitignore\n\n# open it in notepad\nnotepad .gitignore\n```\n\nNote that this project models natural language commands as comments, and provide examples of the kind of PowerShell scripts we expect the model to write. These examples include single line completions, multi-line completions, and multi-turn completions (the \"open it in notepad\" example refers to the `.gitignore` file generated on the previous turn). \n\nWhen a user enters a new command (say \"what's my IP address\"), we simple append that command onto the context (as a comment) and ask Codex to generate the code that should follow it. Having seen the examples above, Codex will know that it should write a short PowerShell script that satisfies the comment. \n\n## Building your own Contexts\n\nThis project comes pre-loaded with contexts for each shell, along with some bonus contexts with other capabilities. Beyond these, you can build your own contexts to coax other behaviors out of the model. For example, if you want the Codex CLI to produce Kubernetes scripts, you can create a new context with examples of commands and the `kubectl` script the model might produce:\n\n```bash\n# make a K8s cluster IP called my-cs running on 5678:8080\nkubectl create service clusterip my-cs --tcp=5678:8080\n```\n\nAdd your context to the `contexts` folder and run `load context \u003Cfilename>` to load it. You can also change the default context from to your context file inside `src\\prompt_file.py`.\n\nNote that Codex will often produce correct scripts without any examples. Having been trained on a large corpus of code, it frequently knows how to produce specific commands. That said, building your own contexts helps coax the specific kind of script you're looking for - whether it's long or short, whether it declares variables or not, whether it refers back to previous commands, etc. You can also provide examples of your own CLI commands and scripts, to show Codex other tools it should consider using.\n\nOne important thing to consider is that if you add a new context, keep the multi-turn mode on to avoid our automatic defaulting (which was added to keep faulty contexts from breaking your experience).\n\nWe have added a [cognitive services context](.\u002Fcontexts\u002FCognitiveServiceContext.md) which uses the cognitive services API to provide text to speech type responses as an example.\n\n## Troubleshooting\n\nUse `DEBUG_MODE` to use a terminal input instead of the stdin and debug the code. This is useful when adding new commands and understanding why the tool is unresponsive.\n\nSometimes the `openai` package will throws errors that aren't caught by the tool, you can add a catch block at the end of `codex_query.py` for that exception and print a custom error message.\n\n## FAQ\n### What OpenAI engines are available to me?\nYou might have access to different [OpenAI engines](https:\u002F\u002Fbeta.openai.com\u002Fdocs\u002Fapi-reference\u002Fengines) per OpenAI organization. To check what engines are available to you, one can query the [List engines API](https:\u002F\u002Fbeta.openai.com\u002Fdocs\u002Fapi-reference\u002Fengines\u002Flist) for available engines. See the following commands:\n\n* Shell\n    ```\n    curl https:\u002F\u002Fapi.openai.com\u002Fv1\u002Fengines \\\n      -H 'Authorization: Bearer YOUR_API_KEY' \\\n      -H 'OpenAI-Organization: YOUR_ORG_ID'\n    ```\n\n* PowerShell\n\n    PowerShell v5 (The default one comes with Windows)\n    ```powershell\n    (Invoke-WebRequest -Uri https:\u002F\u002Fapi.openai.com\u002Fv1\u002Fengines -Headers @{\"Authorization\" = \"Bearer YOUR_API_KEY\"; \"OpenAI-Organization\" = \"YOUR_ORG_ID\"}).Content\n    ```\n\n    PowerShell v7\n    ```powershell\n    (Invoke-WebRequest -Uri https:\u002F\u002Fapi.openai.com\u002Fv1\u002Fengines -Authentication Bearer -Token (ConvertTo-SecureString \"YOUR_API_KEY\" -AsPlainText -Force) -Headers @{\"OpenAI-Organization\" = \"YOUR_ORG_ID\"}).Content\n    ```\n\n### Can I run the sample on Azure?\nThe sample code can be currently be used with Codex on OpenAI’s API. In the coming months, the sample will be updated so you can also use it with the [Azure OpenAI Service](https:\u002F\u002Faka.ms\u002Fazure-openai). \n","# Codex CLI - 自然语言命令行界面\n\n该项目使用 [GPT-3 Codex](https:\u002F\u002Fopenai.com\u002Fblog\u002Fopenai-codex\u002F) 将自然语言命令转换为 PowerShell、Z shell 和 Bash 中的命令。\n\n![Codex Cli GIF](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmicrosoft_Codex-CLI_readme_e0d25348a93f.gif)\n\n\n命令行界面（CLI）是我们最早用于与机器交互的主要用户界面。它功能强大，几乎可以完成任何任务，但要求用户以极其精确的方式表达意图。用户需要 _掌握计算机的语言_。\n\n随着大型语言模型（LLMs）的出现，尤其是那些经过代码训练的模型，现在可以使用自然语言（NL）与命令行界面进行交互。实际上，这些模型对自然语言和代码的理解都足够好，能够实现两者之间的翻译。\n\n本项目旨在提供跨 Shell 的自然语言到代码的体验，让用户能够用自然语言与他们喜欢的命令行界面互动。用户输入一个命令，比如“我的 IP 地址是多少”，然后按下 `Ctrl + G`，就会得到一条针对当前 Shell 的惯用命令建议。该项目直接使用了 GPT-3 Codex 模型，这意味着该模型并未专门针对此任务进行过训练。相反，我们依靠一种称为提示工程的技术（见下文 [提示工程与上下文文件] 部分），来引导 Codex 生成正确的命令。\n\n**注意：该模型仍可能出错！如果您不理解某个命令，请不要执行它。如果您不确定某个命令的作用，请按 `Ctrl + C` 取消执行。**\n\n该项目在技术上受到了 [zsh_codex](https:\u002F\u002Fgithub.com\u002Ftom-doerr\u002Fzsh_codex) 项目的启发，并扩展了其功能，使其能够支持多种 Shell，同时还可以自定义传递给模型的提示（详见下方的提示工程部分）。\n\n## 项目目的\n本仓库旨在通过提供一个实现示例以及相关参考资料，帮助大家更好地理解如何在应用程序中使用 Codex，并为 [2022 年微软 Build 大会](https:\u002F\u002Fmybuild.microsoft.com\u002F) 提供支持。本项目并非计划发布的正式产品。因此，本仓库不用于讨论 OpenAI API 或请求新功能。\n\n## 系统要求\n* [Python 3.7.1+](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002F)\n    * \\[Windows\\]: Python 已添加到系统 PATH。\n* 一个 [OpenAI 账户](https:\u002F\u002Fopenai.com\u002Fapi\u002F)\n    * [OpenAI API 密钥](https:\u002F\u002Fbeta.openai.com\u002Faccount\u002Fapi-keys)。\n    * [OpenAI 组织 ID](https:\u002F\u002Fbeta.openai.com\u002Faccount\u002Forg-settings)。如果您有多个组织，请在获取组织 ID 之前，将您的 [默认组织](https:\u002F\u002Fbeta.openai.com\u002Faccount\u002Fapi-keys) 设置为拥有 Codex 引擎访问权限的组织。\n    * [OpenAI 引擎 ID](https:\u002F\u002Fbeta.openai.com\u002Fdocs\u002Fengines\u002Fcodex-series-private-beta)。它提供了对特定模型的访问权限。例如，`code-davinci-002` 或 `code-cushman-001`。有关可用引擎的信息，请参阅 [此处](#what-openai-engines-are-available-to-me)。\n\n## 安装\n请按照 [此处](.\u002FInstallation.md) 的说明，为 PowerShell、Bash 或 Z shell 进行安装。\n\n## 使用方法\n\n配置好您偏好的 Shell 后，您可以通过在 Shell 中输入以 `#` 开头的注释，然后按下 `Ctrl + G` 来使用 Codex CLI。\n\nCodex CLI 支持两种主要模式：单轮对话和多轮对话。\n\n默认情况下，多轮对话模式是关闭的。您可以通过输入 `# start multi-turn` 和 `# stop multi-turn` 命令来切换该模式。\n\n如果启用多轮对话模式，Codex CLI 会“记住”与模型之前的交互记录，允许您引用之前的操作和实体。例如，如果您让 Codex CLI 将时区更改为山地时间，然后又说“把它改回太平洋时间”，模型会根据之前的交互内容知道这里的“它”指的是用户的时区：\n\n```powershell\n# 将我的时区更改为山地时间\ntzutil \u002Fs \"Mountain Standard Time\"\n\n# 把它改回太平洋时间\ntzutil \u002Fs \"Pacific Standard Time\"\n```\n\n该工具会创建一个 `current_context.txt` 文件来记录过去的交互，并在每次后续命令时将其传递给模型。\n\n当多轮对话模式关闭时，该工具不会保留交互历史。使用多轮模式有利有弊——虽然它可以实现强大的上下文解析能力，但也增加了额外的开销。例如，如果模型生成了错误的脚本，用户就需要从上下文中移除该脚本，否则未来的对话很可能会再次生成错误的脚本。而在多轮模式关闭的情况下，模型的行为将是完全确定性的——相同的命令总是会产生相同的结果。\n\n每当模型似乎持续输出错误的命令时，您可以使用 `# stop multi-turn` 命令来停止模型记住之前的交互，并加载默认的上下文。或者，您也可以使用 `# default context` 命令，在保持多轮模式开启的同时达到同样的效果。\n\n## 命令列表\n\n| 命令 | 描述 |\n|--|--|\n| `start multi-turn` | 开启多轮对话模式 |\n| `stop multi-turn` | 关闭多轮对话模式并加载默认上下文 |\n| `load context \u003Cfilename>` | 从 `contexts` 文件夹加载指定的上下文文件 |\n| `default context` | 加载默认的 Shell 上下文 |\n| `view context` | 在文本编辑器中打开上下文文件 |\n| `save context \u003Cfilename>` | 将上下文文件保存到 `contexts` 文件夹；若未指定文件名，则使用当前日期和时间作为文件名 |\n| `show config` | 显示当前与模型交互的配置 |\n| `set \u003Cconfig-key> \u003Cconfig-value>` | 设置与模型交互的配置 |\n\n\n您可以使用 `set` 命令调整令牌限制、引擎 ID 和温度等参数，以优化使用体验。例如，`# set engine cushman-codex`、`# set temperature 0.5`、`# set max_tokens 50`。\n\n## 提示工程与上下文文件\n\n本项目采用一种称为“提示工程”的技术，引导 GPT-3 Codex 根据自然语言生成命令。具体来说，我们会向模型提供一系列自然语言到命令的示例，以便它了解应该生成哪种类型的代码，并促使它生成符合您当前 Shell 习惯的命令。这些示例存储在 `contexts` 目录中。以下是 PowerShell 上下文的一个片段：\n\n```powershell\n# 纽约的天气怎么样？\n(Invoke-WebRequest -uri \"wttr.in\u002FNewYork\").Content\n\n# 创建一个包含 node_modules 和 src 的 .gitignore 文件\n\"node_modules\nsrc\" | Out-File .gitignore\n\n# 在记事本中打开它\nnotepad .gitignore\n```\n\n请注意，该项目将自然语言命令建模为注释，并提供了我们期望模型编写的 PowerShell 脚本示例。这些示例包括单行补全、多行补全以及多轮补全（“在记事本中打开它”的例子指的是上一轮生成的 `.gitignore` 文件）。\n\n当用户输入一条新命令（例如“我的 IP 地址是多少”）时，我们会简单地将该命令作为注释追加到上下文中，并让 Codex 生成接下来应该执行的代码。通过查看上述示例，Codex 就会知道应该编写一段满足该注释要求的简短 PowerShell 脚本。\n\n## 构建您自己的上下文\n\n本项目预装了适用于每种 Shell 的上下文，以及一些具有其他功能的附加上下文。除此之外，您还可以构建自己的上下文，以引导模型产生您期望的行为。例如，如果您希望 Codex CLI 生成 Kubernetes 脚本，您可以创建一个新的上下文，其中包含命令示例以及模型可能生成的 `kubectl` 脚本：\n\n```bash\n# 创建一个名为 my-cs 的 K8s 集群 IP，运行在 5678:8080 端口\nkubectl create service clusterip my-cs --tcp=5678:8080\n```\n\n将您的上下文添加到 `contexts` 文件夹中，并运行 `load context \u003Cfilename>` 来加载它。您也可以在 `src\\prompt_file.py` 中更改默认上下文文件。\n\n需要注意的是，Codex 经常能够在没有任何示例的情况下生成正确的脚本。由于它接受了大量代码语料的训练，通常能够知道如何生成特定的命令。不过，构建您自己的上下文有助于引导模型生成您所期望的特定类型脚本——无论是长脚本还是短脚本，是否声明变量，是否引用之前的命令等。您还可以提供自己 CLI 命令和脚本的示例，以向 Codex 展示它应该考虑使用的其他工具。\n\n需要特别注意的一点是，如果您添加了一个新的上下文，请保持多轮模式开启，以避免自动回退到默认设置（这一机制是为了防止错误的上下文破坏您的使用体验而引入的）。\n\n我们还添加了一个 [认知服务上下文](.\u002Fcontexts\u002FCognitiveServiceContext.md)，该上下文使用认知服务 API 提供文本转语音类型的响应作为示例。\n\n## 故障排除\n\n使用 `DEBUG_MODE` 可以使用终端输入代替标准输入，并调试代码。这在添加新命令以及理解工具为何无响应时非常有用。\n\n有时，`openai` 包会抛出工具无法捕获的错误。您可以在 `codex_query.py` 文件末尾添加一个捕获块来处理此类异常，并打印自定义错误信息。\n\n## 常见问题解答\n### 我可以使用哪些 OpenAI 引擎？\n根据您的 OpenAI 组织，您可能可以访问不同的 [OpenAI 引擎](https:\u002F\u002Fbeta.openai.com\u002Fdocs\u002Fapi-reference\u002Fengines)。要检查您可用的引擎，可以查询 [列出引擎的 API](https:\u002F\u002Fbeta.openai.com\u002Fdocs\u002Fapi-reference\u002Fengines\u002Flist) 获取可用引擎列表。以下是相关命令：\n\n* Shell\n    ```\n    curl https:\u002F\u002Fapi.openai.com\u002Fv1\u002Fengines \\\n      -H 'Authorization: Bearer YOUR_API_KEY' \\\n      -H 'OpenAI-Organization: YOUR_ORG_ID'\n    ```\n\n* PowerShell\n\n    PowerShell v5（Windows 自带的默认版本）\n    ```powershell\n    (Invoke-WebRequest -Uri https:\u002F\u002Fapi.openai.com\u002Fv1\u002Fengines -Headers @{\"Authorization\" = \"Bearer YOUR_API_KEY\"; \"OpenAI-Organization\" = \"YOUR_ORG_ID\"}).Content\n    ```\n\n    PowerShell v7\n    ```powershell\n    (Invoke-WebRequest -Uri https:\u002F\u002Fapi.openai.com\u002Fv1\u002Fengines -Authentication Bearer -Token (ConvertTo-SecureString \"YOUR_API_KEY\" -AsPlainText -Force) -Headers @{\"OpenAI-Organization\" = \"YOUR_ORG_ID\"}).Content\n    ```\n\n### 我能在 Azure 上运行这个示例吗？\n目前，该示例代码可以与 OpenAI 的 API 上的 Codex 一起使用。在未来几个月内，该示例将会更新，以便您也可以将其与 [Azure OpenAI 服务](https:\u002F\u002Faka.ms\u002Fazure-openai) 一起使用。","# Codex-CLI 快速上手指南\n\nCodex-CLI 是一个基于 GPT-3 Codex 模型的命令行工具，允许用户使用自然语言（如中文或英文描述）生成 PowerShell、Zsh 或 Bash 命令。它通过提示工程（Prompt Engineering）将用户的意图转化为对应 Shell 的标准命令。\n\n> **⚠️ 重要安全提示**：模型生成的命令可能出错。在执行任何命令前，请务必确认其含义。若不确定，请按 `Ctrl + C` 取消执行。\n\n## 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n### 1. 系统依赖\n*   **Python**: 版本需为 3.7.1 或更高。\n    *   *Windows 用户*：安装时请勾选 \"Add Python to PATH\"。\n*   **Shell 环境**: 支持 PowerShell、Bash 或 Zsh。\n\n### 2. OpenAI 账号配置\n您需要拥有访问 Codex 模型的 OpenAI 账号，并准备以下信息：\n*   **OpenAI API Key**: [获取地址](https:\u002F\u002Fbeta.openai.com\u002Faccount\u002Fapi-keys)\n*   **Organization ID**: [获取地址](https:\u002F\u002Fbeta.openai.com\u002Faccount\u002Forg-settings)\n    *   *注意*：如果您有多个组织，请确保默认组织已启用 Codex 引擎访问权限。\n*   **Engine ID**: 模型引擎标识符（例如 `code-davinci-002` 或 `code-cushman-001`）。\n    *   *检查可用引擎*：可使用以下命令查看您账号下可用的引擎：\n      ```bash\n      curl https:\u002F\u002Fapi.openai.com\u002Fv1\u002Fengines \\\n        -H 'Authorization: Bearer YOUR_API_KEY' \\\n        -H 'OpenAI-Organization: YOUR_ORG_ID'\n      ```\n\n## 安装步骤\n\n本项目未直接提供 PyPI 包，需从源码安装并配置特定 Shell。\n\n1.  **克隆项目代码**\n    ```bash\n    git clone \u003Crepository-url>\n    cd \u003Crepository-directory>\n    ```\n    *(注：请将 `\u003Crepository-url>` 替换为实际的项目仓库地址)*\n\n2.  **安装 Python 依赖**\n    ```bash\n    pip install -r requirements.txt\n    ```\n    *(国内用户如遇下载慢，可添加镜像源：`pip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple`)*\n\n3.  **配置 Shell**\n    根据您使用的 Shell 类型，运行对应的安装脚本（具体脚本名称请参考项目根目录下的 `Installation.md` 文件）：\n    *   **PowerShell**: 运行安装脚本以注册快捷键和函数。\n    *   **Bash\u002FZsh**: 运行安装脚本并将配置添加到 `~\u002F.bashrc` 或 `~\u002F.zshrc`。\n\n4.  **配置凭证**\n    在项目目录或指定配置文件中填入您的 `API_KEY`、`ORG_ID` 和 `ENGINE_ID`。\n\n## 基本使用\n\n配置完成后，重启终端即可使用。Codex-CLI 的核心交互逻辑是：**输入注释 -> 触发转换 -> 审查执行**。\n\n### 1. 基础命令生成\n在命令行中输入以 `#` 开头的自然语言描述，然后按下 **`Ctrl + G`**。\n\n**示例场景**：查询本机 IP 地址\n\n1.  在终端输入：\n    ```bash\n    # what's my IP address\n    ```\n2.  按下 `Ctrl + G`。\n3.  工具会自动调用 Codex 模型，并在下方生成对应的 Shell 命令（例如）：\n    ```bash\n    # what's my IP address\n    ip addr show | grep inet | grep -v inet6\n    ```\n4.  **审查**生成的命令，确认无误后按 `Enter` 执行；若不想执行，可按 `Ctrl + C` 清除。\n\n### 2. 多轮对话模式（Multi-turn Mode）\n默认情况下，多轮模式关闭。开启后，工具会记住上下文，允许您使用代词（如“它”）进行连续操作。\n\n*   **开启多轮模式**：\n    ```bash\n    # start multi-turn\n    ```\n*   **使用示例**：\n    ```powershell\n    # change my timezone to mountain\n    tzutil \u002Fs \"Mountain Standard Time\"\n\n    # change it back to pacific\n    tzutil \u002Fs \"Pacific Standard Time\"\n    ```\n    *(在第二句中，模型能理解 \"it\" 指的是时区设置)*\n\n*   **关闭多轮模式**（重置上下文）：\n    ```bash\n    # stop multi-turn\n    ```\n\n### 3. 常用控制命令\n您可以在注释中使用以下命令管理上下文和配置：\n\n| 命令 | 说明 |\n| :--- | :--- |\n| `# start multi-turn` | 开启多轮对话上下文记忆 |\n| `# stop multi-turn` | 关闭多轮对话并加载默认上下文 |\n| `# default context` | 重新加载默认 Shell 上下文（保留多轮模式状态） |\n| `# set engine \u003Cid>` | 切换模型引擎，例如 `# set engine code-cushman-001` |\n| `# set temperature \u003Cval>` | 调整生成随机性 (0-1)，例如 `# set temperature 0.5` |\n\n### 4. 自定义上下文 (进阶)\n您可以创建自己的上下文文件来引导模型生成特定风格的代码（如 Kubernetes 脚本）。\n1.  在 `contexts` 文件夹中创建新文件，包含自然语言到代码的示例对。\n2.  加载自定义上下文：\n    ```bash\n    # load context \u003Cfilename>\n    ```","一位刚接手 Linux 服务器的运维新手，需要在复杂的文件系统中快速定位并清理特定类型的日志文件，但他对繁琐的 Bash 参数记忆模糊。\n\n### 没有 Codex-CLI 时\n- 必须频繁切换浏览器标签页，在 StackOverflow 或官方文档中搜索 `find` 命令结合 `mtime`、`size` 等参数的具体写法。\n- 极易因记错正则表达式语法或漏写转义字符，导致命令执行报错，甚至误删非目标文件。\n- 面对多步骤操作（如先查找再确认最后删除），需要手动拆分多条命令执行，上下文切换成本高且效率低下。\n- 遇到不熟悉的 Shell 特性时，只能依靠试错法修改命令，不仅耗时还增加了生产环境的风险。\n\n### 使用 Codex-CLI 后\n- 直接在终端输入自然语言注释\"# 找出过去 7 天大于 100M 的 .log 文件并删除”，按下 `Ctrl + G` 即可自动生成精准的 Bash 命令。\n- Codex-CLI 自动处理复杂的参数组合与语法细节，生成的命令符合当前 Shell 规范，大幅降低语法错误率。\n- 开启多轮对话模式后，可紧接着输入\"# 把刚才的操作改成只列出文件不删除”，工具能理解上下文意图并即时调整命令逻辑。\n- 在按下回车执行前，用户可直观审查生成的命令，既保留了人工确认的安全机制，又省去了查阅文档的时间。\n\nCodex-CLI 通过将自然语言实时转化为专业壳层命令，让开发者无需死记硬背语法即可安全、高效地驾驭命令行界面。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmicrosoft_Codex-CLI_d6d30de4.png","microsoft","Microsoft","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fmicrosoft_4900709c.png","Open source projects and samples from Microsoft",null,"opensource@microsoft.com","OpenAtMicrosoft","https:\u002F\u002Fopensource.microsoft.com","https:\u002F\u002Fgithub.com\u002Fmicrosoft",[86,90,94],{"name":87,"color":88,"percentage":89},"Python","#3572A5",54.6,{"name":91,"color":92,"percentage":93},"Shell","#89e051",28.9,{"name":95,"color":96,"percentage":97},"PowerShell","#012456",16.5,2357,223,"2026-04-13T07:48:14","MIT","Linux, macOS, Windows","未说明",{"notes":105,"python":106,"dependencies":107},"该工具基于云端 API 运行，无需本地 GPU。必须拥有 OpenAI 账户、API Key、Organization Id 以及具有 Codex 引擎访问权限的 Engine Id（如 code-davinci-002）。需根据使用的 Shell（PowerShell, Z shell, Bash）执行特定的安装脚本。首次使用需配置默认组织以获取 Codex 引擎访问权。","3.7.1+",[108],"openai",[15,25],"2026-03-27T02:49:30.150509","2026-04-14T12:34:20.140557",[113,118,123,128,133,138,143,148],{"id":114,"question_zh":115,"answer_zh":116,"source_url":117},32764,"为什么在 Conda 环境中激活后 Codex-CLI 没有响应？","这是因为 Codex-CLI 通常安装在默认 Python 环境中，而激活 Conda 环境后切换了 Python 解释器。解决方法是在你想要使用的特定 Conda 环境中重新安装 Codex-CLI 及其依赖。具体步骤：激活目标环境后，进入 Codex-CLI 目录运行 `python -m pip install -r requirements.txt` 或直接在该环境中安装相关包。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FCodex-CLI\u002Fissues\u002F117",{"id":119,"question_zh":120,"answer_zh":121,"source_url":122},32765,"在 Ubuntu 18 或旧版 Linux 上安装 Python 包失败怎么办？","OpenAI 库要求 Python 版本至少为 3.7.1，而 Ubuntu 18 默认搭载的是 Python 3.6.9，因此会导致安装失败。建议将 Ubuntu 升级到 20.04 或更高版本。如果无法升级系统，必须手动将 Python 升级到 3.7.1 以上版本。此外，在某些 Linux 环境下，直接使用 `pip install openai` 和 `pip install psutil` 可能比 `python -m pip install` 更有效。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FCodex-CLI\u002Fissues\u002F72",{"id":124,"question_zh":125,"answer_zh":126,"source_url":127},32766,"遇到 'Rate limit exceeded' (速率限制超出) 错误如何解决？","该错误通常是因为使用的是免费版的 OpenAI 账户，其 API 调用次数受限。解决方法是将 OpenAI 账户升级为付费账户（Paid Account），然后重新生成 API Key 并重新运行设置流程。确保在配置中使用了正确的模型（如 code-davinci-002）。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FCodex-CLI\u002Fissues\u002F126",{"id":129,"question_zh":130,"answer_zh":131,"source_url":132},32767,"在 Zsh 中按下 ^x 提示 'No such widget create_completion' 错误怎么办？","这通常由两个原因导致：1. 文件权限问题：需要给脚本添加执行权限，运行 `chmod +x codex_query.py`（或对应的插件脚本）。2. 路径配置错误：检查 `.zshrc` 中的 `ZSH_CUSTOM` 变量，确保它指向包含插件文件的正确父目录。例如，如果插件在 `~\u002FCode\u002FNL-CLI`，则应设置 `export ZSH_CUSTOM=\"~\u002FCode\"` 并在 source 时引用 `$ZSH_CUSTOM\u002FNL-CLI\u002Fnl_cli.plugin.zsh`，或者直接将 `ZSH_CUSTOM` 设为 `~\u002FCode\u002FNL-CLI`。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FCodex-CLI\u002Fissues\u002F28",{"id":134,"question_zh":135,"answer_zh":136,"source_url":137},32768,"Bash 安装后自动补全功能 (^x) 不生效且脚本报错？","早期版本的 Bash 插件脚本中可能存在路径错误（例如指向 `codex_query.py` 而非 `src\u002Fcodex_query.py`），且脚本可能缺少执行权限。请确保已更新到最新代码，检查脚本中的路径引用是否正确，并运行 `chmod +x codex_query.py` 赋予执行权限。如果问题依旧，建议拉取最新代码重试，因为维护者已针对多系统更新了 Bash 脚本。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FCodex-CLI\u002Fissues\u002F46",{"id":139,"question_zh":140,"answer_zh":141,"source_url":142},32769,"如何为 Codex-CLI 添加语音输入和输出功能？","目前不需要在工具内直接集成。对于语音输入：Windows 用户可以使用系统自带的 \"Win + H\" 快捷键进行听写；Mac 用户也有类似的听写功能。对于语音输出：项目文档中提供了如何结合 Azure Cognitive Services (Cog services) 设置语音合成的指南。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FCodex-CLI\u002Fissues\u002F23",{"id":144,"question_zh":145,"answer_zh":146,"source_url":147},32770,"文档中快捷键写法不统一 (CTRL+G vs Ctrl+g)，标准写法是什么？","根据社区惯例和项目的后续修正，标准写法应为 `Ctrl + G`（即 'Ctrl' 首字母大写，第二个键为大写字母）。虽然 `CTRL + g` 也能被识别，但为了文档一致性，现已统一采用 `Ctrl + G` 的格式。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FCodex-CLI\u002Fissues\u002F112",{"id":149,"question_zh":150,"answer_zh":151,"source_url":152},32771,"输入命令后出现奇怪的行为或返回无效建议是怎么回事？","这通常是因为在模型生成响应时用户重复输入或网络延迟导致提示符混乱。根本原因是缺乏“加载中”的状态提示。目前的临时解决方案是耐心等待响应，避免重复按键。开发团队已计划增加“加载信号”（loading signal）来改善用户体验，防止因重试输入而导致 prompt 损坏。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FCodex-CLI\u002Fissues\u002F91",[]]