AI

Grok Build Tutorial: Installation and Launch

今年无疑是 AI 编程工具竞争最激烈的一年。 原本以为 Claude Code 和 Codex 的竞争已经进入 […]

article directories

今年无疑是 AI 编程工具竞争最激烈的一年。

原本以为 Claude Code 和 Codex 的竞争已经进入白热化阶段,没想到马斯克旗下的 Grok 也强势入局,Grok 4.5 的发布再次掀起了一轮新的竞争。

从 AI 编程助手到终端 Agent 工具,整个行业正在经历一次重新洗牌。

过去 AI 编程领域主要围绕 GPT、Claude、Gemini 三大模型展开,而如今 Grok 的快速追赶,让市场格局出现了新的变化。

此前 Grok Build 曾经历过代码上传相关争议,但官方随后快速响应,并推动项目开源。随着透明度提升,越来越多开发者开始尝试并使用 Grok Build。

这篇文章主要分享 Grok Build 的安装流程以及初步使用体验,希望能帮助大家快速上手。

由于文章篇幅和图片数量有限,内容会拆分成多个部分发布,后续还会继续分享更多使用技巧。


Grok Build 安装

目前 Grok 官方提供的 CLI 工具主要就是 Grok Build。

除此之外,在 Cursor、API 服务、中转平台以及其他 AI Agent 工具中,也可以体验 Grok 能力,后续我会单独整理一篇详细介绍。

Grok Build 官方地址:

https://x.ai/cli

一键安装

官方提供了安装脚本,可以直接通过以下命令完成安装:

curl -fsSL https://x.ai/cli/install.sh | bash

安装完成后,可以使用下面的命令检查版本:

grok -v

Or:

grok version

如果需要升级版本,可以执行:

grok update

Grok Build 启动方式

Grok Build 的使用逻辑和 Claude Code CLI、Codex CLI 基本一致,都是面向终端环境的 AI Agent 工具。

If you have used similar products before, the cost of getting started will be very low.

Launch Grok Build:

grok

Or:

agent

When it is first launched, Grok will automatically open the browser for account verification.

If you don't have an account yet, you can go to register:

https://accounts.x.ai/account


How to use API Key

In addition to web login authentication, Grok Build can also be used through API Key.

Set environment variables:

export XAI_API_KEY="xai-..."

The Grok service can be called after configuration is complete.

In addition, X Premium users will receive Grok rights, and Premium+ users will also include SuperGrok rights.

You can directly log in to the corresponding X account to use it.


Login and Sign Out

Grok Build provides two ways to manage account status.

Use the command:

Login:

/login

Exit:

/logout

You can also use CLI commands directly:

grok login

Exit:

grok logout