Contributing
Fleet is a TypeScript CLI with a Go bot component. Here’s how to set up the development environment.
Prerequisites
- Node.js 20 or 22 (LTS)
- npm (comes with Node)
- Go 1.21+ (only needed for the bot)
- Docker and Docker Compose (for integration testing)
Setup
git clone https://github.com/wrxck/fleet.gitcd fleetnpm installnpm run buildProject structure
The TypeScript CLI lives in src/:
src/cli.ts— argument parser and command routingsrc/commands/— one file per CLI commandsrc/core/— business logic (docker, systemd, nginx, secrets, health, deps)src/mcp/— MCP server for Claude Code integrationsrc/tui/— Ink/React terminal dashboardsrc/templates/— systemd, nginx, and unseal service templatessrc/ui/— terminal output helpers
The Go bot lives in bot/:
bot/main.go— entry pointbot/adapter/— messaging adapters (Telegram, BlueBubbles)bot/handler/— command routing and executionbot/config/— configuration loading
Development commands
# Build TypeScriptnpm run build
# Run testsnpm test
# Run a specific test filenpx vitest run src/core/health.test.ts
# Run in dev mode (tsx, no build step)npm run dev -- statusCode style
- TypeScript strict mode (
"strict": truein tsconfig) - ES modules (
"type": "module") - Conventional commits:
feat(scope):,fix(scope):,test:,docs:,chore: - No default exports — use named exports everywhere
Testing
Tests use Vitest. See the Testing guide for patterns and conventions.
Key rules:
- Mock
node:child_processandnode:fsfor unit tests — don’t shell out or touch the filesystem - Test both success and error paths
- Include security scenarios (injection, traversal, malformed input)
- Integration tests that need Docker/systemd skip in CI via
process.env.CI
Branch model
- main — production, updated via PR from develop
- develop — integration branch, features PR’d here
- feat/*, fix/*, chore/* — working branches
All PRs target develop. Never push directly to main or develop.
CI
GitHub Actions runs on every push and PR:
- Type-check (
tsc --noEmit) - Test (
vitest run) - Build (
tsc)
Matrix: Node 20 and 22. Failed CI runs are auto-cleaned by a scheduled job.