ServerBox onboarding
ServerBox is a Flutter app (iOS, Android, macOS, Linux, Windows, watchOS) for
managing Linux, BSD and Windows servers: status charts, SSH terminal, SFTP,
containers, processes, systemd. The repository is a monorepo:
| Path |
What it is |
lib/ |
The Flutter app |
crates/sbm_parser |
Shared status parser — one source of truth for the command manifest and the parsing, used by the app over FFI and by the monitor |
crates/sbm_ffi |
flutter_rust_bridge binding crate, built into the app by hook/build.dart |
crates/sbm_native |
Native per-platform sampler, monitor only |
monitor/ |
ServerBox Monitor: a Rust agent installed on a server, plus its Svelte panel |
packages/ |
Vendored Dart forks, each a submodule, referenced by path from pubspec.yaml |
docs/ |
The documentation site (Astro Starlight), English with a zh/ mirror |
A server can use SSH, a monitor agent's HTTP API, or both. Each configured
transport contributes its own capabilities; see references/principles.md.
Work out which question this is first
People arrive at this project from two directions, and the answers barely
overlap. Read the one reference that matches, not all of them.
| The person wants to |
Read |
| Install the app and connect it to a server |
references/app-usage.md |
| Install, configure or secure the monitor agent on a server |
references/monitor-deploy.md |
| Build and run the project from source, or contribute |
references/dev-setup.md |
| Understand how something works, or why it was built that way |
references/principles.md |
Mixed asks are common and the wording rarely says which is which. "The
terminal button disappeared" is the agent's capability model
(monitor-deploy.md), not a bug. "flutter pub get fails right after
cloning" is almost always uninitialised submodules (dev-setup.md). When it is
genuinely ambiguous, ask whether they are running ServerBox or working on it.
The repository outranks this skill
Versions, ports and command names drift; a skill file that quietly disagrees
with the repo is worse than no skill. Inside a checkout, prefer these:
| Question |
Authoritative file |
| What commands exist |
make help (the Makefile) |
| Flutter / Dart minimum |
environment: in pubspec.yaml |
| Rust channel and shipped targets |
crates/sbm_ffi/rust-toolchain.toml |
| Node version |
monitor/frontend/.node-version |
| Every agent config key |
monitor/config.example.toml |
| Contribution rules and checks |
CONTRIBUTING.md |
| Working rules for agents |
CLAUDE.md, monitor/CLAUDE.md |
| User-facing documentation |
docs/src/content/docs/** |
Outside a checkout the reference files here are the fallback. Say so when you
are answering from them — the numbers below were true when this was written and
nothing keeps them current.
scripts/check-env.sh reports what is installed against what the repo asks
for, and changes nothing. Run it before diagnosing a build failure by hand;
most first-run failures are one of the four things it checks.
The commands that cover most of it
make deps # flutter pub get
make run # flutter run
make gen # build_runner + gen-l10n — after touching any annotated model
make analyze # flutter analyze lib test integration_test
make test # flutter test
cargo test --workspace # parser, native sampler, FFI, monitor
make monitor-dev # agent API on :3770 + panel dev server on :3000
make build PLATFORM=<android|ios|macos|linux|windows>
Values as of writing: Flutter >= 3.44.9, Dart SDK >= 3.11.0, Rust pinned to
1.97.1 for the FFI crate, Node 24 for the monitor panel and the docs site.
What costs people an afternoon
Each of these has bitten someone. The reason matters more than the fix, because
the symptom rarely names the cause.
- Initialise submodules before fetching Dart dependencies.
packages/* are
path dependencies, so flutter pub get fails on a missing directory rather
than on anything that mentions submodules:
git submodule update --init --recursive.
- Rust is not optional, even for
flutter run. hook/build.dart compiles
crates/sbm_ffi into every app build as a code asset. No Rust toolchain, no
app.
flutter_rust_bridge is pinned to the same prerelease in two files —
pubspec.yaml and crates/sbm_ffi/Cargo.toml. When they disagree,
RustLib.init throws at startup and the message does not mention versions.
- Regenerate after changing an annotated model (
freezed,
json_serializable, riverpod, hive): make gen. Never hand-edit
*.g.dart, *.freezed.dart or anything under lib/src/rust/.
- Never run a formatter. The formatting in this codebase is deliberate, and
a reformat buries the actual change in noise.
- Do not start a second
flutter run when the user already has the app
running from their IDE. Two debug builds compete for the same window and you
end up inspecting an instance nobody is looking at. Hot reload through the
dart MCP server instead (CLAUDE.md has the sequence).
flutter clean deletes the out-of-tree iSH engine build and leaves a
checkout that looks fine, so the next iOS build dies in the linker on three
missing .a files. Only affects a checkout that turned SBM_ISH on.
Answering "how does X work"
The deep explanations already exist in docs/src/content/docs/principles/
(architecture, ssh, sftp, terminal, state) — 250 to 400 lines each, and worth
reading rather than paraphrasing from memory. references/principles.md is the
map: what each one answers, plus the handful of design decisions that explain
the most behaviour, so you can route in one step instead of grepping.
When the answer is about code rather than design, read the code. The docs
describe intent; lib/data/provider/, lib/data/store/ and
monitor/src/api/ are what actually runs.
Reference files
| File |
Covers |
references/dev-setup.md |
Toolchain bootstrap, the run/test/build loop, monitor development, and a symptom-to-cause table for first-run failures |
references/monitor-deploy.md |
Installing the agent, config.toml, the security switches and what each one really grants, connecting the app, troubleshooting |
references/app-usage.md |
Where to download the app per platform, adding a server over SSH or through an agent, what each feature needs, where the advanced guides are |
references/principles.md |
How the app is put together and which document answers which question |
scripts/check-env.sh |
Read-only environment check: toolchain versions, submodules, dependency state, FFI version parity |
1---2name: serverbox-onboarding3description: Orientation for ServerBox (flutter_server_box) — installing and using the app, deploying and configuring the ServerBox Monitor agent on a server, bootstrapping the Flutter + Rust + Node development environment, and explaining how the project actually works (SSH vs monitor HTTP, the shared Rust parser, SQLite storage, Riverpod state). Use this whenever someone asks how to install, set up, run, build, deploy, configure, contribute to, or understand any part of ServerBox or its monitor agent — including questions that never name the project outright, such as "how do I get this repo running", "pub get fails after cloning", "why is the terminal button missing on this server", "what does full_access actually grant", "where does the status data come from", or a first-time contributor asking where to start.4---56# ServerBox onboarding78ServerBox is a Flutter app (iOS, Android, macOS, Linux, Windows, watchOS) for9managing Linux, BSD and Windows servers: status charts, SSH terminal, SFTP,10containers, processes, systemd. The repository is a monorepo:1112| Path | What it is |13|---|---|14| `lib/` | The Flutter app |15| `crates/sbm_parser` | Shared status parser — one source of truth for the command manifest and the parsing, used by the app over FFI and by the monitor |16| `crates/sbm_ffi` | flutter_rust_bridge binding crate, built into the app by `hook/build.dart` |17| `crates/sbm_native` | Native per-platform sampler, monitor only |18| `monitor/` | ServerBox Monitor: a Rust agent installed on a server, plus its Svelte panel |19| `packages/` | Vendored Dart forks, each a submodule, referenced by path from `pubspec.yaml` |20| `docs/` | The documentation site (Astro Starlight), English with a `zh/` mirror |2122A server can use **SSH, a monitor agent's HTTP API, or both**. Each configured23transport contributes its own capabilities; see `references/principles.md`.2425## Work out which question this is first2627People arrive at this project from two directions, and the answers barely28overlap. Read the one reference that matches, not all of them.2930| The person wants to | Read |31|---|---|32| Install the app and connect it to a server | `references/app-usage.md` |33| Install, configure or secure the monitor agent on a server | `references/monitor-deploy.md` |34| Build and run the project from source, or contribute | `references/dev-setup.md` |35| Understand how something works, or why it was built that way | `references/principles.md` |3637Mixed asks are common and the wording rarely says which is which. "The38terminal button disappeared" is the agent's capability model39(`monitor-deploy.md`), not a bug. "`flutter pub get` fails right after40cloning" is almost always uninitialised submodules (`dev-setup.md`). When it is41genuinely ambiguous, ask whether they are running ServerBox or working on it.4243## The repository outranks this skill4445Versions, ports and command names drift; a skill file that quietly disagrees46with the repo is worse than no skill. Inside a checkout, prefer these:4748| Question | Authoritative file |49|---|---|50| What commands exist | `make help` (the `Makefile`) |51| Flutter / Dart minimum | `environment:` in `pubspec.yaml` |52| Rust channel and shipped targets | `crates/sbm_ffi/rust-toolchain.toml` |53| Node version | `monitor/frontend/.node-version` |54| Every agent config key | `monitor/config.example.toml` |55| Contribution rules and checks | `CONTRIBUTING.md` |56| Working rules for agents | `CLAUDE.md`, `monitor/CLAUDE.md` |57| User-facing documentation | `docs/src/content/docs/**` |5859Outside a checkout the reference files here are the fallback. Say so when you60are answering from them — the numbers below were true when this was written and61nothing keeps them current.6263`scripts/check-env.sh` reports what is installed against what the repo asks64for, and changes nothing. Run it before diagnosing a build failure by hand;65most first-run failures are one of the four things it checks.6667## The commands that cover most of it6869```sh70make deps # flutter pub get71make run # flutter run72make gen # build_runner + gen-l10n — after touching any annotated model73make analyze # flutter analyze lib test integration_test74make test # flutter test75cargo test --workspace # parser, native sampler, FFI, monitor76make monitor-dev # agent API on :3770 + panel dev server on :300077make build PLATFORM=<android|ios|macos|linux|windows>78```7980Values as of writing: Flutter >= 3.44.9, Dart SDK >= 3.11.0, Rust pinned to811.97.1 for the FFI crate, Node 24 for the monitor panel and the docs site.8283## What costs people an afternoon8485Each of these has bitten someone. The reason matters more than the fix, because86the symptom rarely names the cause.8788- **Initialise submodules before fetching Dart dependencies.** `packages/*` are89 path dependencies, so `flutter pub get` fails on a missing directory rather90 than on anything that mentions submodules:91 `git submodule update --init --recursive`.92- **Rust is not optional, even for `flutter run`.** `hook/build.dart` compiles93 `crates/sbm_ffi` into every app build as a code asset. No Rust toolchain, no94 app.95- **`flutter_rust_bridge` is pinned to the same prerelease in two files** —96 `pubspec.yaml` and `crates/sbm_ffi/Cargo.toml`. When they disagree,97 `RustLib.init` throws at startup and the message does not mention versions.98- **Regenerate after changing an annotated model** (`freezed`,99 `json_serializable`, `riverpod`, hive): `make gen`. Never hand-edit100 `*.g.dart`, `*.freezed.dart` or anything under `lib/src/rust/`.101- **Never run a formatter.** The formatting in this codebase is deliberate, and102 a reformat buries the actual change in noise.103- **Do not start a second `flutter run`** when the user already has the app104 running from their IDE. Two debug builds compete for the same window and you105 end up inspecting an instance nobody is looking at. Hot reload through the106 dart MCP server instead (`CLAUDE.md` has the sequence).107- **`flutter clean` deletes the out-of-tree iSH engine build** and leaves a108 checkout that looks fine, so the next iOS build dies in the linker on three109 missing `.a` files. Only affects a checkout that turned `SBM_ISH` on.110111## Answering "how does X work"112113The deep explanations already exist in `docs/src/content/docs/principles/`114(architecture, ssh, sftp, terminal, state) — 250 to 400 lines each, and worth115reading rather than paraphrasing from memory. `references/principles.md` is the116map: what each one answers, plus the handful of design decisions that explain117the most behaviour, so you can route in one step instead of grepping.118119When the answer is about code rather than design, read the code. The docs120describe intent; `lib/data/provider/`, `lib/data/store/` and121`monitor/src/api/` are what actually runs.122123## Reference files124125| File | Covers |126|---|---|127| `references/dev-setup.md` | Toolchain bootstrap, the run/test/build loop, monitor development, and a symptom-to-cause table for first-run failures |128| `references/monitor-deploy.md` | Installing the agent, `config.toml`, the security switches and what each one really grants, connecting the app, troubleshooting |129| `references/app-usage.md` | Where to download the app per platform, adding a server over SSH or through an agent, what each feature needs, where the advanced guides are |130| `references/principles.md` | How the app is put together and which document answers which question |131| `scripts/check-env.sh` | Read-only environment check: toolchain versions, submodules, dependency state, FFI version parity |