中文资讯 掘金 AI Sun, 25 Oct 2026 正文 ok 430 words

工具解析:OneX AI 编程工具安装、配置与功能实战指南

英文标题:工具分享:OneX AI 工具安装、配置及功能介绍

本文详细介绍了面向 Go 生态的 Harness AI Coding 工具 onexai 的下载安装、AKSK 配置及核心能力架构。该工具不仅内置覆盖 50 多项 Go 团队开发规范与完备的服务脚手架,还深度集成了 MCP 协议与 Claude Code 等 AI 编码环境。实战演示表明,开发者只需单条自然语言提示词即可驱动 AI 自动构建符合规范的前后端全栈代码,显著降低了确定性工程规范在 AI 辅助编码落地中的实施门槛。
打开原文相关 3 · 机会 0
media3.2 KB media589 B media55.0 KB media21.1 KB media62.1 KB media15.2 KB

中文

  • OneX 知识平台:一个面向 AI 时代的知识交付平台,提供 12+ 高质量体系课、4+ 实战项目,涵盖 Go、云原生、AI 等领域。
  • 微信公众号 令飞编程:分享 Go、云原生、AI Infra 相关技术。回复「资料」免费下载 Go、云原生、AI 等学习资料。

今天来分享如何快速下载并使用 onexai 工具高效开发代码。当前 onexai 支持 Windows 和 macOS 系统。

下载并配置 onexai 工具

onexai 下载地址为:onex.feizaonet.com/downloads。请根据操作系统和 CPU 架构下载对应的 Tar 包,解压后放置在系统的 PATH 路径中。

配置 onexai 工具

进入 onex.feizaonet.com/account?tab… 页面,创建一对 AKSK(注意:AKSK 仅限会员创建)。点击“创建 AccessKey”按钮生成密钥对。请妥善保存密钥,严禁共享或外传。

编辑 $HOME/.onexai/onexai.yaml 配置文件,填入上述创建的 AKSK:

yaml user: access-key: ak-xxxxxxxxx secret-key: sk-xxxxxxxxxxxxxxx

进入你的 Go 项目目录中,执行以下命令进行初始化:

bash $ onexai ide init -h $ onexai ide init --ide=claude ▸ Claude Code ✓ .claude/settings.local.json ✓ .claude/commands/onexai.md ✓ .claude/commands/onex-commit.md ✓ .claude/commands/onex-review.md ✓ .claude/skills/onexai-conventions.md

✓ IDE initialization complete. Restart your IDE for changes to take effect.

onexai 命令介绍

onexai 中集成了许多实用功能,部分功能目前处于隐藏状态,例如:聊天室、小工具、Code IDE 等。onexai 未来将打造成一款全能的 cliops 工具。

当前已提供的功能可通过 onexai -h 查看:

text [colin@local onexai]$ onexai -h onexai is a command-line tool for the onex technology stack scaffold..

Find more information at: https://github.com/feizaonet/onexai/blob/master/docs/guide/en-US/cmd/onexai/onexai.md

Basic Commands (Beginner): upgrade Upgrade onexai to the latest version

Project Commands: create Create a new project

Manifest Generation Commands: completion Output shell completion code for the specified shell (bash, zsh, fish, or powershell)

Troubleshooting and Debugging Commands: sysload Display system load information for performance troubleshooting cleanup-zombies Clean up zombie processes for the current user

Convention Commands (AI Coding): convention Query Go development conventions and coding standards used by the OneX team

Standard Commands (IT Governance): standard Query and enforce the enterprise IT naming & grading standards

Local Development Commands: compose Manage the local OneX backend services

AI Commands: rag Semantic search over the OneX knowledge base using RAG mcp Start an MCP server exposing onexai commands as tools

Other Commands: version Print the client version information

Usage: onexai [flags] [options]

Use "onexai --help" for more information about a given command. Use "onexai options" for a list of global command-line options (applies to all commands).

