Help us shape the future of Go! Take the 2026 Go Developer Survey

factorix

package module
v0.24.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2026 License: MIT Imports: 1 Imported by: 0

README

⚙ Factorix

A CLI tool for Factorio MOD management, settings synchronization, and game control.

Overview

Factorix simplifies Factorio MOD management by providing:

  • A CLI tool for everyday MOD operations
  • Automatic dependency resolution and validation
  • JSON-based MOD settings export/import
  • Save file synchronization capabilities

Features

  • MOD Discovery & Download: Search and download MODs from the Factorio MOD Portal
  • Dependency Management: Automatic dependency resolution and validation with graph-based analysis
  • MOD State Management: Enable/disable MODs with automatic handling of dependencies and dependents
  • Installation & Uninstallation: Install MODs directly from the portal or uninstall existing MODs
  • Save File Sync: Synchronize MOD states and startup settings from Factorio save files
  • Settings Management: Export/import MOD settings in JSON format
  • Blueprint Conversion: Decode/encode Factorio blueprint strings to/from JSON
  • MOD Portal Integration: Upload new MODs or update existing ones, edit metadata
  • Game Control: Launch Factorio from the command line
  • RCon: Execute console commands and Lua scripts on a running Factorio server via RCon
  • Game Download: Download Factorio game files (alpha, expansion, demo, headless)
  • Cross-platform Support: Works on Windows, Linux, macOS, and WSL

Installation

Download a prebuilt binary for your platform from the latest release, extract it, and put factorix (or factorix.exe on Windows) on your PATH.

With mise installed:

mise use -g github:sakuro/factorix

Alternatively, with Go installed:

go install github.com/sakuro/factorix/cmd/factorix@latest

Requirements

  • Factorio API Key (required for uploading MODs and editing MOD metadata)

Setup

For uploading MODs or editing MOD metadata, set the FACTORIO_API_KEY environment variable:

export FACTORIO_API_KEY=your_api_key_here

API key is not required for managing local MODs.

For downloading MODs from the MOD Portal (including via factorix mod install) or downloading the game itself, service credentials are required. These are automatically loaded from player-data.json if you have logged into Factorio, or you can set FACTORIO_USERNAME and FACTORIO_TOKEN environment variables.

Configuration

Path Configuration

Factorix auto-detects Factorio installation paths for Steam installations. For other environments or to override the detected paths, create a configuration file.

Find configuration file location:

factorix path --json | jq -r .factorix_config_path

Create configuration file:

# Copy example configuration
cp example/config.toml ~/.config/factorix/config.toml

# Edit the configuration
$EDITOR ~/.config/factorix/config.toml

Configurable paths:

  • executable_path - Path to Factorio executable
  • user_dir - Path to Factorio user directory (MODs, saves, settings)
  • data_dir - Path to Factorio data directory

Example configuration:

[runtime]
executable_path = "/Applications/Factorio.app/Contents/MacOS/factorio"
user_dir = "/Users/me/Library/Application Support/factorio"
data_dir = "/Applications/Factorio.app/Contents/data"

See example/config.toml for platform-specific examples and additional configuration options.

Alternative configuration path:

You can specify a custom configuration file path using the --config-path option or FACTORIX_CONFIG environment variable:

# Using CLI option
factorix mod list --config-path=/path/to/config.toml

# Using environment variable
export FACTORIX_CONFIG=/path/to/config.toml
factorix mod list

Usage

Run factorix --help to see available commands, or factorix <command> --help for command-specific usage and examples. Run factorix man for the full manual page.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/sakuro/factorix.

For development setup and detailed contribution guidelines, please see DEVELOPMENT.md.

License

Factorix is available as open source under the terms of the MIT License.

Copyright (c) 2025 OZAWA Sakuro

Documentation

Overview

Package factorix embeds distribution assets that must travel inside the single binary.

Index

Constants

This section is empty.

Variables

View Source
var ManPage []byte

ManPage is the roff source of the factorix(1) manual page.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
factorix command
Command factorix is a CLI for Factorio MOD management, settings synchronization, and MOD Portal integration.
Command factorix is a CLI for Factorio MOD management, settings synchronization, and MOD Portal integration.
internal
api
Package api implements the Factorio MOD Portal and game download API clients.
Package api implements the Factorio MOD Portal and game download API clients.
app
Package app is the composition root: it wires configuration, the platform runtime, logging, caches, and API clients.
Package app is the composition root: it wires configuration, the platform runtime, logging, caches, and API clients.
blueprint
Package blueprint encodes and decodes Factorio blueprint strings (a version byte followed by Base64-encoded zlib-compressed JSON).
Package blueprint encodes and decodes Factorio blueprint strings (a version byte followed by Base64-encoded zlib-compressed JSON).
cache
Package cache provides content caching behind a backend-neutral interface.
Package cache provides content caching behind a backend-neutral interface.
changelog
Package changelog parses and manipulates Factorio changelog.txt files.
Package changelog parses and manipulates Factorio changelog.txt files.
cli
Package cli defines the factorix command tree (cobra).
Package cli defines the factorix command tree (cobra).
config
Package config loads the Factorix configuration from config.toml.
Package config loads the Factorix configuration from config.toml.
dependency
Package dependency parses MOD dependency strings and builds, sorts, and validates the dependency graph.
Package dependency parses MOD dependency strings and builds, sorts, and validates the dependency graph.
httpx
Package httpx wraps net/http with HTTPS enforcement, credential masking in logs, and retry/cache decorators implemented as http.RoundTripper chains.
Package httpx wraps net/http with HTTPS enforcement, credential masking in logs, and retry/cache decorators implemented as http.RoundTripper chains.
logging
Package logging sets up the application logger (log/slog) writing to the platform log path.
Package logging sets up the application logger (log/slog) writing to the platform log path.
mod
Package mod holds the core domain types: MOD identity, versions, mod-list.json handling, and installed MOD packages.
Package mod holds the core domain types: MOD identity, versions, mod-list.json handling, and installed MOD packages.
platform
Package platform resolves Factorio and Factorix paths for each supported OS (Linux, macOS, Windows, WSL).
Package platform resolves Factorio and Factorix paths for each supported OS (Linux, macOS, Windows, WSL).
progress
Package progress defines the listener interface for transfer and scan progress.
Package progress defines the listener interface for transfer and scan progress.
rcon
Package rcon is a TCP client for the Source RCON protocol, ported from the rcon-client gem.
Package rcon is a TCP client for the Source RCON protocol, ported from the rcon-client gem.
resolver
Package resolver selects MOD Portal releases and resolves MOD dependencies against the Portal.
Package resolver selects MOD Portal releases and resolves MOD dependencies against the Portal.
save
Package save extracts MOD information and startup settings from Factorio save files (.zip archives containing level.dat0 or level-init.dat).
Package save extracts MOD information and startup settings from Factorio save files (.zip archives containing level.dat0 or level-init.dat).
serdes
Package serdes reads and writes Factorio's custom binary format used in save files and mod-settings.dat.
Package serdes reads and writes Factorio's custom binary format used in save files and mod-settings.dat.
settings
Package settings handles MOD settings stored in mod-settings.dat.
Package settings handles MOD settings stored in mod-settings.dat.
transfer
Package transfer downloads and uploads files with caching and progress reporting.
Package transfer downloads and uploads files with caching and progress reporting.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL