Mother DocsMother Docs
Buy me a Coffee
Steam Workshop
Discord
  • Mother OS (Ingame Script)
Buy me a Coffee
Steam Workshop
Discord
  • Mother OS (Ingame Script)
  • Mother OS (Ingame Script)
    • Getting Started

      • Upgrade Guide
      • Installation
      • Command Line Interface (CLI)
      • Configuration
      • Modules
    • Core Modules

      • Activity Monitor
      • Almanac
      • Block Catalogue
      • Local Storage
      • Security
      • Intergrid Message Service
    • Extension Modules

      • Air Vent Module
      • Battery Module
      • Terminal Block Module
      • Cockpit Module
      • Connector Module
      • Display Module
      • Docking Module
      • Door Module
      • Flight Control Module
      • Gas Tank Module
      • Gyroscope Module
      • Hinge Module
      • Landing Gear Module
      • Light Module
      • Flight Planning Module
      • Piston Module
      • Programmable Block Module
      • Rotor Module
      • Sensor Module
      • Sound Block Module
      • Thruster Module
      • Timer Block Module
    • Command Cheatsheet
    • Compatibility
    • Examples
  • Powered By Mother

Command Line Interface (CLI)

Mother's command line interface allows you to interact with your grid. We can pass in arguments to the script to perform different actions. The CLI is available in the programmable block terminal, and you can run it by hitting the Run button.

  • Anatomy of a Command
  • Running a Command
    • Targeting Blocks
  • Running Multiple Commands
    • Using the Terminal
    • Custom Commands and Routines
  • Delaying Command Execution
  • The Terminal Window
  • Running Commands Automatically
    • Programmable Block Terminal (Mother)
    • Cockpit/Control Station Toolbar
    • Button

Tips

See the Command Cheatsheet to get started!

Command Syntax

<Command> <Argument,> [Option,]

Multple commands together form a routine:

Terminal
# commmand - set a light color
light/color LandingLight red; 

# routine - set a light color and make it blink
light/color LandingLight red; light/blink LandingLight fast;

Running a Command

Anatomy of a Command

Commands are similar to a traditional command line interface, and consist of 3 terms:

Term TypeExampleDescription
Commandhinge/rotate
light/color
help
The command determines which action is performced by Mother. See the Command Cheetsheet for a complete list of commands, or run Mother with the help command.
ArgumentHinge
45
"Rotor 1"
#main-airlock
Arguments are expected by most commands and contain the details they require to operate. This is usually values like angle, color or a GPS waypoint. Use double quotes when your arguments include spaces. In most cases, the first argument of command will target a Block, Group, or Tag by its name.
Option--speed=2
--offset=0.1
--force
Options can be used with commands to trigger specific modifications like rotational speed or blink offset. Sometimes they may be used without a set value.

Running a Command

Let's start with an simple example, where a rotate a Hinge block:

Terminal
hinge/rotate Hinge 45;

We can see the hinge/rotate command targets the block named Hinge, and rotates it to 45 degrees. If we wanted to rotate the hinge at 2 RPM, we can add the speed option:

Terminal
hinge/rotate Hinge 45 --speed=2;

Targeting Blocks

By Block Name

You can target blocks by their name, via a terminal group, or using a tag. In our main airlock we have two lights. First we will target them specifically by name:

Terminal
light/color AirlockLightInner red;
light/color AirlockLightOuter red;

By Group Name

Using multiple block names is verbose, so let's create a group with these our blocks called AirlockLights. Now we can run the following command:

Terminal
light/color "Airlock Lights" red;

By Tag

As you add more connected ships to your grid, you will quickly notice that groups merge, and the terminal window becomes quite busy with block groups. Mother offers a 3rd way to select blocks using tags.

Terminal
light/color #airlock red;

You'll notice that we don't specify lights in the above command. This is because tags allow us to include multiple block types, and use the command to determine which block should be operated. Similar to above, we can close both airlock doors if we also use the tag #airlock:

Terminal
door/close #airlock;
Defining a Tag