核心命令解析

  • create:脚手架父命令,用于创建 Go 项目开发中常见的各类服务类型:
    • webserver:Web 服务器,支持多种主流 Web 框架,例如 gin、kratos、grpc、echo、fiber、go-zero、kitex、hertz、iris 等;
    • api:为 Web 服务新增 REST 类型的资源实现,打通 Handler -> Biz -> Store 三层代码链路;
    • jobserver:创建异步任务服务器,支持 CronJob、普通 Job 及自定义 Job,具有极强的可插拔与扩展能力;
    • job:为已有 JobServer 追加指定资源类型的异步任务处理器;
    • mqserver:创建独立的 MQServer(消息队列消费者)项目;
    • mq:为项目创建消息队列消费者与处理器;
    • mcpserver:创建独立的 MCPServer(Model Context Protocol 服务器)项目;
    • mcp:为项目创建 MCP 工具命名空间;
    • clitool:创建独立的 CLI 工具项目;
    • cmd:为 CLI 项目创建 Cobra 子命令;
    • console:创建现代 Web 前端(控制台)项目;
    • micro:为已有 Web 控制台项目创建微前端子应用;
    • declserver:创建独立的声明式(kube-apiserver 风格)API 服务器项目;
    • crd:为已有 declserver 项目追加 REST 资源(CRD);
    • controller-manager:创建独立控制器聚合(kube-controller-manager 风格)项目;
    • controller:为已有 controller-manager 项目追加控制器;
    • operator:创建独立的 controller-runtime Operator 项目;
    • operator-api:为已有 Operator 项目追加 CRD 及其控制器。
  • convention:查询 OneX 团队维护的 Go 开发规范全集。内置约 50~60 种规范,全面覆盖 Go 工程开发的各个细节,后续会持续迭代维护。
  • mcp:启动 MCP 服务器,将 onexai 子命令注册暴露为工具,供 Claude 等 AI 智能助手驱动脚手架执行。
  • ide:初始化 onexai 集成的 AI 编码 IDE 配置。

实战演示

bash $ mkdir onexdemo $ cd onexdemo $ onexai ide init --ide=claude $ claude .

请帮我创建一个博客平台,平台支持帖子、点赞、收藏 3类能力。使用内存数据库。完成前后端接线,并启动前端。

若希望 AI 严格按照 OneX 规范进行开发,可在 Prompt 中增加 /onexai 指令前缀:

/onexai 请帮我创建一个博客平台,平台支持帖子、点赞、收藏 3类能力。使用内存数据库。完成前后端接线,并启动前端。

约 10 分钟后,在本地浏览器访问 http://127.0.0.1:3000:

博客平台运行界面

查验生成代码后可以看到,其编码规范、开发方式、架构分层及设计理念均保持高度一致。

上述项目的后端已经按 OneX 规范生成。如果希望前端界面同样遵循规范设计,可以进一步输入:

text /onexai 请帮我创建一个博客平台,平台支持帖子、点赞、收藏 3类能力。使用内存数据库。完成前后端接线,并启动前端。前端也要使用onex规范

生成后的前端系统界面如下:

前端规范界面 1

前端规范界面 2

在生成过程中,博客平台被集成到了统一的前端控制面内。得益于整套前端基于微前端架构设计,开发者可以轻松地将博客模块抽离独立,并基于现有界面进行功能定制与二次开发。

全程无需繁琐配置各类编码规范与前后端通信细节,仅凭一条命令,AI 即可按照标准范式自动交付立即可用的前后端代码。

onexai 未来规划

Harness AI Coding 要达到理想预期是一项精细化工程,依赖于对 Skill、MCP、RAG 及模型推理全流程的持续调优。onexai 未来将围绕这些能力展开持续打磨,全面达成稳定、精准、规范、一致的技术目标。

English / 原文

  • OneX 知识平台:一个面向AI时代的知识交付平台,12+ 高质量体系课、4+ 实战项目,涵盖 Go、云原生、AI 。
  • 微信GZH 令飞编程:分享 Go、云原生、AI Infra 相关技术。回复「资料」免费下载 Go、云原生、AI 等学习资料

今天来分享下如何快速下载并使用onexai工具,快速开发代码。当前onexai支持 Windows 和 MAC。

下载并配置onexai工具

onexai 下载地址为:onex.feizaonet.com/downloads 请根据操作系统和CPU架构下载对应的Tar包,解压后放在 PATH 路径中。

配置 onexai 工具

进入 onex.feizaonet.com/account?tab… 页面,创建一堆 AKSK。注意 AKSK 只有会员可以创建。点击创建 AccessKey 按钮,创建一对密钥。注意密钥要妥善保存、禁止共享、禁止外传。

编辑 $HOME/.onexai/onexai.yaml 文件,配置上面创建的AKSK。配置后,内容如下:

user:
  access-key: ak-xxxxxxxxx
  secret-key: sk-xxxxxxxxxxxxxxx

进入你的Go项目中,执行以下命令初始化:

$ onexai ide init -h 
$ onexai ide init --ide=claude 
▸ Claude Code
  ✓ .claude/settings.local.json 
  ✓ .claude/commands/onexai.md 
  ✓ .claude/commands/onex-commit.md 
  ✓ .claude/commands/onex-review.md 
  ✓ .claude/skills/onexai-conventions.md 

✓ IDE initialization complete.
Restart your IDE for changes to take effect.

onexai 命令介绍

onexai 中有很多好用的命令,当前处在隐藏状态,例如:聊天室、小工具、Code IDE等等。onexai 未来会打造成为一个cliops工具。

当前已有的功能,可以通过onexai -h查看:

[colin@local onexai]$ onexai -h
onexai is a command-line tool for the onex technology stack scaffold..

 Find more information at: https://github.com/feizaonet/onexai/blob/master/docs/guide/en-US/cmd/onexai/onexai.md

