Skip to content

Adding Packages

Use nubo get to add a package.

Terminal window
nubo get github.com/nubolang/color

You can add a specific revision with @.

Terminal window
nubo get github.com/nubolang/color@f5063d6

If no revision is provided, Nubo uses latest.

Terminal window
nubo get github.com/nubolang/color

Package URIs are parsed like this:

domain/user/repo
domain/user/repo@version
domain/user/repo/subpath
domain/user/repo/subpath@version

Examples:

Terminal window
nubo get github.com/nubolang/color
nubo get github.com/nubolang/color@main
nubo get github.com/nubolang/color@f5063d6
nubo get github.com/org/repo/subpackage

Nubo accepts URIs with or without https://.

Terminal window
nubo get https://github.com/nubolang/color
nubo get github.com/nubolang/color

Internally, the source becomes a Git URL:

https://github.com/nubolang/color.git

When a package is added, Nubo:

  1. Parses the package URI.
  2. Builds a Git repository URL.
  3. Clones the repository into a temporary cache path.
  4. Resolves the requested revision.
  5. Checks out the exact commit.
  6. Moves the package into the global package cache.
  7. Hashes the package directory.
  8. Updates _nubo.yaml.
  9. Updates lock.yaml.
  10. Loads and merges nested dependencies from the package’s own lock.yaml, if it exists.

Downloaded packages are stored in the global cache.

~/nubo/packages/<domain>/<user>/<repo>@<full-commit-hash>

Example:

~/nubo/packages/github.com/nubolang/color@f5063d6fa53bf8be818f4316273ee81fb5474d21

A package added from:

github.com/nubolang/color

gets the package name:

nubolang/color

If a subpath is used:

github.com/org/repo/tools/colors

the package name becomes:

org/repo/tools/colors

If a package already exists in _nubo.yaml or lock.yaml, Nubo updates the existing entry instead of adding a duplicate.

Entries are matched by package name or source URL.

If the downloaded package contains a lock.yaml, Nubo loads it and merges its entries into the current project’s lockfile.

This lets packages bring their own locked dependencies.

Terminal window
nubo get github.com/nubolang/color

Result in _nubo.yaml:

packages:
- source: https://github.com/nubolang/color.git
commit: f5063d6

Result in lock.yaml:

entries:
- name: nubolang/color
source: https://github.com/nubolang/color.git
commit_hash: f5063d6fa53bf8be818f4316273ee81fb5474d21
hash: sha256:d0b1dc4e7af156690f762c2d90c6bbe62c7ad265cd9a9e9e54c30fac26cbf0ef