CLI Package manager designed for packaging game mods

usage: portmod [-h] [-q] [-v] [--no-confirm] [--version]
               {<example>,mirror,init,sync} ...

Positional Arguments


Possible choices: <example>, mirror, init, sync

Named Arguments

-q, --quiet

Don’t display anything but the most important information.

-v, --verbose

Increase verbosity of output.


Don’t prompt for confirmation and always select the default option instead.


Displays the version number of Portmod.



Interact with the <example> prefix

portmod <example> [-h]

Positional Arguments


Possible choices: merge, search, select, query, use, info, validate, destroy, run, cfg-update, module-update



Install or remove packages

Packages passed as arguments will always be installed (or re-installed) unless the --update flag is used, and will be selected (tracked as explicitly installed and not removed unless explicitly removed) unless the --oneshot flag is used.

Package changes are displayed using a transaction list of the following form:

[XX] category/package-name USE="flag -disabled-flag"
X is a placeholder for one of the following:
  • f fetch-restricted, but already available in the download cache

  • F fetch-restricted, but unavailable in the download cache (must be downloaded manually)

  • N (new) indicates the package was not previously installed

  • R (reinstall) indicates that the same version of the package is being re-installed.

  • U (update) indicates that the package is being updated to new version

  • D (downgrade) indicates that the package is being downgraded to an older version

  • d (delete) indicates that the package is being removed

USE flags:
  • Enabled flags are displayed bold red.

  • Disabled flags are displayed blue.

  • Flags which have changed since the last time the package was installed are displayed bold green.

  • Flags in use expand categories are displayed in the form CATEGORY=”flag” (for the flag ‘category_flag’)

portmod <example> merge [-h] [--ignore-default-opts] [-c] [-x] [-C] [-1] [-O]
                        [-u] [-n] [-N] [-e] [-D] [-w [Yes/No]]
                        [--deselect [Yes/No]] [--debug]
                        [ATOM | ARCHIVE | @SET ...]
Positional Arguments

Packages to install. Can be either a package atom (“category/name”) set (“@set_name”) or source archive path (“path/to/archive.ext”). If an archive path is passed as an argument, portmod will search for matching archives used by packages it is aware of. Portmod cannot install from arbitrary archives.

Named Arguments

Causes the OMWMERGE_DEFAULT_OPTS environment variable to be ignored

-c, --depclean

Removes packages and their dependencies. Packages dependent on the given packages will also be removed. If no arguments are given, this will remove packages that aren’t needed by other packages and aren’t in the world file or system set.

-x, --auto-depclean

Automatically remove unneeded dependencies before finishing. Equivalent to running portmod <prefix> merge –depclean after other operations.

-C, --unmerge

Removes the given packages without checking dependencies.

-1, --oneshot

Do not make any changes to the world set when installing or removing packages

-O, --nodeps

Ignore dependencies when installing specified packages. Note: This may cause packages to fail to install if their build dependencies aren’t satisfied, and fail to work if their runtime dependencies aren’t satisfied.

-u, --update

Updates packages to the best version available and excludes packages if they are already up to date.

-n, --noreplace

This option has been merged into –update and is now deprecated.

-N, --newuse

This option has been merged into –update and is now deprecated.

-e, --emptytree

Reinstalls target packages and their entire deep dependency tree, as if no packages are currently installed.

-D, --deep

Consider the entire dependency tree when doing updates instead of just the packages specified on the command line.

-w, --select

Adds specified packages to the world set (unused. This is the default if deselect is not provided).


Removes specified packages from the world set. This is implied by uninstall actions such as –depclean and –unmerge. Use –deselect=n to prevent uninstalls from removing packages from the world set.


Skips the cleanup stage after installation so that the contents of temporary directories can be inspected. Note that you will need to clean up leftover files manually.


Select between configuration options

portmod <example> select [-h] {profile,news,repo} ...

Manage the profile symlink

portmod <example> select profile [-h] {list,set,show,debug} ...

List available profiles

portmod <example> select profile list [-h]

Set a new profile symlink target

portmod <example> select profile set [-h] NUMBER
Positional Arguments

Profile number


Show the current profile symlink target

portmod <example> select profile show [-h]

Show debug information about the current profile

portmod <example> select profile debug [-h]

Manage news

portmod <example> select news [-h] {list,read,unread} ...

List all news articles

portmod <example> select news list [-h]

Displays news article and marks as read

portmod <example> select news read [-h] [<item>]
Positional Arguments

new (default) all or item number

Default: “new”


Marks news article as unread

portmod <example> select news unread [-h] <item>
Positional Arguments

