Code Monkey home page Code Monkey logo

fac's Introduction

fac

Fac is a command-line mod manager for Factorio 0.13 written in Python 3.

You'll need to have Python 3 which can be obtained through your distribution's package manager or downloaded from https://www.python.org/ (for Windows users).

Installation can be easilly done using pip:

$ pip3 install fac-cli

Or 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 run pip from a virtualenv or you use the --user flag.

If you run pip with the --user flag, make sure ~/.local/bin is in your PATH or the fac command will not work.

fac needs to be able to know the location of:

  • The Factorio data directory, eg /usr/share/factorio/
  • The Factorio configuration directory, eg ~/.factorio

Normally, it should be able to detect these automatically assuming you have a standard setup (eg Steam) It will also look in the current and parent directories.

If for some reason it fails to find these, you'll have to specify them in fac's config file which is located in:

  • ~/.config/fac/config.ini on Linux
  • C:\Users\<username>\AppData\Local\fac\config.ini on Windows
  • ~/Library/Application Support/fac/config.ini on Mac OS X
[paths]
data-path = /home/me/my_factorio/data
write-path = /home/me/my_factorio

You can display the currently detected locations using fac -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...]
[...]

fac can be run using the fac command. 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

general options:
  -v, --verbose  show more detailled output
  -h, --help     show this help message and exit

Below are simple examples of what you can do for each command.

$ fac list
Enabled mods:
    YARM
$ fac disable YARM
YARM is now disabled

$ fac list
Disabled mods:
    YARM

$ fac enable YARM
YARM is now enabled

$ fac list
Enabled mods:
    YARM
$ fac search 5dim
5dim_core
    Core of all 5dim's mod

5dim_automatization
    Automatization for 5dim's mod

5dim_energy
    Energy for 5dim's mod

5dim_transport
    Transport for 5dim's mod

5dim_logistic
    logistic of all 5dim's 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.13
$ fac install Foreman 5dim_logistic
Adding dependency: 5dim_core 0.13.1
Installing: Foreman 0.2.3...
Downloading: https://mods.factorio.com/api/downloads/data/mods/308/Foreman_0.2.3.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 is already installed in a more recent version. Use --force to downgrade it.

$ fac install Foreman==0.2.2 --force
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.3.zip
$ 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.zip

Use this to keep mods from being automatically updated when using the update command.

$ 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
Foreman is held. Use --force 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.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.zip
$ 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.zip

You can also use wildcards:

$ 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

Note the presence of apostrophes around '5dim_*' to prevent the shell from interpreting the asterisk.

fac's People

Contributors

mickael9 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.