⚠️ Warning: This tool is AI-generated. Bugs are common. Please file an issue if you find one.
A CLI tool for managing Odin projects, packages, and compiler versions.
- Version Management - Install, switch, and manage multiple Odin compiler versions
- Package Management - Add dependencies from GitHub or local paths
- Project Management - Initialize, build, run, and test Odin projects
- Fast - Built with Bun for maximum performance
- Bun installed on your system
- Git (for cloning packages)
git clone https://github.com/biswas08433/opm.git
cd opm
bun install
bun linkbun run build
# Creates ./opm executable
sudo mv opm /usr/local/bin/Manage Odin compiler versions:
# List available versions
opm versions
# Install a specific version
opm install dev-2024-01
opm install latest
# Switch to an installed version
opm use dev-2024-01
# Show current version
opm current
# Uninstall a version
opm uninstall dev-2024-01After installing, add opm's current version to your PATH:
export PATH="$HOME/.opm/current:$PATH"Create and manage Odin projects:
# Initialize a new project
opm init my-project
cd my-project
# Or initialize in current directory
opm init
# Show project info
opm info
# Build the project
opm build
# Run the project
opm run
# Run tests
opm test
# Check for errors
opm check
# Clean build artifacts
opm cleanManage project dependencies:
# Add a dependency
opm add odin-lang/odin-libs
opm add user/repo@v1.0.0
opm add user/repo#branch
# Add a dev dependency
opm add -D some-dev-tool/repo
# Remove a package
opm remove package-name
# Update packages
opm update # Update all
opm update pkg-name # Update specific
# Install all dependencies
opm install
# Install with frozen lockfile (CI/reproducible builds)
opm install --frozen
# List installed packages
opm list
# Search for packages
opm search raylibopm uses a lockfile (opm.lock) to ensure deterministic, reproducible builds:
- Automatic: When you add or install a package, opm records the exact commit hash
- Reproducible: Running
opm installwill always install the same versions - Frozen mode: Use
opm install --frozenin CI to fail if lockfile is missing or outdated
# Normal install - creates/updates lockfile
opm install
# Frozen install - requires exact lockfile match (for CI)
opm install --frozenTip: Commit opm.lock to your repository for reproducible builds across machines.
| Format | Description |
|---|---|
user/repo |
GitHub repository (shorthand) |
user/repo@v1.0.0 |
Specific tag |
user/repo#branch |
Specific branch |
github:user/repo |
Explicit GitHub |
git:https://... |
Any Git URL |
path:/local/path |
Local path (symlinked) |
Projects use an opm.json file:
{
"name": "my-project",
"version": "0.1.0",
"description": "My Odin project",
"author": "Your Name",
"license": "MIT",
"odinVersion": "dev-2024-01",
"dependencies": {
"raylib": "odin-lang/raylib-odin"
},
"devDependencies": {},
"collections": {
"raylib": "odin_packages/raylib"
},
"scripts": {
"custom": "echo 'custom script'"
},
"build": {
"src": "src",
"out": "bin",
"flags": ["-debug"]
}
}opm stores its data in ~/.opm/:
~/.opm/
├── versions/ # Installed Odin versions
│ ├── dev-2024-01/
│ └── dev-2024-02/
├── current -> versions/dev-2024-01 # Symlink to active version
├── cache/ # Download cache
└── config.json # Global configuration
Projects have this structure:
my-project/
├── src/
│ └── main.odin
├── tests/
├── bin/
├── odin_packages/ # Installed dependencies
├── opm.json # Project configuration
├── opm.lock # Lockfile for reproducible builds
└── .gitignore
# Run in development mode
bun run dev
# Run tests
bun test
# Build binary
bun run buildMIT