Home › Grok Build course: 3 beginner lessons

Grok Build course: 3 beginner lessons

Last checked

What it does

Grok Build is SpaceXSI's coding agent. It runs in your terminal on your own project, plans changes, edits files and runs commands, and can also run headlessly in scripts.

Who it's for: Developers who want an AI coding agent in the terminal that reads and edits a real project.

Made by SpaceXSI. SpaceXSI's own docs describe Grok as “SpaceXSI's assistant”.

Sign up and log in
  1. On macOS, Linux or WSL, install it with: curl -fsSL https://x.ai/cli/install.sh | bash
  2. On Windows (PowerShell): irm https://x.ai/cli/install.ps1 | iex
  3. Open a terminal in your project folder and run: grok
  4. On first launch it opens a browser so you can sign in.
  5. On a server with no browser, set XAI_API_KEY to an API key instead, then run grok.

x.ai/build says Grok Build is available to try for free. On x.ai/pricing, Free lists limited Grok Build use, and Grok Build is included from the Plus plan (US$8/month) with a shared usage pool.

Lesson 1: Install it and explore a project

The best first job for a coding agent is reading, not writing: ask Grok Build to explain the code you already have before you let it change anything..

  1. Install Grok Build with the command for your system (see Sign up and log in).
  2. cd into a project you know well and run grok.
  3. Sign in in the browser window that opens.
  4. Ask it to explain the repo, then point it at one file with @, for example @src/main.rs.
  5. Ask follow-up questions until its summary matches what you know about the code.

Open lesson 1 →

Lesson 2: Plan big changes before any edit

For anything bigger than a one-line fix, plan mode makes Grok Build write a plan first.

  1. Start the task in plan mode.
  2. Describe the change and the constraints (for example: keep the old login working for 7 days).
  3. Read the plan in the plan viewer.
  4. Approve it, comment on single steps, or rewrite it.
  5. After approval, review each change as a diff before you commit.

Open lesson 2 →

Lesson 3: Teach it your rules and run it from scripts

Once it works in your project, make it work your way: an AGENTS.md file and skills give it your conventions, and headless mode lets scripts and automations call it..

  1. Add an AGENTS.md file to the project with your rules (test command, code style, folders to avoid).
  2. Turn a session that went well into a reusable skill with /skillify.
  3. Skills run automatically when a task matches, or you call them by name.
  4. For scripts, run grok -p "your prompt" to get an answer without the full-screen interface.
  5. Add --output-format streaming-json when another program needs to read the output.

Open lesson 3 →

Sources

Start Lesson 1 →

Also: All SpaceXSI products · Grok app course · All tutorials

Report an error on this page