XenServer Administrator's Guide 4.1.0

Command line interface
48
Shorthand syntax is also available for remote connection arguments:
-u username
-pw password
-pwf password file
-p port
-s server
Example: On a remote XenServer Host:
xe vm-list -u myuser -pw mypassword -s hostname
Arguments are also taken from the environment variable XE_EXTRA_ARGS, in the form of comma-separated
key/value pairs. For example, in order to enter commands on one XenServer Host that are run on a remote
XenServer Host, you could do the following:
export XE_EXTRA_ARGS="server=jeffbeck,port=443,username=root,password=pass"
and thereafter you would not need to specify the remote XenServer Host parameters in each xe command
you execute.
Using the XE_EXTRA_ARGS environment variable also enables tab completion of xe commands when issued
against a remote XenServer Host, which is disabled by default.
5.2. Special characters and syntax
To specify argument/value pairs on the xe command line, write
argument=value
without quotes, as long as value doesn't have any spaces in it. There should be no whitespace in between
the argument name, the equals sign (=), and the value. Any argument not conforming to this format will
be ignored.
For values containing spaces, write:
argument="value with spaces"
If you use the CLI while logged into a XenServer Host, commands have a tab completion feature similar to
that in the standard Linux bash shell. If you type, for example
xe vm-l
and then press the TAB key, the rest of the command will be displayed when it is unambiguous. If more
than one command begins with vm-l, hitting TAB a second time will list the possibilities. This is particularly
useful when specifying object UUIDs in commands.
Note
When executing commands on a remote XenServer Host, tab completion does not normally
work. However if you put the server, username, and password in an environment variable called
XE_EXTRA_ARGS on the machine from which you are entering the commands, tab completion is
enabled. See Section 5.1, “Basic xe syntax” for details.