.. _command_line#command_line_interface:

Command Line Interface
----------------------

Synopsis
~~~~~~~~

**jetstream** [*options*] *subcommand* [*subcommand-options*]

Description
~~~~~~~~~~~
:program:`jetstream` is the main way to interact with the JetStream server. There are three sub commands:

  * :ref:`server <jetstream#server-options>` to start the JetStream server
  * :ref:`relay_server <jetstream#relay_server-options>` to start a relay server
  * :ref:`api <jetstream#api-options>` to interact with API

Options
~~~~~~~

.. program:: jetstream

.. option:: --version

    Print version information

.. _jetstream#server-options:

:program:`jetstream server`
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Options
^^^^^^^

.. program:: jetstream server

.. option:: --api-host arg

    TCP client API host address. If specified, bind API to listen on this address (overrides :option:`--api-allow-remote-control`).

.. option:: --api-port arg (=8886)

    TCP client API control port.

.. option:: --api-allow-remote-control

    Allow API connections from remote machines (can be overriden by api-host).

.. option:: --api-min-ssl-version arg (=TLS1.2)

    Minimum allowed SSL protocol (TLS1.3,TLS1.2,TLS1.1,TLS1.0).

.. option:: --api-ssl-cert arg

    Path to a file containing the SSL certificate to use for API connections. :option:`--api-ssl-cert-key` must also be specified.

.. option:: --api-ssl-cert-key arg

    Path to a file containing the SSL private key to use for API connections. :option:`--api-ssl-cert` must also be specified.

.. option:: --api-connect arg

    Actively create an API connection to the specified client.

.. option:: --api-disable-shared-tokens

    Disable the creation and use of tokens for anonymous downloads.

    .. seealso:: :doc:`/using_jetstream/shared_links`

.. option:: --api-disable-api-tokens

    Disable the creation and use of tokens for logon access.

    .. seealso:: :doc:`/using_jetstream/api_tokens`

.. option:: --max-cloud-cache-size arg (=4294967296)

    Maximum size, in bytes, of cloud file cache.

    .. seealso:: :doc:`/sandboxing/types/s3`

.. option:: --max-cloud-cache-download-size arg (=52428800)

    Maximum size, in bytes, of cloud file cache to use per download transfer.

    .. seealso:: :doc:`/sandboxing/types/s3`

.. option:: --max-cloud-cache-upload-size arg (=104857600)

    Maximum size, in bytes, of cloud file cache to use per upload transfer.

    .. seealso:: :doc:`/sandboxing/types/s3`

.. option:: --max-cloud-connections arg (=16)

    Maximum number of simultaneous connections to cloud storage.

.. option:: --cloud-cache-file arg

    A file to use for caching cloud requests. Must exist and be at least :option:`--max-cloud-cache-size` bytes big.

    .. seealso:: :doc:`/sandboxing/types/s3`

.. option:: --default-file-driver arg (=mem_map)

    Backend file driver. One of ``mem_map``, or ``raw``.

.. option:: --sandbox-dir arg

    Sandbox jetstream into path. %u token can be used for user name.

    .. seealso:: :doc:`/sandboxing/index`

.. option:: --trigger-dir arg

    Folder containing trigger scripts.

.. option:: --trigger-on-api arg

    Call trigger scripts for all API commands.

.. option:: --trigger-log arg

    Print additional debugging information about triggers and trigger output.

.. option:: --persistent-state-dir arg

    Folder to store persistent server state.

    .. note::
        Persistent state directory can't be shared between servers. Each running server will need its own independent persistent state directory.

.. option:: --persistent-destinations arg

    Load and save destinations (if :option:`--persistent-state-dir` is present).

.. option:: --persistent-transfers arg

    Load and save transfers (if :option:`--persistent-state-dir` is present). :option:`--persistent-destinations` is required.

.. option:: --send-host arg

    UDP sender host address. If specified, bind server to this address for outgoing connections.

.. option:: --recv-host arg

    UDP receiver host address. If specified, bind server to listen on this address.

.. option:: --recv-port arg (=8886) or (=8886 8887 8888 8889)

    UDP receiver port(s).

