Connecting

Command Line Interface with rsconnect-python

Installing

Note

Publishing content to Posit Connect requires Python 3.7 or later.

Install the rsconnect-python command line interface in your project’s virtual environment using pip:

pip install rsconnect-python

Once rsconnect-python is installed, the rsconnect command line utility will be available in your python binaries directory. In many cases, it will be on your PATH and accessible by executing rsconnect on the command line.

Adding a Server

To add a server for deployment, you will need:

  1. Your server URL (--server/-s)
  2. Your API key (--api-key/-k). See the API Keys chapter.
  3. A nickname for the server that you provide (--name/-n)
rsconnect add \
    --server https://my.connect.server/ \
    --name myServer \
    --api-key $CONNECT_API_KEY

Once the server is added, rsconnect deploy commands can reference that server by using the -n or --name flag, followed by the nickname.