How to auto-launch the agent
If you need the agent to be launched automatically every time you restart your device, run the scripts below.
The agent needs a display in order to work. If your system doesn’t have one, use a virtual display. Example:
xvfb-run mlx
Windows
import os
import subprocess
def connect_agent():
username = os.getlogin()
exe_path = f'C:\\Users\\USERNAME\\AppData\\Local\\MLX\\agent.exe'
agent_connection = subprocess.run([exe_path])
assert agent_connection.returncode == 0
if agent_connection.returncode == 0:
print("Agent connected")
else:
print(f"Failed to connect agent. Error {agent_connection.returncode}")
if __name__ == "__main__":
connect_agent()
macOS
import subprocess
def connect_agent():
agent_connection = subprocess.Popen(['open', '/Applications/Multilogin X.app/'])
agent_connection.wait()
return_code = agent_connection.returncode
if return_code == 0:
print("Agent connected")
else:
print(f"Failed to connect agent. Error {return_code}")
connect_agent()
Linux
You can start the agent by calling:
/opt/mlx/agent.bin
Or simply:
mlx