Package: fac-cli
Facis a command-line mod manager for Factorio >=0.13 written in Python 3.ContentsInstallationConfigurationUsageListing installed modsEnabling & disabling modsSearching for modsShowing detailled info about a modInstalling modsUpdating modsHolding modsRemoving modsPacking/unpacking modsUsing wildcardsMod name autocorrectionGame version incompatibilitiesZSH completion scriptChangelogInstallationYou’ll need Python 3, which can be obtained through your distribution’s
package manager or downloaded fromhttps://www.python.org/(for Windows users).Installation can be easilly done using pip:$ pip3 install fac-cliOr directly from git:$ pip3 install -e "git+https://github.com/mickael9/fac.git#egg=fac-cli"Or from an existing clone:$ pip3 install -e .NOTE (linux users): By default, these commands will require you to be root unless you
runpipfrom a virtualenv or you use the--userflag.If you runpipwith the--userflag, make sure~/.local/binis in yourPATHor thefaccommand will not work.Configurationfac needs to be able to know the location of:The Factorio data directory, eg/usr/share/factorio/The Factorio configuration directory, eg~/.factorioNormally, it should be able to detect these automatically assuming you have a standard
setup (eg. Steam).
It will also look in the current working directory and its parent.If for some reason these paths can’t be found automatically, you’ll have to specify
them in fac’s config file, which is located at:~/.config/fac/config.inion LinuxC:\Users\<username>\AppData\Local\fac\config.inion Windows~/Library/Application Support/fac/config.inion Mac OS X[paths]data-path=/home/me/my_factorio/datawrite-path=/home/me/my_factorioYou can display the currently detected locations usingfac-v:$ fac -v
DEBUG:fac.main:Factorio write path: /home/mickael/.factorio
DEBUG:fac.main:Factorio game path: /usr/share/factorio
DEBUG:fac.main:Factorio version: 0.13.9
usage: fac COMMAND [options...]
[...]Usagefaccan be run using thefaccommand.
It is further divided into several subcommands:usage: fac COMMAND [options...]

Mod manager for Factorio

  COMMAND
    list                List installed mods and their status.
    enable              Enable mods.
    disable             Disable mods.
    search              Search the mods database.
    show                Show details about specific mods.
    install             Install (or update) mods.
    update              Update installed mods.
    remove              Remove mods.
    hold                Hold mods (show held mods with no argument).
    unhold              Unhold mods.
    pack                Pack mods.
    unpack              Unpack mods.
    fetch               Fetch a mod from the mod portal.
    make-compatible     Change the supported factorio version of mods.

general options:
  -g GAME_VERSION, --game-version GAME_VERSION
                        force a specific game version
  -m MODS_DIRECTORY, --mods-directory MODS_DIRECTORY
                        use the specified mods directory
  -i, --ignore-game-ver
                        ignore game version when selecting packages
  -v, --verbose         show more detailled output
  -h, --help            show this help message and exitBelow are simple examples of what you can do for each command.Listing installed mods$ fac list
Installed mods:
    Warehousing 0.0.10
    YARM 0.7.105
    advanced-logistics-system 0.3.0 (unpacked, incompatible)
    creative-mode 0.1.4 (disabled, unpacked)Enabling & disabling mods$ fac disable YARM
YARM is now disabled

$ fac list
    YARM 0.7.105 (disabled)

$ fac enable YARM
YARM is now enabled

$ fac list
    YARM 0.7.105Searching for mods$ fac search 5dim

5dim's Mod - Core
    Name: 5dim_core
    Tags: big-mods

    Core of all 5dim's mod

5dim's Mod - Automatization
    Name: 5dim_automatization
    Tags: big-mods

    Automatization for 5dim's mod

5dim's Mod - Energy
    Name: 5dim_energy
    Tags: big-mods

    Energy for 5dim's mod

[...]Showing detailled info about a mod$ fac show 5dim_logistic
Name: 5dim_logistic
Author: McGuten
Title: 5dim's Mod - Logistic
Summary: logistic of all 5dim's mod
Description:
    logistic of all 5dim's mod
Tags: big-mods
Homepage: http://www.5dim.es
License: MIT
Game versions: 0.13
Releases:
    Version: 0.13.1    Game version: 0.13
    Version: 0.13.0    Game version: 0.13Installing mods$ fac install Foreman 5dim_logistic