all or item number


Configure the repositories associated with this prefix

portmod <example> select repo [-h] {list,add,remove} ...

List available package repositories

portmod <example> select repo list [-h]

Add a package repository to this prefix

portmod <example> select repo add [-h] REPO
Positional Arguments

Identifier for the repository. Either the repository name, or its index in the list.


Remove a package repository from this prefix

portmod <example> select repo remove [-h] REPO
Positional Arguments

Identifier for the repository. Either the repository name, or its index in the list.


Query information about packages

portmod <example> query [-h] [-a]
Named Arguments
-a, --all

Also query packages which are not installed


List all packages matching ATOM.

By default only lists installed packages.

Produces output in the form of:

[IR] category/package-version

The Presence of the I flag indicates that the package is installed The Presence of the R flag indicates that the package is available in a repository

portmod <example> query list [-h] [-r] ATOM | @SET [ATOM | @SET ...]
Positional Arguments

Atoms specifying the packages to list

Named Arguments
-r, --remote

If specified, also list packages in the remote repositories


List all packages directly depending on ATOM

portmod <example> query depends [-h] ATOM
Positional Arguments

Package atom to query


List all packages matching variable.

This can only be used to scan variables in the base Pybuild spec, not custom fields declared by specific Pybuilds or their superclasses.

portmod <example> query has [-h] [--invert] FIELD [VALUE]
Positional Arguments

Pybuild field to search


Value to match in field

Default: “”

Named Arguments

If set, returns packages which do not match the query


List all packages that declare the given use flag.

Note that this only includes those with the flag in their IUSE field and inherited flags through IUSE_EFFECTIVE will not be counted

portmod <example> query hasuse [-h] FLAG
Positional Arguments

Use flag to match against


Display use flags and their descriptions

portmod <example> query uses [-h] ATOM
Positional Arguments

Atom specifying the package whose flags are to be displayed


Display metadata for a package

portmod <example> query meta [-h] ATOM
Positional Arguments

Atom specifying the package whose metadata is to be displayed


Display dependency graph for package

portmod <example> query depgraph [-h] [--depth DEPTH] ATOM
Positional Arguments

Atom specifying package whose dependency graph is to be displayed

Named Arguments

Maximum depth of the tree to be displayed. Default is 10


Display the full path of the given file/directory in the VFS

portmod <example> query vfsfind [-h] name
Positional Arguments

Display the full path of the given file/directory in the VFS


Display the contents of the given directory in the VFS

portmod <example> query vfslist [-h] [directory_path]
Positional Arguments

Display the contents of the given directory in the VFS


Enable and disable use flags

portmod <example> use [-h] [-E FLAG] [-D FLAG] [-R FLAG] [-p ATOM]
Named Arguments

Enable use flag


Explicitly disable use flag


Remove references to the given use flag (enabled or disabled)


Package atom for setting local use flag. If not set, enables/disables global use flags.


Displays the values of several global variables for debugging purposes.

portmod <example> info [-h]

Check if the packages in the package directory are installed, and that the directories in the config all exist.

portmod <example> validate [-h]

Destroy this prefix

portmod <example> destroy [-h] [--preserve-root] [--remove-config]
Named Arguments

Don’t remove the prefix ROOT when destroyign the prefix (removed by default)


Remove the prefix config directory when destroyign the prefix (not removed by default)


Run commands within the sandbox for the prefix

portmod <example> run [-h] COMMAND [COMMAND ...]
Positional Arguments

Command to execute. If the command contains arguments beginning with “-“, then it must be prefixed with – to separate it from the arguments to portmod.


Interactively applies pending updates to protected config files.

portmod <example> cfg-update [-h]

Runs module updates.

portmod <example> module-update [-h]


Update a local mirror

portmod mirror [-h] DIRECTORY REPO

Positional Arguments


Directory to mirror into


Repository with the files to mirror. Mirroring will be limited to this repository and its masters.


Create a new prefix

portmod init [-h] PREFIX arch [DIRECTORY]

Positional Arguments


Prefix name which will be used in commands that interact with the prefix


Game engine Architecture of the prefix


Directory in which to create the prefix. If omitted, portmod will create the prefix within a new directory in /tmp/portmod.test/local.

If files already exist in the directory, they will be left alone to allow portmod to work with existing game data. Portmod may install over top of these files, however the original versions will be preserved and restored if the package overwriting those files is removed, or the prefix is removed.


Fetch and update remote package repositories

portmod sync [-h] [repository ...]

Positional Arguments


Repositories to sync. If omitted, all repositories in repos.cfg will be synched.