@@ -27,18 +27,16 @@ pip install git+https://github.com/posit-dev/rsconnect-python.git
2727
2828### Using the rsconnect CLI
2929
30- Here's an example command that deploys a Jupyter notebook to Posit Connect.
30+ Log in to Posit Connect, then deploy a Jupyter notebook:
3131
3232``` bash
33- rsconnect deploy notebook \
34- --server https://connect.example.org \
35- --api-key my-api-key \
36- my-notebook.ipynb
33+ rsconnect login https://connect.example.org
34+ rsconnect deploy notebook my-notebook.ipynb
3735```
3836
3937> ** Note**
4038> The examples here use long command line options, but there are short
41- > options ( ` -s ` , ` -k ` , etc.) available also. Run ` rsconnect deploy notebook --help `
39+ > options available also. Run ` rsconnect deploy notebook --help `
4240> for details.
4341
4442### Setting up ` rsconnect ` CLI auto-completion
@@ -75,48 +73,55 @@ compinit
7573
7674### Managing Server Information
7775
78- The information used by the ` rsconnect ` command to communicate with a Posit Connect
79- server can be tedious to repeat on every command. To help, the CLI supports the idea
80- of saving this information, making it usable by a simple nickname.
81-
82- > ** Warning**
83- > One item of information saved is the API key used to authenticate with
84- > Posit Connect. Although the file where this information is saved is marked as
85- > accessible by the owner only, it's important to remember that the key is present
86- > in the file as plain text so care must be taken to prevent any unauthorized access
87- > to the server information file.
76+ The CLI can save Posit Connect server information under a nickname, so you don't
77+ need to repeat it on every command.
8878
8979#### Remembering Server Information
9080
91- Use the ` add ` command to store information about a Posit Connect server:
81+ Use ` login ` to authenticate and save a server:
9282
9383``` bash
94- rsconnect add \
95- --api-key my-api-key \
96- --server https://connect.example.org \
97- --name myserver
84+ rsconnect login https://connect.example.org
9885```
9986
100- > ** Note**
101- > The ` rsconnect ` CLI will verify that the serve URL and API key
102- > are valid. If either is found not to be, no information will be saved.
87+ Browser login requires Posit Connect 2026.02.0 or later. In Posit Workbench,
88+ remote containers, or other sessions where the browser cannot reach the CLI's
89+ local callback, use ` --use-device-code ` ; this requires Connect 2026.06.0 or later.
90+ The ` --no-wait ` device flow also requires Connect 2026.06.0 or later.
10391
104- If any of the access information for the server changes, simply rerun the
105- ` add ` command with the new information and it will replace the original
106- information.
92+ For automation, ` --identity-token ` and ` --identity-token-file ` require Connect
93+ 2026.08.0 or later, or Connect 2026.02.0 or later with identity federation.
10794
108- Once the server's information is saved, you can refer to it by its nickname:
95+ Login sets the server as the default unless ` --no-set-default ` is supplied.
96+ Later commands can use that default:
10997
11098``` bash
111- rsconnect deploy notebook --name myserver my-notebook.ipynb
99+ rsconnect deploy notebook my-notebook.ipynb
112100```
113101
114- If there is information for only one server saved, this will work too:
102+ See the [ ` login ` ] ( commands/login.md ) , [ ` logout ` ] ( commands/logout.md ) , and
103+ [ ` token ` ] ( commands/token.md ) references for more options.
104+
105+ As an alternative for servers older than Connect 2026.02.0 or automation that
106+ cannot use identity tokens, [ create an API key] ( https://docs.posit.co/connect/user/api-keys/ )
107+ and save it with ` add ` :
115108
116109``` bash
117- rsconnect deploy notebook my-notebook.ipynb
110+ rsconnect add \
111+ --server https://connect.example.org \
112+ --api-key my-api-key \
113+ --name myserver
118114```
119115
116+ You can also pass ` --api-key ` or set ` CONNECT_API_KEY ` on individual commands.
117+ The CLI verifies the server URL and API key before saving them.
118+
119+ > ** Warning**
120+ > Saved API keys are stored as plain text in the server information file.
121+ > The file is accessible only by its owner; protect it from unauthorized access.
122+ > See [ Stored Information Files] ( deploying.md#stored-information-files ) for
123+ > OAuth token storage.
124+
120125#### Listing Server Information
121126
122127You can see the list of saved server information with:
0 commit comments