Adding dependency: 5dim_core 0.13.1
Installing: Foreman 0.2.5...
Downloading: https://mods.factorio.com/api/downloads/data/mods/308/Foreman_0.2.5.zip...
Installing: 5dim_core 0.13.1...
Downloading: https://mods.factorio.com/api/downloads/data/mods/191/5dim_core_0.13.1.zip...
Installing: 5dim_logistic 0.13.1...
Downloading: https://mods.factorio.com/api/downloads/data/mods/196/5dim_logistic_0.13.1.zip...

$ fac install Foreman==0.2.2
Foreman==0.2.5 is already installed. Use -R to reinstall it.

Foreman is already installed in a more recent version. Use -D to downgrade it.

$ fac install Foreman==0.2.2 -D
Installing: Foreman 0.2.2...
Downloading: https://mods.factorio.com/api/downloads/data/mods/308/Foreman_0.2.2.zip...
Removing: /home/mickael/.factorio/mods/Foreman_0.2.5.zipThe fetch command can be used to download a mod into a specified directory.Updating mods$ fac update
Checking: Foreman
Checking: 5dim_logistic
Checking: 5dim_core
Checking: YARM
Found 1 update:
    Foreman 0.2.2 -> 0.2.3
Continue? [Y/n]
Downloading: https://mods.factorio.com/api/downloads/data/mods/308/Foreman_0.2.3.zip...
Removing: /home/mickael/.factorio/mods/Foreman_0.2.2.zipHolding modsUse this to keep mods from being automatically updated when using theupdatecommand.$ fac install Foreman==0.2.2
Installing: Foreman 0.2.2...
Downloading: https://mods.factorio.com/api/downloads/data/mods/308/Foreman_0.2.2.zip...

$ fac hold Foreman
Foreman will not be updated automatically anymore

$ fac update
Checking: Foreman
Found update: Foreman 0.2.5
Foreman is held. Use -H to update it anyway.
No updates were found

$ fac unhold Foreman
Foreman will now be updated automatically.

$ fac update
Checking: YARM
Found 1 update:
    Foreman 0.2.2 -> 0.2.5
Continue? [Y/n]
Downloading: https://mods.factorio.com/api/downloads/data/mods/308/Foreman_0.2.5.zip...
Removing: /home/mickael/.factorio/mods/Foreman_0.2.2.zipRemoving mods$ fac remove Foreman
The following files will be removed:
    /home/mickael/.factorio/mods/Foreman_0.2.3.zip
Continue? [Y/n]
Removing: /home/mickael/.factorio/mods/Foreman_0.2.3.zipPacking/unpacking modsMods can be either packed (name_0.1.zip) or unpacked (name_0.1/) and the game will
accept both of them.Keep in mind that the game will refuse to start if there is both a packed and unpacked
version of a mod, or if there are multiple installed versions for any given mod.$ fac unpack yarm
Unpacking: /home/mickael/.factorio/mods/YARM_0.7.105.zip
Removing file: /home/mickael/.factorio/mods/YARM_0.7.105.zip
YARM is now unpacked

$ fac pack yarm
Packing: /home/mickael/.factorio/mods/YARM_0.7.105/
Removing directory: /home/mickael/.factorio/mods/YARM_0.7.105/
YARM is now packedUsing wildcardsCommands that work on locally installed mods can accept wildcards, eg:$ fac remove '5dim_*'
The following files will be removed:
    /home/mickael/.factorio/mods/5dim_logistic_0.13.1.zip
    /home/mickael/.factorio/mods/5dim_core_0.13.1.zip
Continue? [Y/n]
Removing: /home/mickael/.factorio/mods/5dim_logistic_0.13.1.zip
Removing: /home/mickael/.factorio/mods/5dim_core_0.13.1.zip

