o
odinpkg.dev
packages / library / opkg

opkg

Latestlibrary

Package manager for Odin

No license · updated 4 months ago

opkg

A simple package manager for the Odin programming language.

Requirements

Installation

Download the latest opkg.exe from the releases page and add it to your PATH.

Usage

Initialize a project

Creates an odin.pkg file in the current directory.

opkg init

Add a package

Clones the package from GitHub and adds it to odin.pkg.

opkg add github.com/user/repo

Install all packages

Reads odin.pkg and installs all dependencies. Run this after cloning a project.

opkg install

Remove a package

Deletes the package folder and removes it from odin.pkg.

opkg remove github.com/user/repo

The odin.pkg file

When you run opkg init it creates an odin.pkg file in your project:

{
    "name": "my_project",
    "version": "1.0.0",
    "dependencies": {
        "github.com/laytan/odin-http": "main"
    }
}

Using installed packages

Packages are installed into a packages/ folder in your project. Import them in your Odin code like this:

import "packages/github.com/laytan/odin-http"

Add packages/ to your .gitignore so dependencies are not committed to your repo. Others can run opkg install to get them.

Contributing

Contributions are welcome. Open an issue or pull request on GitHub.