Sails Dev Env
Goal
Get the machine to a verified baseline for standard Sails Rust work: rustup, Rust toolchains, Wasm targets, cargo-sails, and the latest official gear binary.
Sequence
- Detect whether the builder is on
macOS, Linux, or Windows.
- If
rustup is missing, install it with the official bootstrap for that platform.
- Install or update the
stable and nightly toolchains, then add wasm32-unknown-unknown and wasm32v1-none.
- Install the Sails Rust CLI with
cargo install sails-cli --locked, which provides cargo-sails and the standard greenfield bootstrap command cargo sails new <project-name>.
- Install the latest official
gear release binary from https://get.gear.rs/ (see Commands below for platform-specific download).
- Verify the toolchain with
rustup show, cargo sails --version, and gear --version.
- Route back into
../sails-new-app/SKILL.md, ../ship-sails-app/SKILL.md, ../sails-gtest/SKILL.md, or ../sails-local-smoke/SKILL.md depending on the builder's next task.
Commands
macOS or Linux
command -v rustup >/dev/null 2>&1 || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# After fresh install, restart the shell or source the env so cargo/rustc resolve:
. "${HOME}/.cargo/env"
rustup toolchain install stable
rustup toolchain install nightly
rustup default stable
rustup target add wasm32-unknown-unknown --toolchain stable
rustup target add wasm32-unknown-unknown --toolchain nightly
rustup target add wasm32v1-none --toolchain stable
rustup target add wasm32v1-none --toolchain nightly
cargo install sails-cli --locked
# Install gear binary from official releases (auto-detect architecture)
GEAR_VERSION="v1.10.0"
case "$(uname -s)-$(uname -m)" in
Darwin-arm64) GEAR_ARCH="aarch64-apple-darwin" ;;
Darwin-x86_64) GEAR_ARCH="x86_64-apple-darwin" ;;
Linux-x86_64) GEAR_ARCH="x86_64-unknown-linux-gnu" ;;
Linux-aarch64) GEAR_ARCH="aarch64-unknown-linux-gnu" ;;
*) echo "Unsupported platform: $(uname -s)-$(uname -m)"; exit 1 ;;
esac
mkdir -p "${HOME}/.local/bin"
curl -sSf "https://get.gear.rs/gear-${GEAR_VERSION}-${GEAR_ARCH}.tar.xz" | tar -xJ -C "${HOME}/.local/bin"
export PATH="${HOME}/.local/bin:${PATH}"
rustup show
cargo sails --version
cargo sails --help
gear --version
Windows
if (-not (Get-Command rustup -ErrorAction SilentlyContinue)) {
winget install Rustlang.Rustup
}
rustup toolchain install stable
rustup toolchain install nightly
rustup default stable
rustup target add wasm32-unknown-unknown --toolchain stable
rustup target add wasm32-unknown-unknown --toolchain nightly
rustup target add wasm32v1-none --toolchain stable
rustup target add wasm32v1-none --toolchain nightly
cargo install sails-cli --locked
# Install gear binary from official releases
$GearVersion = "v1.10.0"
$GearDest = "$env:USERPROFILE\AppData\Local\Programs\gear\bin"
New-Item -ItemType Directory -Force -Path $GearDest | Out-Null
Invoke-WebRequest -Uri "https://get.gear.rs/gear-$GearVersion-x86_64-pc-windows-msvc.zip" -OutFile "$env:TEMP\gear.zip"
Expand-Archive -Path "$env:TEMP\gear.zip" -DestinationPath $GearDest -Force
$env:PATH = "$GearDest;$env:PATH"
rustup show
cargo sails --version
cargo sails --help
gear --version
Guardrails
- Keep this skill self-contained. Do not depend on a sibling
gear checkout or machine-local scripts outside this skill directory. The gear binary is downloaded directly from https://get.gear.rs/ official releases. The scripts/install-gear.sh and scripts/install-gear.ps1 helpers in this skill directory are available as an alternative when a more flexible install is needed (e.g., custom tags or targets).
- Prefer the latest official
gear release binary over building the node from source unless the user asks for a specific tag or source build.
- Treat base package-manager bootstrap as outside scope. If host tools such as
curl, tar, xz, or winget are missing, install them with the platform package manager, then continue.
- Do not assume
Node.js, npm, or sails-cli are part of this skill. Install JS tooling separately only when the active workflow actually needs it.
- Do not pin an arbitrary nightly date unless the target repository already requires one through a toolchain file or a failing build.
1---2name: sails-dev-env3description: Use when a builder needs to prepare or repair a local macOS, Linux, or Windows machine for standard Gear/Vara Sails Rust development before building, testing, or running a local node. Do not use for live-network deployment, app-specific feature work, or Vara.eth/ethexe-only setup.4---56# Sails Dev Env78## Goal910Get the machine to a verified baseline for standard Sails Rust work: `rustup`, Rust toolchains, Wasm targets, `cargo-sails`, and the latest official `gear` binary.1112## Sequence13141. Detect whether the builder is on `macOS`, `Linux`, or `Windows`.152. If `rustup` is missing, install it with the official bootstrap for that platform.163. Install or update the `stable` and `nightly` toolchains, then add `wasm32-unknown-unknown` and `wasm32v1-none`.174. Install the Sails Rust CLI with `cargo install sails-cli --locked`, which provides `cargo-sails` and the standard greenfield bootstrap command `cargo sails new <project-name>`.185. Install the latest official `gear` release binary from `https://get.gear.rs/` (see Commands below for platform-specific download).196. Verify the toolchain with `rustup show`, `cargo sails --version`, and `gear --version`.207. Route back into `../sails-new-app/SKILL.md`, `../ship-sails-app/SKILL.md`, `../sails-gtest/SKILL.md`, or `../sails-local-smoke/SKILL.md` depending on the builder's next task.2122## Commands2324### macOS or Linux2526```bash27command -v rustup >/dev/null 2>&1 || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y28# After fresh install, restart the shell or source the env so cargo/rustc resolve:29. "${HOME}/.cargo/env"3031rustup toolchain install stable32rustup toolchain install nightly33rustup default stable34rustup target add wasm32-unknown-unknown --toolchain stable35rustup target add wasm32-unknown-unknown --toolchain nightly36rustup target add wasm32v1-none --toolchain stable37rustup target add wasm32v1-none --toolchain nightly3839cargo install sails-cli --locked4041# Install gear binary from official releases (auto-detect architecture)42GEAR_VERSION="v1.10.0"43case "$(uname -s)-$(uname -m)" in44 Darwin-arm64) GEAR_ARCH="aarch64-apple-darwin" ;;45 Darwin-x86_64) GEAR_ARCH="x86_64-apple-darwin" ;;46 Linux-x86_64) GEAR_ARCH="x86_64-unknown-linux-gnu" ;;47 Linux-aarch64) GEAR_ARCH="aarch64-unknown-linux-gnu" ;;48 *) echo "Unsupported platform: $(uname -s)-$(uname -m)"; exit 1 ;;49esac50mkdir -p "${HOME}/.local/bin"51curl -sSf "https://get.gear.rs/gear-${GEAR_VERSION}-${GEAR_ARCH}.tar.xz" | tar -xJ -C "${HOME}/.local/bin"52export PATH="${HOME}/.local/bin:${PATH}"5354rustup show55cargo sails --version56cargo sails --help57gear --version58```5960### Windows6162```powershell63if (-not (Get-Command rustup -ErrorAction SilentlyContinue)) {64 winget install Rustlang.Rustup65}6667rustup toolchain install stable68rustup toolchain install nightly69rustup default stable70rustup target add wasm32-unknown-unknown --toolchain stable71rustup target add wasm32-unknown-unknown --toolchain nightly72rustup target add wasm32v1-none --toolchain stable73rustup target add wasm32v1-none --toolchain nightly7475cargo install sails-cli --locked7677# Install gear binary from official releases78$GearVersion = "v1.10.0"79$GearDest = "$env:USERPROFILE\AppData\Local\Programs\gear\bin"80New-Item -ItemType Directory -Force -Path $GearDest | Out-Null81Invoke-WebRequest -Uri "https://get.gear.rs/gear-$GearVersion-x86_64-pc-windows-msvc.zip" -OutFile "$env:TEMP\gear.zip"82Expand-Archive -Path "$env:TEMP\gear.zip" -DestinationPath $GearDest -Force83$env:PATH = "$GearDest;$env:PATH"8485rustup show86cargo sails --version87cargo sails --help88gear --version89```9091## Guardrails9293- Keep this skill self-contained. Do not depend on a sibling `gear` checkout or machine-local scripts outside this skill directory. The `gear` binary is downloaded directly from `https://get.gear.rs/` official releases. The `scripts/install-gear.sh` and `scripts/install-gear.ps1` helpers in this skill directory are available as an alternative when a more flexible install is needed (e.g., custom tags or targets).94- Prefer the latest official `gear` release binary over building the node from source unless the user asks for a specific tag or source build.95- Treat base package-manager bootstrap as outside scope. If host tools such as `curl`, `tar`, `xz`, or `winget` are missing, install them with the platform package manager, then continue.96- Do not assume `Node.js`, `npm`, or `sails-cli` are part of this skill. Install JS tooling separately only when the active workflow actually needs it.97- Do not pin an arbitrary nightly date unless the target repository already requires one through a toolchain file or a failing build.