$ fac enable '*'
advanced-logistics-system was already enabled
Warehousing was already enabled
YARM was already enabled
Foreman is now enabledNote the presence of quotes around filters to prevent the shell from interpreting them.Mod name autocorrectionMost commands will try to guess the correct name when given inexact mod names.If the name is a filter (eg5dim_*), no attempt to autocorrect will be made.The following attempts are made to find a match for a given mod name:Exact matchCase-insensitive matchPartial case-insensitive match if there is no ambiguity.For remote commands (install, update…), the search result if there is only one.For remote commands, a local match will first be attempted at each step.For instance:yarmwill be converted toYARMvia theCase-insensitive matchstrategyyawill either be converted toYARMif you have YARM installed
or fail because there is more than one result to thefac search yacommand.Game version incompatibilitiesMods are tied to a specific factorio version (eg 0.13, 0.14) and can only work
with that version. A 0.14 game will refuse to load a mod made for 0.13.By default,facwill autodetect your installed factorio version and use that to filter
the available commands to compatible mods.In some cases, you might want to disable this filtering using the-ioption.
You can also override the detected game version using-g0.13for instance.Amake-compatiblecommand is provided. It will automatically unpack a mod and change
itsfactorio_versionfield to the currently set game version
(autodetected or provided by the-goption).Usage scenarioYou’re currently running Factorio 0.14 and want to install your favorite mod,YARM:$ fac search YARM
Note: 1 mods were hidden because they have no compatible game versions. Use -i to show them.

$ fac search YARM -i
Yet Another Resource Monitor Fork
    Name: YARM
    Tags: incompatible, info

This mod helps you to keep track of your mining sites.Feeling courageous, you want to try it anyway:$ fac install -i YARM
[...]

$ fac make-compatible YARM
Unpacking: /home/mickael/.factorio/mods/YARM_0.7.105.zip
Removing file: /home/mickael/.factorio/mods/YARM_0.7.105.zip
Game version changed to 0.14 for YARM 0.7.105.You can now use the mod as if it was made for Factorio 0.14.ZSH completion scriptIf you’re using ZSH (and you should be!) you can install the provided completion script
for a better experience.You’ll need to add thezshdirectory to yourfpathusing something like this in
your.zshrc:fpath+=(/path/to/fac/zsh)If you installed fac using pip as root, the script should automatically be installed in
the right place (/usr/share/zsh/site-functions).Withpip--user, you’ll need to add this in your.zshrc:fpath+=(~/.local/share/zsh/site-functions)Note:compinitmust be called afterfpathis changed so you must either put your changes beforecompinitor add anothercompinitcall after changingfpath.Changelog0.9Known issues:searchcommand will list all existing mods regardless of the search critera.
This shall be addressed in a future release.Compatibility with the new mod portalFix mod install failure across filesystemsSearch for Factorio installation in lowercasesteamappsdirectory as wellDon’t follow symbolic links when packing/unpacking mods0.8Added automatic retries of network requests to the APIAdded pagination options tosearchcommand:-p,--page: starting page number for the API calls-s,--page-size: maximum number of returned results per page-c,--page-count: maximum number of pages to fetchFixed Factorio 0.15 compatibility (use booleans in mod-list.json)Fixed-m,--mods-directorybeing ignored when loading mod-list.json0.7Added more friendly error messages when the user doesn’t own the gameFixed “AttributeError: ‘ZippedMod’ object has no attribute ‘factorio_version’” (#8)0.6Added-F,--formattolistandshowcommands.Added-I,--includeand-E,--excludetolistcommands.Added-m,--mods-directoryoption to use a specific mods directory.Added fac version to output when using-v,--verbose.Improved ZSH completion script.Fixedwrite-pathanddata-pathbeing ignored from config.iniFixedsearchcommand format string argument.Fixed options parsing to allow general options anywhere in the command line.0.5Added workaround for 0.14 mods being considered as 0.13 mods.Added a ZSH completion script.Added-F,--formatoption tosearchcommand to customize the output format using format strings.Various bug fixes.0.4Newpackandunpackcommands to work on unpacked mods.Newfetchcommand to fetch a mod without installing it.Newmake-compatiblecommand to bump thefactorio_versionof an installed mod.New-l,--limitoption to thesearchcommand.New-g,--game-versionoption to override the detected game version.New-i,--ignore-game-verflag to ignore the current game version.Removed--forceflag in favor of the more specfic-R,--reinstall,-D,--downgrade,-H,--held.Accept patterns inenable,pack,holdcommands.Resolve partial mod names.Various bug fixes.0.3Support for mods with spaces in their names.0.2Add -y flag to update and remove commands.Recursively create config directory.PyPI packaging.0.1Initial version.