Brokspace

Getting started with Brokspace

Esta página ainda não foi traduzida; ela aparece em inglês.

From zero to a productive workspace in about 15 minutes. Each step is short; skip what you do not need.

  1. Install brok
  2. Get a local LLM (optional)
  3. Set up your first workspace
  4. Use it every day
  5. Connect your coding agent
  6. Configure
  7. Skills
  8. Shards
  9. Troubleshooting
  10. Update brok
  11. Uninstall

1. Install brok

macOS / Linux

curl -fsSL https://raw.githubusercontent.com/brokspace/brok/main/scripts/install.sh | sh

Windows (PowerShell)

irm https://raw.githubusercontent.com/brokspace/brok/main/scripts/install.ps1 | iex

Both install two programs, brok and brok-agent, and check their checksums. Open a new terminal and check:

brok --version

Company laptop blocks the script? Download brok-windows-x86_64.exe from the brok release and brok-agent-windows-x86_64.exe from the agent release, rename them brok.exe and brok-agent.exe, put both in one folder and add that folder to your PATH.

Homebrew (macOS and Linux):

brew install brokspace/brok/brok
brew install brokspace/brok/brok-agent   # optional, the default agent

Using the VS Code extension? You can skip this step: if brok is missing, the extension offers to download it (verified against its published SHA-256, kept in the extension's own folder). A brok installed here always takes precedence. See Brokspace for VS Code.

Prefer Cargo? cargo install brok-cli brok-agent (needs a C compiler and protoc), or cargo install brok-cli brok-agent --no-default-features for a lighter build with text search only.


2. Get a local LLM (optional)

Search works without any LLM. Answers (brok ask, chat, review, commit) need one. A local model is free, private and works offline.

Ollama (recommended):

OSInstall
Windowswinget install Ollama.Ollama
macOSbrew install ollama
Linuxcurl -fsSL https://ollama.com/install.sh | sh

Pick the model for your machine:

Your machineModelDownload
8 GBqwen2.5-coder:1.5bollama pull qwen2.5-coder:1.5b
16 GB, no GPU (most business laptops)qwen2.5-coder:3bollama pull qwen2.5-coder:3b
16 GB with a GPU (6 GB+) or Apple Silicon; 32 GB without a GPUqwen2.5-coder:7bollama pull qwen2.5-coder:7b
A GPU with 12 GB+, or 32 GB with a GPU or Apple Siliconqwen2.5-coder:14bollama pull qwen2.5-coder:14b

Not sure? Skip the pull: brok init (next step) measures your machine and offers to download the right one.

Small models (1.5b, 3b) are fine for questions (ask, chat); reviews and commit messages are much better with 7b or larger. Without a GPU, a 7b model takes a few minutes per review, which is why the table suggests 3b there.

Prefer a graphical app? LM Studio works too: download a model, open Developer / Local Server and press Start Server. More in Local LLM setup.


3. Set up your first workspace

Go to your project (one repository, or a folder holding several) and run (want a sample project first? clone example-nestjs):

cd ~/code/my-project
brok init

It walks through six steps and asks before anything big:

StepWhat happens
1. WorkspaceCreates .brokspace/ with a commented brok.yml
2. AgentInstalls brok-agent, the helper that tracks changes and talks to the LLM
3. Semantic searchDownloads the search model once (~140 MB, shared by all your projects)
4. Local LLMFinds Ollama / LM Studio and picks a model that fits your machine
5. IndexIndexes your code (functions, classes and sections, not raw text)
6. Coding agentsConnects Claude Code, Cursor, VS Code or Codex (skills + search tool)

Want no questions? brok init --yes accepts every recommendation. Then check the result:

brok doctor

Every line is either ✓, or a ! with the exact command that fixes it.

Your next project is faster: the search model and your LLM choice are remembered, so brok init there takes seconds.


4. Use it every day

brok search "where do we validate tokens"     # find code by meaning or by name
brok ask "how does the refresh flow work?"    # an answer from your LLM, with sources
brok chat                                     # a conversation with follow-up questions
brok review                                   # AI review of your uncommitted changes
git add -p && brok commit                     # commit message written from the staged diff

The first ask, chat, review or commit starts brok in the background. From then on the index follows you: saved files, commits, pulls and branch switches are picked up within seconds.

You want to...Run
Start / stop the background servicebrok start / brok stop
Restart it after editing brok.ymlbrok restart
See what it is doingbrok logs -f
See what is indexedbrok status
Review only staged changes, or a branchbrok review --staged / brok review --base main
Just print a commit messagebrok commit --print
Use a different model for one questionbrok ask -p anthropic "..."
Show whole results, or JSON for scriptsbrok search "..." --full / --json
Rebuild the index from scratchbrok index --rebuild
Tab completionbrok completions bash >> ~/.bashrc (also zsh, fish, powershell)

About AI reviews. With a local 7b model, brok review is a quick first pass: it catches slips you would rather not push, but it also gets things wrong (we have seen it invent a missing validation). Read its findings as questions, not verdicts. For a review you want to rely on, use a 14b model or a hosted one for that run: brok review -p anthropic (see Configure for API keys).

Inside brok chat: /skill grill-me applies a skill to the conversation, /clear forgets it, /exit leaves.


5. Connect your coding agent

If you skipped step 6 of brok init:

brok setup agents

It detects your agents and, for each one, adds:

  • a search tool (brok_search) through MCP, so the agent finds code by meaning before grepping;
  • the built-in skills, such as /ask-brok, /grill-me, /to-spec, tdd and code-review.
AgentFiles written
Claude Code.mcp.json, .claude/skills/
Cursor.cursor/mcp.json, .agents/skills/
VS Code / Copilot.vscode/mcp.json, .agents/skills/
Codex.agents/skills/ (prints the MCP lines for ~/.codex/config.toml)

Commit these files and your whole team gets the same setup. In your agent, start with /ask-brok and describe what you want to do.


6. Configure

Everything lives in .brokspace/brok.yml. Every key is optional and the defaults are sensible. The settings people change most:

llm:
  default: ollama # which provider `brok ask` uses
  providers:
    ollama:
      base_url: http://localhost:11434/v1
      model: qwen2.5-coder:7b
    anthropic: # hosted models: the key comes from an env var
      base_url: https://api.anthropic.com/v1
      model: claude-sonnet-5-5
      api_key_env: ANTHROPIC_API_KEY

embeddings:
  enabled: true # false = text search only, less memory

index:
  exclude: # .gitignore is always respected too
    - "**/node_modules/**"
    - "**/*.min.js"
    - "docs/archive/**"

shards:
  brok-agent:
    settings:
      review: # optional AI review of matching files on change
        enabled: false
        include: ["src/api/**"]

Easier ways to change things:

ChangeCommand
Switch the local LLM or modelbrok setup llm (or brok setup llm --provider ollama --model llama3:8b)
Connect more coding agentsbrok setup agents
Share the index (Git LFS, S3, R2, MinIO)brok setup sync

After editing brok.yml, run brok restart. Every key is explained in Configuration reference.

API keys are never written to files: export them in your shell (export ANTHROPIC_API_KEY=..., or $env:ANTHROPIC_API_KEY = "..." in PowerShell) and Brokspace reads them when needed. Secrets found in your code are removed from the context before anything is sent to an LLM.


7. Skills

A skill is a small, reusable workflow for AI: a SKILL.md file with instructions. Brokspace ships 20 of them.

brok skill list                                    # what is available
brok skill show tdd                                # read one
brok skill run code-review "the session handling"  # run one on your local LLM

User-invoked skills are started by you (type /name in your agent, e.g. /grill-me before a big change). Model-invoked skills are picked by the agent when the task fits (e.g. tdd, code-review).

Write your own:

brok skill new release-notes          # creates .brokspace/skills/release-notes/SKILL.md
brok skill export                     # refresh your coding agents with it

A workspace skill with the same name as a built-in one replaces it, so you can tailor any built-in to your team. More in Skills.


8. Shards

Shards are small programs that react to what happens in your workspace (a file changed, a question was asked) and can publish their own events. The agent you installed is one.

brok shard list                                             # what is installed
brok shard install https://github.com/someone/some-shard    # shows its permissions before installing
brok shard new my-shard                                     # start your own (Rust project)
brok shard new my-skills --skills-only                      # or just share skills, no code
brok restart                                                # start new shards
brok bus tail                                               # watch events live while developing

Every shard lists the permissions it wants in shard.json, and you approve them when installing. Guide: Shards.


9. Troubleshooting

Start with brok doctor: it checks everything and prints the fix.

SymptomFix
no answer from the agentStart your LLM (open Ollama / LM Studio), then brok doctor
ollama ... is not installedollama pull <model> as shown by brok doctor
Answers take minutesThe model runs on your CPU. Normal for 7b on a laptop without a GPU (a review can take 3 to 5 minutes); for faster answers use 3b: ollama pull qwen2.5-coder:3b, then brok setup llm --provider ollama --model qwen2.5-coder:3b
Search misses recent codebrok status; if the daemon is stopped, brok start catches up
another brok process is writing the indexbrok is running in the background and already indexes for you; skip brok index, or brok stop first
Results come back as text onlyThe search model is missing: brok model download
Agent does not show the brok toolsbrok must be on PATH; run brok setup agents and restart the agent
Odd behavior after an upgradebrok restart; if it persists, brok index --rebuild
Windows: errors about long pathsEnable long paths (brok doctor shows the command) or use a shorter folder

Still stuck? Run brok logs -n 100 and ask in Discussions, including the output of brok doctor.


10. Update brok

brok upgrade --check    # is there a new version, and what changed?
brok upgrade            # shows what changed, asks, then upgrades

brok upgrade downloads the new brok and brok-agent, checks them against the release checksums, swaps them in and restarts brok in every workspace where it was running (each workspace's agent is refreshed on that restart). brok doctor tells you when a new version is out.

Then run brok skill export in your workspaces so your coding agents get the updated built-in skills.

Installed with Cargo? Upgrade with cargo install brok-cli brok-agent. Coming from brok 0.2.1 or older (no upgrade command yet)? Run the install command from step 1 again, once.


11. Uninstall

brok stop                    # in each workspace where it runs

Then delete:

  • the .brokspace/ folder of each workspace (plus .agents/skills, .claude/skills and the MCP files if you no longer want them);
  • the shared model cache: ~/.cache/brokspace (Linux), ~/Library/Caches/brokspace (macOS), %LOCALAPPDATA%\brokspace (Windows);
  • your defaults: ~/.config/brokspace (Linux), ~/Library/Application Support/brokspace (macOS), %APPDATA%\brokspace (Windows);
  • the brok and brok-agent programs (~/.local/bin, or %LOCALAPPDATA%\Programs\brok on Windows; cargo uninstall brok-cli brok-agent if you used Cargo).

Nesta página