.. option:: --max-file-write-threads arg (=4)

    Maximum number of simultaneous file write threads.

    .. note::
        For the best performance, the number of file write threads should match the number of receiver ports specified.

.. option:: --recv-auth-required arg (=1)

    Auth is required to receive transfers (always true when the server is running as root).

.. option:: --recv-relay-host arg

    TCP relay host address. If specified, route Receiver traffic through this relay address.

.. option:: --recv-relay-port arg (=8887)

    TCP relay host control port.

.. option:: --recv-nat-traversal arg (=0)

    Uses UPnP and NAT-PMP to open UDP receiver port on the Internet Gateway Device.

.. option:: --recv-allow-discovery arg (=1)

    Server will respond to discovery requests on this network.

.. option:: --name arg

    Specify a name for this server.

    This can then be retrieved using the :meth:`~jetstream.serverinterface.ServerInterface.getServerInfo()` API call.

.. option:: --external-address arg

    Specify FQDN or IP address and port that will be used to create shared links (host:API-port)

    .. seealso:: :doc:`/using_jetstream/shared_links`

.. option:: --license-location arg

    Specify license server address (host:port).

.. option:: --license-password arg

    Specify license password.

    .. seealso:: :ref:`configuration#license-configuration`

.. option:: --superuser arg

    Specify a user name that will be recognized as a superuser (multi-use).

    .. seealso:: :doc:`/security/superuser`

.. option:: --supergroup arg

    Specify a group name whose members will be recognized as superusers (multi-use).

    .. seealso:: :doc:`/security/superuser`

.. option:: --incoming-rate-limit arg

    Cap on the incoming bandwidth in kilobits per second.

.. option:: --outgoing-rate-limit arg

    Cap on the outgoing bandwidth in kilobits per second.

.. option:: --borrow-incoming-rate

    Increase the outgoing rate limit by unused incoming rate.

.. option:: --borrow-outgoing-rate

    Increase the incoming rate limit by unused outgoing rate.

.. option:: --disable-port-multiplex

    Never reuse the same local port for multiple connections.

.. option:: --transfer-min-cipher arg (=none)

    Minimum allowed transfer cipher (none,unencrypted,encrypted128,encrypted256).

.. option:: --log arg

    Output all log data into the given file instead of standard out.

    .. seealso:: :doc:`/setup/logging`

.. option:: --log-file-creates

    Add a log entry for every received file.

.. option:: --log-level arg (=3)

    Change the verbosity of the log file.

    Available log levels are:

       * ``0``: Fatal errors only
       * ``1``: Errors
       * ``2``: Warnings
       * ``3``: Informational messages
       * ``4``: Security audit events
       * ``5``: Debug errors
       * ``6``: Debug information

.. option:: --disable-telemetry

    Disable collection of telemetry data.

.. option:: --response-file arg

    Response file that contains additional command-line arguments (alternately use '@file').


.. _jetstream#relay_server-options:

:program:`jetstream relay_server`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. seealso::
  :doc:`/using_jetstream/relay`

Options
^^^^^^^

.. program:: jetstream relay_server

.. option:: --control-port arg (=8887)

    TCP packet forwarding control port.

.. option:: --log arg

    Output all log data into the given file instead of standard out.

.. option:: --response-file arg

    Response file that contains additional command-line arguments (alternately use '@file').


.. _jetstream#api-options:

:program:`jetstream api`
~~~~~~~~~~~~~~~~~~~~~~~~

.. seealso::
  :doc:`jetstream-api:index`

Options
^^^^^^^

.. program:: jetstream api

.. option:: --host arg (=localhost)

    Address of JetStream server to control

.. option:: --api-control-port arg (=8886)

    Default API port

.. option:: --user arg

    User name for API authentication (cannot be used at the same time as token)

.. option:: --authToken arg

    Token for API authentication (cannot be used at the same time as user)

.. option:: --authTokenSession arg

    Token session for sharing transfers between instances of token authentication

.. option:: --superuser

     Run the API command as a superuser

.. option:: --no-auth

    Skip API authentication. If used, the :option:`--user`, :option:`--authToken`, :option:`--authTokenSession` and :option:`--superuser` options are ignored

