CRUX port manager written in Go, aiming to replace prt-get, ports, and some pkgutils (on my machine).
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Go Report Card

This project is currently in early alpha stage!

prt - CRUX port utility written in Go, aiming to replace prt-get, ports, and some pkgutils (on my machine)


prt command [arguments]


prt is like prt-get(8) a port/package management utility which provides additional functionality to the CRUX pkgutils. In addition to that it also strives to replace the CRUX pkgutils in Go. It works with the local ports tree and is therefore fully compatible with ports(8), pkgmk(8), pkgadd(8) and of course prt-get(8). It offers the following features:

  • Listing dependencies of ports recursively, with an optional flag to print using tree view.
  • Generating graphs of port dependencies
  • Listing outdated package, by comparing port versions with the installed version
  • Easily printing port information such as the maintainer, version, release, et cetera
  • Install ports and their dependencies with a single command
  • List ports, with optional flags to also only list installed ports, print with repo information or to print with additional version information
  • Print the location of a port
  • Searching through files ports provide, with an optional flag to only search through installed ports
  • Pull in ports using git(1)
  • Update outdated packages
  • Uninstall installed packages

Like said before, unlike prt-get(8), prt reimplements pkgmk(8)/pkgadd(8) fully in Go. This is mostly for more control. Like prt-get it does provide some nice extra functionality such as listing and installing dependencies, getting the location of a port, aliasing ports (for example core/openssl to 6c37-dropin/libressl), and ordering ports with the same name depending on how "important" the repo is the port resides in.

There are a few differences, for example, unlike prt-get(8) you need to be in the port's directory for most commands to work, like how pkgmk(8) works. This has a few advantages, for example you can quickly download a port anywhere on the filesystem, and install it and its dependencies using prt install. Because prt-get depinst needs a port name, you can only install ports that are located in a predefined prtdir.

Another difference with prt-get(8) is that prt does not use a cache file, while still being nearly as fast or faster in some cases.

Aliasing is also handeled a bit different. prt-get(8) aliases ports based on name, but prt on name and repo. This makes it possible to alias foo/bar to baz/bar.


The prt syntax is inspired by prt-get(8), git(8) and go(8), and thus uses so called commands which always have to be the first non-option argument passed. The commands are:

depends list dependencies recursively,

diff list outdated packages

info print port information

install build and install ports and their dependencies

list list porst and packages

loc print port locations

prov search ports for files

pull pull in ports

sysup update outdated packages

uninstall uninstall packages

help print help and exit


Make sure to check /etc/prt/config.toml after installation and edit values to fit your needs and setup.

If you use fish a cd wrapper for prt loc will also be installed, and some handy completions.


  • Implement depends command.
  • Implement diff command.
  • Implement info command. (This always prints something, even when not in a port directory...)
  • Implement graph command.
  • Implement install command.
  • Implement list command.
  • Implement loc command.
  • Implement patch command.
  • Implement prov command.
  • Implement pull command.
  • Implement sysup command.
  • Implement uninstall command.

  • Convert pkgmk get_filename function to Go. (so uhh, pkgmk does something with "absolute paths", do I need this as well?)
  • Convert pkgmk get_basename function to Go.
  • Convert pkgmk check_pkgfile function to Go.
  • Convert pkgmk check_directory function to Go.
  • Convert pkgmk check_file function to Go.
  • Convert pkgmk download_file function to Go. (curl is still used, is there some pure Go implementation?)
  • Convert pkgmk download_source function to Go.
  • Convert pkgmk unpack_source function to Go. (some Pkgfiles create their own unpack functions, I still need to detect and use those.)
  • Convert pkgmk make_md5sum function to Go.
  • Convert pkgmk make_footprint function to Go.
  • Convert pkgmk check_md5sum function to Go.
  • Convert pkgmk check_signature function to Go. (signify is still used, is there some pure Go implementation?)
  • Convert pkgmk make_signature function to Go.
  • Convert pkgmk strip_files function to Go.
  • Convert pkgmk compress_manpages function to Go.
  • Convert pkgmk check_footprint function to Go.
  • Convert pkgmk make_work_dir function to Go.
  • Convert pkgmk remove_work_dir function to Go.
  • Convert pkgmk install_package function to Go.
  • Convert pkgmk clean function to Go. (not going to implement, there is rm)

  • Write fish cdp function.
  • Write bash cdp function. (need to actually test this)
  • Write fish completions.
  • Write bash completions.

  • Write tests.
  • Make errors pretty and consistent.
  • Test environment variables.
  • Write README and man pages. (needs some updates with changes)
  • Check for missing config values.


Camille Scholtz