Tags are defined within a block's Custom Data:

AirlockLightInner > Custom Data
[general]
tags=airlock,airlock-light

Running Multiple Commands

Using the Terminal

Sometimes it is useful to group commands in series to operate a system of blocks. A Routine is simply a group of commands separated by a semi-colon ;. The following example changes the color of our LandingLight, and also initates a blinking effect.

Terminal
light/color LandingLight red; light/blink LandingLight 0.5 --length=0.5;

The light will blink for 0.25s, every 0.5s (50% duty cycle).

Custom Commands and Routines

The command syntax can get verbose in the terminal, so it is recommended that you define routines in the Commands section of Mother's Custom Data. We can use a multi-line syntax to make it much more readable:

Mother > Custom Data
[Commands]

ActivateLandingLight=
| light/color LandingLight red;
| light/blink LandingLight 0.5 --length=0.5;

ExtendArm=piston/distance LandingArm 3;

Tips

The pipe character | is used to indicate a new line within Custom Data. This is not required in the Programmable Block terminal. This only allows us to organize our commands and routines across multiple lines within Custom Data.

Now we can run ActivateLandingLight in the terminal to execute the routine, or get clever and set it as an Action in an Event Controller, or a hook on a Sensor.

Terminal
ActivateLandingLight; ExtendArm;

Delaying Command Execution

Mother comes with a wait command that allow you to delays a command for execution in seconds.

Terminal
door/open AirlockDoor;
wait 10;
door/close AirlockDoor;

This works remotely as well:

Terminal
@StealthMissile fcs/start; wait 10; _Arm;

The Terminal Window

The terminal window act as the primary interface for Mother. You can run commands directly in the terminal, and you will receive immediate feedback from the script. The window also shows several indicators as relevant:

IndicatorDescription
#A number showing how many grids Mother is currently storing in the Almanac. Mother stores the position and status of other grids automatically as long as they are running Mother locally as well.
MShows a mechanical system is currently in motion and tracked by the Activity Monitor. Blocks like rotors, hinges and pistons will be monitored, and locked when finished to protect Space Engineers from the Almighty Clang.
CIndicates a communication is current in progress. Girds running Mother will frequently communicate to share information automatically.
QIndicates that a command is queued for future execution at a waypoint.
AIndicates that autopilot is currently enabled.
WIndicates that a command is currently waiting to be exeucuted at a later time via the wait command.

The terminal window

Running Commands Automatically

You can run commands via several methods:

  1. Programmable Block terminal
  2. Cockpit or Control Station toolbar action
  3. Button action
  4. Event Controller action
  5. Timer Block action

Programmable Block Terminal (Mother)

From within your Programmable Block terminal, you can run commands directly. This is the easiest way to interact with Mother and you will receive immediate feedback in the terminal window.

Open Programmable Block

Enter Command

Run Command

Cockpit/Control Station Toolbar

When you're flying a ship or sitting at a control station, you can add a button to your toolbar that will run a command when pressed. This is useful for quick actions like toggling lights or opening doors. To do this, assign the Programmable Block running Mother to the toolbar, and use the Run action. A window will appear asking you for an argument - type your command here and click Confirm. You can also set a short label for the button to make it easier to identify.

Open Toolbar

Select Run Action

Enter Command as Argument

Confirm Toolbar Command

Button

Like a toolbar, you can also assign a command to a button. This is useful for quick actions like toggling lights, or initiating a return-to-base procedure for a wandering grid. To do this, assign the Programmable Block running Mother to the button action, and use the Run action. A window will appear asking you for an argument - type your command here and click Confirm. You can also set a short label for the button.

Tips

Due to the way Space Engineers shows button actions to the player, we are unable to see which command the button runs. It is recommended to make your button positions intuitive, or to label them with a sign.

Open Button

Select Programmable Block

Select Button Action

Enter Command

Confirm Assignment

Label Button

Last Updated:: 4/7/25, 8:09 PM
Contributors: Luke Morrison
Prev
Installation
Next
Configuration