# Capture and check development environments

On Arch, Debian, or Ubuntu, record explicit package names and selected runtimes in omg.lock, then check for drift without installing software.

Canonical: https://getomg.xyz/guides/reproducible-dev-environments/
Updated: 2026-09-22
Author: OMG maintainers

## Recording installed packages and language runtimes

Most developer environments drift because developers use different tools for each layer: OS packages are installed ad-hoc (`apt-get`, `pacman`, `brew`), language runtimes are managed by separate version tools, and project libraries are pinned in application lockfiles.

OMG’s environment subsystem (`src/cli/env.rs` and `src/core/env/fingerprint.rs`) records explicitly installed system package names and selected OMG runtime versions in `omg.lock`. The published CLI captures seven runtimes (Node.js, Python, Rust, Go, Ruby, Java, and Bun). It does not record system package versions or application dependencies.

## Capturing state and verifying drift

`omg env capture` supports the Arch ALPM and Debian/Ubuntu APT backends. It records explicit package names and selected runtime versions, then writes a full SHA-256 hash of that inventory to `omg.lock`. The CLI displays the first 16 characters as a short identifier.

Run `omg env check` to compare `omg.lock` with the live system without installing packages. It reports missing or extra package names and runtime version differences. System package version changes under the same name are outside this check.

### Capture environment state and detect drift

```sh
omg env capture
omg env check
```

> Commit omg.lock to your repository alongside your version files (.node-version, .python-version) and package manager lockfiles (package-lock.json, Cargo.lock).

## Sharing the captured inventory

You can share `omg.lock` through GitHub Gist with `omg env share`. The Gist is secret by default; add `--public` only when you want public visibility.

`omg env sync <url>` downloads the lockfile into the current directory and runs a drift check. It does not install packages or runtimes. Review differences and install the needed software with the appropriate commands.

### Share and check an environment inventory

```sh
omg env share
omg env sync <gist-url>
```

## A verified team onboarding workflow

1. The repository maintainer configures runtime pins and captures the working environment.

   ```sh
   omg env capture && git add omg.lock .node-version && git commit -m "chore: pin environment"
   ```

2. A new contributor clones the repository and runs an initial environment check.

   ```sh
   git clone <repo> && cd <repo> && omg env check
   ```

3. If drift or missing runtimes are reported, inspect the differences and install the required versions.

   ```sh
   omg use node lts && npm ci
   ```

4. Run the project tasks using OMG’s polyglot task runner.

   ```sh
   omg run test
   ```

## Sources and verification

Source-reviewed guidance; not a claim of execution on every supported platform.

- [OMG environment CLI implementation (src/cli/env.rs)](https://getomg.xyz/docs/cli/)

- [OMG environment fingerprinting (src/core/env/fingerprint.rs)](https://getomg.xyz/docs/architecture/)

- [OMG daily workflows guide](https://getomg.xyz/docs/workflows/)

## Related pages

- https://getomg.xyz/compare/omg-vs-mise/

- https://getomg.xyz/guides/task-runner/

- https://getomg.xyz/docs/configuration/

