How are Replicated commands added to a server?

For instance, there’s a file /etc/replicated.alias - how is it generated?

The /etc/replicated.alias file is used for application admin commands. The replicated install script creates it and adds the opening comment # THIS FILE IS GENERATED BY REPLICATED. DO NOT EDIT!. The install script also adds this alias file to /etc/bashrc or /etc/bash.bashrc. At app install time, Replicated then modifies this file to add all of you app’s admin commands to the file.

The replicated and replicatedctl commands work differently, though. Those are shell scripts created by the replicated install script that are located within /usr/local/bin/ and act to pass commands through to the replicated container.