Development Toolchain Management
Firmware Vault uses mise to standardize and manage developer tooling across all platforms. A single committed configuration file (mise.toml) pins the exact versions of the runtime tools and linters needed for local development, keeping local environments aligned with the CI/CD pipeline and container images.
Why mise?
Local development in Firmware Vault spans multiple ecosystems: Python for backend microservices and analysis tools, Node.js and Angular for the web frontend, and Docusaurus for documentation.
Previously, setting up a development workstation required manually installing separate versions of Python, Node, npm, yarn, and pre-commit, as well as manually creating and activating virtual environments. This often led to version drift between local workstations and CI test environments.
With mise:
- Deterministic tool versions: Tool versions are pinned in
mise.tomlto match CI runner images and production Dockerfiles. - Separation of concerns:
mise.tomlmanages tools and system runtimes (Python, Node, uv, etc.), while application dependencies remain in their native manifests (requirements.txt,package-lock.json,yarn.lock). - Zero-friction Python virtual environment: Mise automatically provisions and activates a
.venvusing uv when entering the repository directory, including settingPYTHONPATH. - Cross-platform task runner: Common workflows (installing dependencies, running linters, starting compose stacks, applying database migrations) are standardized as
mise run <task>commands.
Installation
Install mise following the instructions for your operating system:
Linux
Install via the standalone installer:
curl https://mise.run | sh
Or install via your distribution's package manager (e.g. apt, pacman). Refer to the official mise installation guide for package repository setup.
macOS
Install via Homebrew:
brew install mise
If Anaconda or Miniconda is initialized in ~/.zshrc (conda init), its automatic base environment activation can override the mise .venv Python on PATH if conda runs after mise. To ensure mise takes precedence inside the repository, either place eval "$(mise activate zsh)" at the very end of ~/.zshrc (after the # >>> conda initialize >>> block) or disable automatic base activation:
conda config --set auto_activate_base false
Windows
On Windows, WSL2 (Windows Subsystem for Linux) is strongly recommended. Developing inside WSL2 provides identical performance and shell behavior to Linux, and Docker Desktop integrates directly with WSL2. See the WSL Setup Guide for step-by-step instructions.
If you prefer native Windows development, install via winget:
winget install jdx.mise
Shell Activation
To allow mise to automatically activate tools and environments when you navigate into the project directory, add the activation hook to your shell configuration file:
Bash (~/.bashrc):
eval "$(mise activate bash)"
Zsh (~/.zshrc):
eval "$(mise activate zsh)"
Fish (~/.config/fish/config.fish):
mise activate fish | source
PowerShell ($PROFILE on Windows):
mise activate pwsh | Out-String | Invoke-Expression
After modifying your shell configuration, restart your terminal or reload the profile. Alternatively, if you do not want to use shell hooks, you can use mise activate --shims or run commands prefixed with mise exec -- <command>.
First Run
Once mise is installed and activated, navigate to the firmware_vault repository and execute:
# 1. Trust the repository configuration
mise trust
# 2. Download and install all pinned tools
mise install
# 3. Install all dependencies (Python, frontend, docs) and git hooks
mise run setup
The mise run setup task installs the Python requirements into .venv, installs the frontend and documentation npm/yarn packages, and installs the pre-commit git hooks.
Pinned Tool Versions
The tools defined in firmware_vault/mise.toml are pinned to exact versions matching the CI/CD pipeline and container base images:
| Tool | Version | Backend / Source | CI / Docker Equivalent | Purpose |
|---|---|---|---|---|
| Python | 3.11.18 | Core (python) | python:3.11-slim / lint-python | Backend services, API, and analysis tools |
| Node.js | 24.22.2 | Core (node) | node:24 (lint-frontend, docs CI) | Angular frontend & Docusaurus documentation |
| npm | 11.x | Bundled with Node 24 | Bundled with Node 24 | Frontend package management |
| uv | 0.13.7 | Aqua (uv) | Used locally | Ultra-fast Python package installation and .venv creation |
| yarn | 1.22.22 | npm:yarn | node:24-alpine | Documentation package management (docs/yarn.lock) |
| pre-commit | 4.7.0 | pipx:pre-commit | CI linter jobs | Git hook orchestration (Ruff, Codespell, Hadolint) |
Python Environment (.venv)
The repository configuration automatically manages a local virtual environment:
[env]
_.python.venv = { path = ".venv", create = true }
PYTHONPATH = "{{config_root}}/src"
Automatic Activation
When you cd into firmware_vault, mise ensures .venv exists (creating it with uv if needed) and activates it in your current shell. Leaving the directory restores your shell's previous environment.
PYTHONPATH is automatically set to include the src/ directory, allowing local tools and Python scripts to import firmware_orm and core modules seamlessly.
Package Installation
To install the consolidated Python dependencies, run:
mise run install:python
This task runs tests/integration/process_requirements.py to generate the deduplicated all_requirements.txt file and installs all requirements into .venv using uv pip install. This ensures your local development environment exactly matches the CI integration test container environment.
To add or test ad-hoc packages during development, you can use uv pip:
uv pip install <package-name>
Why Conda and Manual venvs are Deprecated
Previous documentation suggested using Conda or manual python -m venv. These approaches are no longer recommended for the following reasons:
- No manual activation overhead:
misemanages.venvlifecycle automatically. - CI Parity: Conda uses separate binary package repositories that can drift from Debian/Alpine Linux wheels used in Docker containers and CI pipelines.
- Licensing: Default Conda channels carry commercial restrictions in enterprise and academic settings;
miseanduvrely entirely on standard PyPI wheels.
Task Reference
Mise provides a built-in cross-platform task runner. Run mise tasks to list all available tasks:
| Task | Description | Command Executed |
|---|---|---|
mise run setup | Install all dependencies and git hooks | Depends on install:python, install:frontend, install:docs, hooks |
mise run install:python | Install merged Python requirements | Resolves all_requirements.txt and runs uv pip install |
mise run install:frontend | Install Angular frontend dependencies | Runs npm ci in frontend/ |
mise run install:docs | Install Docusaurus docs dependencies | Runs yarn install --frozen-lockfile in docs/ |
mise run hooks | Install pre-commit Git hooks | Runs pre-commit install |
mise run lint | Run all pre-commit hooks on all files | Runs pre-commit run --all-files (Ruff, Codespell, Hadolint) |
mise run lint:frontend | Run ESLint on the Angular frontend | Runs npm run lint in frontend/ |
mise run configure | Generate config.json and .env | Runs python configure --headless --developer_mode=y |
mise run compose:up | Build and start Docker Compose stack | Runs docker compose up -d --build in docker_compose_dir/ |
mise run compose:watch | Start stack with file watching | Runs docker compose -f docker-compose.yaml -f compose.dev.yaml up --watch |
mise run compose:down | Stop Docker Compose stack | Runs docker compose down in docker_compose_dir/ |
mise run compose:rebuild | Rebuild and restart stack | Runs compose:down followed by compose:up |
mise run db:up | Start MySQL and run migrations container | Runs docker compose up -d mysql_db db_migrations |
mise run db -- <args> | Run Alembic with .env variables | Runs alembic <args> with environment from docker_compose_dir/.env |
mise run db:migrate | Apply database migrations | Runs alembic upgrade head |
mise run db:revision "<msg>" | Generate autogenerated migration | Runs alembic revision --autogenerate -m "<msg>" |
mise run frontend:start | Start Angular development server | Runs npm start in frontend/ |
mise run frontend:build | Build Angular frontend for production | Runs npm run build in frontend/ |
mise run docs:start | Serve documentation locally | Runs yarn start in docs/ (port 3000) |
mise run docs:build | Build documentation bundle | Runs yarn build in docs/ |
Upgrading Tools
To check for newer versions of installed tools:
mise outdated
To upgrade pinned versions in mise.toml:
mise upgrade --bump
When upgrading tool versions in mise.toml (for example, upgrading Python or Node.js), make sure to update the corresponding Dockerfiles, CI image tags in .gitlab-ci.yml, and documentation to keep them consistent.
Personal Overrides (mise.local.toml)
Developers can customize their local configuration using a local overrides file named mise.local.toml (or .mise.local.toml). This file is ignored by Git and will never be committed:
# mise.local.toml - local developer overrides (gitignored)
[env]
# Override database host for native local database instances
DATABASE_HOST = "127.0.0.1"
# Personal development tools
[tools]
ripgrep = "latest"
Never commit API tokens, passwords, or credentials into mise.toml. Store personal access tokens in your local environment, gitignored mise.local.toml, or your operating system's credential store.
Manual Setup (Without mise)
If you cannot use mise, you can set up your development environment manually by ensuring the following software versions are installed on your system:
- Python:
3.11.x - Node.js:
24.x(LTS) and npm:11.x - yarn:
1.22.x - pre-commit:
4.7.x
Manual setup steps:
# 1. Create and activate Python virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# 2. Set PYTHONPATH to include src
export PYTHONPATH="$(pwd)/src" # On Windows: set PYTHONPATH=%CD%\src
# 3. Install Python requirements
pip install packaging
python tests/integration/process_requirements.py
pip install -r all_requirements.txt
# 4. Install frontend dependencies
cd frontend && npm ci && cd ..
# 5. Install docs dependencies
cd docs && yarn install --frozen-lockfile && cd ..
# 6. Install git hooks
pre-commit install