Basic Commands (Beginner):
  upgrade           Upgrade onexai to the latest version

Project Commands:
  create            Create a new project

Manifest Generation Commands:
  completion        Output shell completion code for the specified shell (bash, zsh, fish, or powershell)

Troubleshooting and Debugging Commands:
  sysload           Display system load information for performance troubleshooting
  cleanup-zombies   Clean up zombie processes for the current user

Convention Commands (AI Coding):
  convention        Query Go development conventions and coding standards used by the OneX team

Standard Commands (IT Governance):
  standard          Query and enforce the enterprise IT naming & grading standards

Local Development Commands:
  compose           Manage the local OneX backend services

AI Commands:
  rag               Semantic search over the OneX knowledge base using RAG
  mcp               Start an MCP server exposing onexai commands as tools

Other Commands:
  version           Print the client version information

Usage:
  onexai [flags] [options]

Use "onexai <command> --help" for more information about a given command.
Use "onexai options" for a list of global command-line options (applies to all commands).

命令解析:

  • create:脚手架父命令,用来创建各类Go项目开发中,常用的服务类型。例如:

    • webserver:Web服务器,支持各种Web框架,例如:gin、kratos、grpc、echo、fiber、go-zero、kitex、hertz、iris等;

    • api:给Web服务新增加一个REST类型的资源实现。能实现Handler -> Biz -> Store 3 层的代码打通;

    • jobserver:创建一个异步任务服务器;支持CronJob、Job及自定义的Job,而且扩展能力、可插拔能力非常强;

    • job:为已有 JobServer 追加指定资源类型的异步任务处理器;

    • mqserver:创建独立 MQServer(消息队列消费者)项目

    • mq: 为项目创建消息队列消费者与处理器;

    • mcpserver:创建独立 MCPServer(Model Context Protocol 服务器)项目;

    • mcp: 为项目创建 MCP 工具命名空间;

    • clitool: 创建独立 CLI 工具项目;

    • cmd: 为 CLI 项目创建 Cobra 子命令;

    • console: 创建现代 Web 前端(控制台)项目;

    • micro: 为已有 Web 控制台项目创建微前端子应用;

    • declserver: 创建独立声明式(kube-apiserver 风格)API 服务器项目。;

    • crd: 为已有 declserver 项目追加 REST 资源(CRD);

    • controller-manager: 创建独立控制器聚合(kube-controller-manager 风格)项目;

    • controller: 为已有 controller-manager 项目追加控制器;

    • operator: 创建独立 controller-runtime Operator 项目;

    • operator-api: 为已有 Operator 项目追加 CRD 及其控制器;

  • convention: 查询 OneX 团队维护的 Go 开发规范全集。里面有大概 有50~60 种规范,几乎涵盖了 Go 项目开发中的方方面面,可以自行查阅,后期也会持续维护。

  • mcp:启动 MCP 服务器,把 onexai 子命令暴露为工具,供 Claude 等 AI 助手驱动脚手架;

  • ide: 初始化 onexai 集成的 AI 编码 IDE 配置;

实战演示

$ mkdir onexdemo
$ cd onexdemo
$ onexai ide init --ide=claude 
$ claude .
> 请帮我创建一个博客平台,平台支持帖子、点赞、收藏 3类能力。使用内存数据库。完成前后端接线,并启动前端。

或者你也也可以让AI确定性用OneX规范开发项目,可以这么问:/onexai 请帮我创建一个博客平台,平台支持帖子、点赞、收藏 3类能力。使用内存数据库。完成前后端接线,并启动前端。

大约10分钟后,请在本地浏览器打开 http://127.0.0.1:3000:

image.png

你可以看下代码,跟你课程中学到的规范、开发方式、代码架构、设计理念等几乎是保持一致的。

上面项目的后端已经是按OneX 的方式开发的。前端因为比较简单,所以没有用前端。你还可以这么问,让AI也是用onex的规范来开发前端:

/onexai 请帮我创建一个博客平台,平台支持帖子、点赞、收藏 3类能力。使用内存数据库。完成前后端接线,并启动前端。前端也要使用onex规范

开发完成后的界面如下:

image.png

image.png

上面开发时将博客平台放在了一个统一前端控制面中,因为整个前端采用的是微前端架构。所以,你可以很容易的将博客平台独立出来。之后,你可以基于当前的界面对博客平台进行微调,实现自己的博客平台。

可以看到全程,你没有任何规范约束、前后端约束只用一条命令,就让AI按照你学的东西开发出来前后端代码,并且可以直接使用。

onexai 未来规划

Harness AI Coding 要想达到一个预期的状态,是一个精细活,需要不断的对SKILL、MCP、RAG及推理流程进行调优改进。所以onexai未来会持续不断的去调优,以实现稳定、精准、规范、一致的目标。