|Aug 20, 2023
|Aug 14, 2023
#649 in Development tools
Facti is in its early stages and very much a work in progress and highly experimental.
Any commands and APIs are subject to change while it's still in pre-release.
Contributors are very welcome!
Expected mod layout
This tool expects your mod to be organized a certain way, as shown by the diagram below.
.git folder is just to show where the root of the Git repo is.)
│ └── en/
│ └── mod.cfg
For more help on the CLI commands, you can run
facti help <command>
facti <command> --help.
Commands outlined here are still experimental and subject to change. Additionally, some commands may not have been implemented yet.
Create new mod
Facti can bootstrap a new mod for you, placing some placeholder files and setting up the expected folder structure:
facti new [mod-name]
When invoked without a name, it will set it up in the current directory, if it is empty, using the directory name as the mod name.
You can use facti to package your mod for distribution to the mod portal
(or elsewhere) by using
If this command is used inside a Git repo, it will check to make sure the project layout matches the one describes under Expected mod layout.
If the current directory is not a Git repo, but contains an
it will treat that as the mod directory.
To override the mod directory, pass it as an argument to
facti pack cool/path/to/mod
Passing an explicit directory will disable Git repository detection and fail
if the specified directory does not contain an
You can interact with the Factorio mod portal via facti by using the
facti portal command.
Here are some examples:
# Search for mods that match the name "cybersyn-combinator"
facti portal search cybersyn-combinator
# Show information about the cybersyn-combinator mod
facti portal show cybersyn-combinator
# Show more detailed information about the cybersyn-combinator mod
facti portal show --full cybersyn-combinator
# By default, deprecated mods are excluded from search
# if you want to show them you have to specify the --deprecated flag
facti portal search --deprecated
# You can enable JSON output by supplying the --json flag.
# In a non-interactive context, this is the default
# and can be negated with --no-json
facti portal --json show --full cybersyn-combinator
# Checks if all listed mods are compatible with each other.
# Currently this just makes sure none of the mods have each other listed
# as "incompatible"
facti portal check cybersyn-combinator cybersyn
# By default the above command will check against the latest version of each
# mod, to check a specific version you can include a version requirement
facti portal check firstname.lastname@example.org email@example.com
Some commands like uploading mod packages to the mod portal require the use of an API key.
To obtain this, you must generate an API key on your Factorio profile page.
Your API key is highly sensitive, do not store it anywhere other people than you might get access to it.
Facti maintainers will NEVER ask for your API key.
Anyone who gets access to your API key can publish and/or modify your mods without your approval, depending on the permissions on the key.
To make use of all features in facti, you must enable all three usage checkboxes:
- ModPortal: Upload Mods
- ModPortal: Publish Mods
- ModPortal: Edit Mods
Of course, if you know you will not use some of these, you can disable them to avoid granting more permissions than necessary.
You can either provide the API key with every invocation of facti like so:
# Directly as a parameter
facti --api-key <your-api-key> ...
# from stdin to avoid it showing up in shell history
$ facti --api-key-stdin ...
Please input your Factorio API key to continue:
# read it from a file
$ facti --api-key-file <path-to-file> ...
Or save it in facti's configuration file:
api-key = "<your-api-key>"
facti will look for its configuration file in the following places and in this order:
You can manually specify the location of the config file when invoking facti:
facti --config <path-to-config-file> ...
You can also supply the API key via environment variables:
As well as the path to the config file:
As a rule, the most "direct" application of a setting is the one that will be in effect.
Essentially, this means settings are resolved in this order:
- Command line arguments
- Environment variables
- Configuration file
The first one encountered "wins".
For API keys specifially, there is also a priority within the different ways to supply it:
--api-keycommand line option
api-keysetting in config file
From standard input (stdin) with
--api-key-filecommand line option
api-key-filesetting in config file
The first one encountered wins, with respect to the primary hierarchy of CLI arguments vs environment variables vs config file.
For example: If your config file has a value for
the environment variable
FACTI_FACTORIO_API_KEY_FILE is set,
and you also specify
--api-key-stdin, then the stdin method will win,
because it was specified via command line argument, which is in the top primary
Copyright © 2023 by Adam Hellberg.