README-DEV.md
This guide provides detailed instructions for setting up your BAML development environment.
# Clone the repository
git clone https://github.com/BoundaryML/baml.git
cd baml
mise trust
pnpm setup-dev
pnpm clean:ws
pnpm install
pnpm typecheck
pnpm build
# Start developing!
pnpm dev
We use mise (formerly rtx) as our polyglot tool version manager. This ensures all developers use the exact same versions of tools, preventing "works on my machine" issues.
mise is a tool version manager that can handle multiple programming languages and tools in one place. It replaces the need for nvm, rbenv, pyenv, rustup, and other version managers.
Our tool versions are defined in mise.toml:
[tools]
rust = "1.88.0"
go = "1.23"
python = "3.12"
ruby = "3.2.2"
node = "lts"
# ... and more
# List all installed tools
mise list
# Install/update all tools to match mise.toml
mise install
# Show current tool versions
mise current
# Upgrade tools to latest versions (respecting version constraints)
mise upgrade
# Trust the configuration file (required after changes)
mise trust
If you prefer to install tools manually or need to understand what the setup script does:
Rust (1.88.0)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup install 1.88.0
rustup default 1.88.0
Go (1.23)
go install google.golang.org/protobuf/cmd/[email protected]Python (3.12)
curl -LsSf https://astral.sh/uv/install.sh | shRuby (3.2.2)
gem install bundlerNode.js (LTS)
macOS:
brew install libyaml openssl@3
Linux: Dependencies vary by distribution. The setup script will guide you.
# Start all services with hot reloading
pnpm dev
# Run only specific components
pnpm dev:vscode # VSCode extension
pnpm dev:playground # Web playground
pnpm dev:language-server # Language server
After the TypeScript refactor, use these commands:
# Build everything
pnpm build
# Build specific apps
pnpm build:fiddle-web-app # Web playground app
pnpm build:vscode # VSCode extension
pnpm build:playground # Playground package
pnpm build:cli # CLI tool
# Release commands
pnpm release:fiddle-web-app # Release web app
pnpm release:vscode # Release VSCode extension
pnpm release:cli # Release CLI
The TypeScript codebase follows a monorepo structure:
typescript/
├── apps/ # All applications
│ ├── fiddle-web-app/ # Web playground
│ └── vscode-ext/ # VSCode extension
├── packages/ # All reusable packages
│ ├── ui/ # Shared UI components
│ ├── common/ # Common utilities
│ ├── playground-common/ # Playground shared code
│ ├── language-server/ # Language server
│ └── ... # Other packages
└── workspace-tools/ # Build and config tools
# Run all tests
./run-tests.sh
# Run specific language tests
cd integ-tests/typescript && pnpm test
cd integ-tests/python && uv run pytest
cd integ-tests/ruby && rake test
# Build everything
pnpm build
# Build specific components
cargo build --release # Rust components
pnpm build # TypeScript components
"mise: command not found"
~/.local/bin. Make sure this is in your PATH.source ~/.bashrc or source ~/.zshrc"mise trust required"
mise trust in the project rootTool version conflicts
mise doctor to diagnose issuesmise install --force to reinstall toolsRust compilation errors
rustc --versioncargo cleanGo module errors
go clean -modcachePython/uv issues
uv cache cleanuv sync --reinstallRuby/bundler issues
bundle clean --forcebundle install --forceVSCode:
IntelliJ/RustRover:
~/.local/share/mise/installs/go/1.23/~/.local/share/mise/installs/rust/1.88.0/~/.local/share/mise/installs/python/3.12/~/.local/share/mise/installs/ruby/3.2.2/Other IDEs:
~/.local/share/mise/installs/When other developers update tool versions:
mise installThe setup script can be run anytime to ensure your environment is up to date.