01. Install, Credentials, and First Success
Build from source
Matcha CLI is a local, bring-your-own-key tool. There is no official installer, no GitHub Release, and no Homebrew, npm, Winget, or Scoop package. You build the matcha binary from a Matcha CLI source checkout and run the binary you compiled.
The product command is matcha. The Cargo package that produces it is still named xai-grok-pager-bin. That package name is internal; it is not the product name. matcha --version prints the Matcha product version, not the crate version.
What the build produces
A release build writes three artifacts that share the same program and choose behavior from argv0. Put matcha on your PATH. Do not treat grok as the product command.
| Binary | Role |
|---|---|
matcha | The CLI to put on your PATH |
grok | Compatibility shim. Same code; a deprecation message on stderr only |
xai-grok-pager | Internal leftover name. Do not teach or install this as the product |
Default Cargo output is target/release/ under the checkout. If you set CARGO_TARGET_DIR, the same names appear under $CARGO_TARGET_DIR/release/ instead.
Install the toolchain
Work from the repository root of your Matcha CLI checkout.
- Rust:
rust-toolchain.tomlpins 1.94.0.rustupinstalls that toolchain on the firstcargoinvocation. - DotSlash: required so hermetic tools under
bin/(notablybin/protoc) can download and run. PutdotslashonPATHbefore building. - protoc: proto codegen resolves
bin/protocvia DotSlash, or falls back to aprotoconPATH/$PROTOC.
cargo install dotslash
# or: prebuilt packages — https://dotslash-cli.com/docs/installation/
/usr/bin/env dotslash --help # sanity checkBuild the binary
Always target the crate. A full-workspace build is slow and is not required:
cargo build -p xai-grok-pager-bin --releaseUseful variants:
cargo check -p xai-grok-pager-bin # fast compile check
cargo run -p xai-grok-pager-bin # debug build + launch the TUIOn macOS Apple Silicon, a repeatable local attestation (isolated /tmp; it does not publish an installer) is:
python3 scripts/rebrand/macos_local_attestation.pyConfirm you are invoking this build
If another matcha already exists on PATH, do not overwrite it. Invoke this binary by path until you confirm there is no collision:
command -v matcha
./target/release/matcha --version
# if CARGO_TARGET_DIR is set:
# "$CARGO_TARGET_DIR/release/matcha" --version--version, -v, and -V are equivalent early flags. The subcommand form prints the same payload:
./target/release/matcha version
./target/release/matcha v
./target/release/matcha version --jsonPlain output is one line: matcha <product-version-with-commit> plus a channel label when one is configured. --json prints currentVersion and channel only (no secret values). Invoking the grok shim prints a deprecation on stderr and keeps stdout clean so JSON and --version stay parseable.
Optional: shell completions
matcha completions writes a completion script to stdout. It is side-effect free (no network, no auth). The generated script is always named for matcha, even if you invoked the grok shim. It never overwrites leftover grok completion files.
# bash
./target/release/matcha completions bash > ~/.local/share/bash-completion/completions/matcha
# zsh — put the file on your fpath, then compinit
./target/release/matcha completions zsh > "${fpath[1]}/_matcha"
# fish
./target/release/matcha completions fish > ~/.config/fish/completions/matcha.fish
# powershell / elvish are also accepted by clap
./target/release/matcha completions powershell
./target/release/matcha completions elvishReload the shell (or source the file) before expecting matcha <Tab> to work.
Put matcha on PATH
Only after the collision check: copy or symlink the binary to a directory you already have on PATH, or prepend the release directory:
export PATH="/absolute/path/to/this/build/release:$PATH"
hash -r # bash/zsh: drop a stale hashed matcha
command -v matcha
matcha --versionNot available
Do not treat these as install procedures:
- GitHub Releases, curl or PowerShell installers, npm, Homebrew, Winget, or Scoop — not published.
matcha update(--check,--force-reinstall,--version,--alpha/--stable) — there is no automatic update channel. Rebuild from source.matcha setup— there is no remote configuration to fetch.