CLI Commands
Version 1.0.0-beta 1
CLI Commands
OrpheAgent provides a set of CLI commands to manage and operate the agent. Below are the available commands and their functionalities:
Start the Agent
Use the up
command to start the OrpheAgent:
orphe-agent up
Options:
-d
or--debug
: Enable debug mode to provide detailed logs for troubleshooting.-f
or--foreground
: Run the agent in the foreground mode instead of as a daemon.-s
or--snat
: Enable experimental Data Plane SNAT support (EXPERIMENTAL: may cause unexpected behavior)
Stop the Agent
Use the down
command to stop the OrpheAgent:
orphe-agent down
This command stops the agent and cleans up related resources.
Enabling SNAT Support via systemd
To enable experimental Data Plane SNAT support when running OrpheAgent as a systemd service:
- Edit the service file
/etc/systemd/system/orphe-agent.service
and change theExecStart
line from:
to:ExecStart=/usr/bin/orphe-agent up -f
ExecStart=/usr/bin/orphe-agent up -f -s
- Reload the systemd daemon and restart the service:
sudo systemctl daemon-reload sudo systemctl restart orphe-agent
Note : Enabling SNAT is experimental and may cause unexpected behavior.
Each option in Configuration Management can be configured individually. Please note that any changes to an option will only take effect after performing the save action. Use the config
command to manage configurations:
orphe-agent config
Supported actions:
save
: Save the current configuration to the default configuration file.clean
: Clear the configuration and restore default values.show
: Display the current configuration in a readable format.
Options:
-p
or--provision-key
: Specify the provision key (e.g.,12D3KooWS
).-n
or--host-name
: Set the host name (e.g.,orphe-agent
).-h
or--mgmt-port-http
: Set the HTTP management port (default:0
).-s
or--mgmt-port-https
: Set the HTTPS management port (default:0
).-c
or--control-plane-tun-port
: Set the control plane tunnel port (default:0
).-d
or--dataplane-tun-port
: Set the data plane tunnel port (default:0
).
Use 0 to let the system assign a random port.
Control Plane P2P Management
The control-plane-p2p
command allows you to configure advanced P2P mechanism for the control plane, such as DHT, Relay, UDP Hole Punch, and MDNS.
Usage:
orphe-agent control-plane-p2p [flags]
Supported actions:
save
: Save the current P2P settings.show
: Display the current P2P configuration.clean
: Reset P2P configuration to default values.
Flags:
-d
,--dht
: Enable or disable DHT discovery (true
orfalse
).-r
,--relay
: Enable or disable Relay transport (true
orfalse
).-u
,--udp-hole-punch
: Enable or disable UDP Hole Punch (true
orfalse
).-m
,--mdns
: Enable or disable MDNS discovery (true
orfalse
).
Only
true
orfalse
(case-insensitive) are accepted for each flag.
Examples:
- Show current P2P settings:
orphe-agent control-plane-p2p show
- Enable DHT and Relay, disable UDP Hole Punch and MDNS:
orphe-agent control-plane-p2p save --dht true --relay true --udp-hole-punch false --mdns false
- Reset P2P configuration to default:
orphe-agent control-plane-p2p clean
Run the system-check
command to perform a system compatibility check for OrpheAgent:
orphe-agent system-check
This command verifies whether the system supports the required features for the agent to function correctly.
Use the status
command to check the status of OrpheAgent:
orphe-agent status
Options:
-d
or--dp-link-status
: Show the status of the links in data plane.-c
or--cp-link-status
: Show the status of the link in control plane.
This command retrieves and displays detailed status information for the link between OrpheAgents or between OrpheAgent and OrpheLink, including metrics such as latency, jitter, and data rate.
Help Command
Use the help
command to get help with a specific subcommand:
orphe-agent help
This command displays detailed usage information and available options for the specified subcommand. For example, to get help for the up
command:
orphe-agent help up
Version Command
Use the version
command to print the current version of the OrpheAgent CLI:
orphe-agent version
This command outputs the version information of the installed OrpheAgent binary, which is useful for troubleshooting and verifying deployments.
Command Details
up
/u
: Initializes necessary network and system resources and starts the agent. Now supports the-s
/--snat
flag to enable experimental SNAT support.
Warning: Enabling SNAT is experimental and may cause unexpected behavior in some environments.down
/d
: Stops the agent and cleans up resources.config
/c
: Provides options to save, clean, or display configurations. It also allows setting specific parameters such as ports and host names.system-check
/sc
: Performs a diagnostic check to ensure system compatibility and provides feedback on any issues.status
/s
: Displays the current status of OrpheAgent, including both the links status between OrpheAgents and the link status between OrpheAgent and OrpheLink.help
/h
: Displays detailed usage information and available options for a specific subcommand.version
/v
: Prints the currently installed OrpheAgent CLI version information, useful for troubleshooting and version verification.control-plane-p2p
/cp-p2p
: Configure advanced P2P transport options for the control plane, including DHT, Relay, UDP Hole Punch, and MDNS. Supports actions:save
,show
,clean
and flags for each mechanism.
For additional help, refer to the project documentation or use orphe-agent help
to view detailed command descriptions.