标签归档:OpenAI

[ByAIGC] Windows 从零装 AI 编程代理(三):Codex CLI

说明:本文为 AIGC 辅助撰写整理,基于官方文档核实,供快速上手参考。具体细节以官方文档为准。

Codex CLI 是 OpenAI 出品的、在本地运行的终端编码代理,直接用 ChatGPT 订阅或 API Key 登录即可。

1. 安装

在 PowerShell 里执行官方安装脚本:

powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"

也可以只用 npm(上一篇已装 Node):npm install -g @openai/codex

装完重开一个终端,验证:

codex --version

2. 登录

首次运行:

codex

选择 Sign in with ChatGPT。这会用你的 ChatGPT Plus / Pro / Business 等订阅直接使用 Codex,最省事。

想用 API Key 方式也可以,但要额外配置(codex login --api-key 等),对大多数个人用户,直接用 ChatGPT 订阅最简单。

3. 开始使用

进入项目目录:

cd 你的项目路径
codex

然后像跟同事对话一样描述任务即可。Codex 能读代码、改文件、跑命令。

  • 看它怎么想codex exec 可让代理执行并回显。
  • 批量/脚本化codex exec "把这段日志里的报错找出来" 可直接传参运行。

4. 在编辑器里用(可选)

Codex 也提供了 VS Code / Cursor / Windsurf 的插件,以及桌面应用(codex app)。终端版够用,编辑器可选。

搞定

codex

登录后即可工作。下一篇:DeepSeek Harness(DeepSeek 官方)。

[Windows 从零搭建 AI 编程代理]

ChatGPT 注册方法(附万能接码方法)

ChatGPT 是一个训练有素的语言模型,由 OpenAI 公司训练而成。目的是帮助回答问题,提供信息和支持,但不具备人类的感知能力,也不会回答所有问题。

以上自我介绍原始内容来自 ChatGPT 回答。

目前已经有人用 ChatGPT 开始水帖、水回答,目前 Stack Overflow 已经暂时屏蔽来自 ChatGPT 的回答。

V2ex,即刻等社交媒体的 ChatGPT 浓度极高,这样一款充满争议性和未来感的 AI,目前处于公测阶段,可以尝试,本文介绍其注册方法。

注册步骤

注册步骤就是常规的帐号密码,难点主要在短信验证,其余部份暂时略过。

短信验证

使用 sms-man 接码,一次几美分,失败可退款重试。

充值有最低值限制,也不浪费,还能用于注册各种平台,如 Apple ID, PayPal 等。

注册充值后,购买一次 OpenAI 的短信接码,之后不断点击接收,若长时间无法接收,则删除重试:

成功后将验证码回填 OpenAI 即可。

对了,这个 OpenAI 登陆时的验证码是区分大小写的:

演示

可以请他帮忙写文章:

甚至实现常见算法:

有没有一种强烈的危机感。

这款软件的出现,将大神和菜鸟的差距进一步拉大。

一次简单的对话

tl.song: Can you help me implement insertion sort in python

ChatGPR: Yes, I’d be happy to help you implement insertion sort in Python! Here’s an implementation you can use as a starting point:

def insertion_sort(arr):

# Iterate over the array, starting at index 1

for i in range(1, len(arr)):

# Save the value at the current index

current_value = arr[i]

# Iterate backwards over the sorted portion of the array

j = i
while j > 0 and arr[j - 1] > current_value:
# Shift the larger value to the right
arr[j] = arr[j - 1]
j -= 1

# Insert the saved value into the correct position

arr[j] = current_value

return arr

To use this implementation, you can call the insertion_sort function and pass in the array you want to sort. For example:

arr = [5, 1, 4, 2, 8]
sorted_arr = insertion_sort(arr)

# sorted_arr will be [1, 2, 4, 5, 8]

Insertion sort is a simple sorting algorithm that works well for small arrays or partially-sorted arrays, but it is not very efficient for large arrays. It has a time complexity of O(n^2) in the worst case, so it is not suitable for sorting very large arrays.

不仅实现了代码,还附带分析时间复杂度,程序员这碗饭越来越难抢了。

参考文献