今天来分享下如何快速下载并使用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 # 查看 AI Coding IDE 初始化帮助。当前支持 claude, opencode, crush, cursor
$ onexai ide init --ide=claude # 如果你用的是claude code command line tool
▸ Claude Code
✓ .claude/settings.local.json # 默认开启 onexai mcp server
✓ .claude/commands/onexai.md # onexai 编程命令。在 IDE 中键入 /onexai <Your Prompt> 会用onexai 的方式来开发代码
✓ .claude/commands/onex-commit.md #
✓ .claude/commands/onex-review.md # 使用 onexai 提供的方式来 Review 代码
✓ .claude/skills/onexai-conventions.md # OneX 的规范 SKILl,由模型自己判定合适调用
✓ 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 项目开发中的方方面面,可以自行查阅,后期也会持续维护。
- overview: 查看当前所有的规范列表;
- check: Go 代码运行具备确定性检查器的规范规则;
- 各类其他规范,请自行查阅
- mcp:启动 MCP 服务器,把 onexai 子命令暴露为工具,供 Claude 等 AI 助手驱动脚手架;
- ide: 初始化 onexai 集成的 AI 编码 IDE 配置;
实战演示
$ mkdir onexdemo
$ cd onexdemo
$ onexai ide init --ide=claude # 我用的 CLAUDE CODE
$ claude .
> 请帮我创建一个博客平台,平台支持帖子、点赞、收藏 3类能力。使用内存数据库。完成前后端接线,并启动前端。
或者你也也可以让AI确定性用OneX规范开发项目,可以这么问:/onexai 请帮我创建一个博客平台,平台支持帖子、点赞、收藏 3类能力。使用内存数据库。完成前后端接线,并启动前端。
大约10分钟后,请在本地浏览器打开 http://127.0.0.1:3000:
你可以看下代码,跟你课程中学到的规范、开发方式、代码架构、设计理念等几乎是保持一致的。
上面项目的后端已经是按OneX 的方式开发的。前端因为比较简单,所以没有用前端。你还可以这么问,让AI也是用onex的规范来开发前端:
/onexai 请帮我创建一个博客平台,平台支持帖子、点赞、收藏 3类能力。使用内存数据库。完成前后端接线,并启动前端。前端也要使用onex规范
开发完成后的界面如下:
上面开发时将博客平台放在了一个统一前端控制面中,因为整个前端采用的是微前端架构。所以,你可以很容易的将博客平台独立出来。之后,你可以基于当前的界面对博客平台进行微调,实现自己的博客平台。
可以看到全程,你没有任何规范约束、前后端约束只用一条命令,就让AI按照你学的东西开发出来前后端代码,并且可以直接使用。
onexai 未来规划
Harness AI Coding 要想达到一个预期的状态,是一个精细活,需要不断的对SKILL、MCP、RAG及推理流程进行调优改进。所以onexai未来会持续不断的去调优,以实现稳定、精准、规范、一致的目标。
本文由 AI图鉴自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
Share today how to download quickly and develop code quickly using the Onexai tool. Current onexai supports Windows and MAC.
Download and configure anonexai tools
Onexai downloads at:onex.feizaonest.com/downloads. Please download the corresponding Tarbags according to the operating system and the CPU structure and release them in the PATH path.
Configure onexai tools
Enter onex.feizanet.com/account?tab... to create a bunch of AKSK pages. Attention AKSK only members can create. Click to create AccessKey button and create a pair of keys. Note that the key is properly preserved, is forbidden to share, and is not allowed to be uploaded.
Edits the $HOME/.onexai/onexai.yaml file to configure the AKSK created above. The configuration would read as follows:
user:
access-key: ak-xxxxxxxxx
secret-key: sk-xxxxxxxxxxxxxxx
Enter your Go project and execute the following initialization:
$ onexai side init-h # View AI Coding IDE Initialisation Help. Current support
♪ If you use claude code line tool
▸ Claude Code
.claude/settings.local.json # default onexai mcp server
.claude/committees/onexai.md #onexai programming command. Type in IDE /onexai < Your Prompt> to develop code in anonexai
✓ .claude/commands/onex-commit.md #
~.claude/committees/onex-review.md # Use onexai to provide the Review code
✓.claude/skills/onexai-conventions.md #OneX standard SKILL, as determined by the model itself
✓ IDE initialization complete.
Restart your IDE for changes to take effect.
Onexai command introduction
Onexai has a lot of good commands that are hidden, such as chat rooms, small tools, Code IDE, etc. Onexai is going to build a cloops tool.
Current features can be viewed through anonexai-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).
Command parsing:
- Create: Scaffold Father ' s Order, which creates the type of service that is commonly used in the development of various Go projects. For example:
- Webserver: Web server, which supports various Web frameworks such as gin, kratos, grpc, echo, fiber, go-zero, kitex, hertz, iris, etc.;
- api: a new REST type of resource for Web services. Getting Handler-Biz-Store 3 through the code;
- Jobserver: create a walker server; support CronJob, Job and the self-defined Job, and have a very expanded capacity, which can be inserted;
- Job: an alternative task processor that assigns a resource type to an existing JobServer;
- mqserver: Create independent MQServer project
- mq: Create news queue consumers and processors for projects;
- mcpserver: creation of an independent MCPServer (Model subject Protocol server) project;
- mcp: Create a MCP tool naming space for projects;
- Clitool: Create independent CLI tools;
- cmd: Create Cobra sub-commands for CLI projects;
- Console: Creation of the Modern Web Frontend (Console) Project;
- Microend: create microend applications for existing web console projects;
-declserver: Creates an API server item (kube-apiserver style).;
- crd: Additional RET resources for existing declserver projects;
- Controller-manager: Create independent controller aggregation (kube-controller-manager style) projects;
- Controller: Additional controller for existing projects;
- Oporator: Create a stand-alone project of contact-runtime Operator;
- Oporator-api: Add CRD and its controllers to the existing Operator project;
-Convention: Query the full set of Go development specifications maintained by the OneX team. There are about 50-60 norms that cover almost all aspects of Go project development and are freely accessible, and post-production will be maintained on an ongoing basis.
- Overview: view all current norms;
- Check: Go Code runs with the rules of certainty checker;
- Various other norms, available for consultation
- mcp: Activate the MCP server and expose the onexai sub-commands as a tool for Claude et al. AI drive scaffolding;
- ide: Initialize onexai integration AI code IDE configuration;
Field Presentation
$ mkdir onexdemo
$ cd onexdemo
# I'm using CLAUDE CODE
$ claude .
> Please help me create a blog platform that supports posts, praises, collections of three types of capabilities. Use the memory database. Finishes the front-end connection and starts the front-end.
Or you can also get AI to use OneX for certainty, so ask: /onexai, please help me create a blog platform that supports posts, praises, collections, three types of capabilities. Use the memory database. Finishes the front-end connection and starts the front-end.
In about 10 minutes, please open the local browser at http://127.0.0.1:3000:
You can read the code, and it's almost consistent with the norms, the way you've developed, the code architecture, the design concept, etc. that you've learned in your curriculum.
The back end of the above item has been developed as OneX. The front end was not used because it was simple. You can also ask, so that AI can also develop the front end using the norm of Onex:
Please help me create a blog platform that supports posts, praises, collections of three types of capabilities. Use the memory database. Finishes the front-end connection and starts the front-end. Use anonex code for the front end.
The interface after the development is completed is as follows:
The blog platform was developed on a unified front-end control side, as the whole front-end uses a microfront structure. So you can easily separate the blog platform. After that, you can fine-tune your blog platform based on the current interface and make it your own.
You can see the whole process, you don't have any discipline, you use only one command, so AI develops back-end codes based on what you learn and can use them directly.
Onexai, future planning.
For Harness AI Coding to achieve an expected state of affairs, it is a delicate task that requires constant fine-tuning of SKILL, MCP, RAG and the reasoning process. Therefore, the future of Onexai will be constantly fine-tuned to achieve stability, precision, discipline and consistency.
Auto-fetched and translated by AI Atlas. All rights belong to the original author.