Skip to main content

posit-cli

A friendly command-line interface for Posit products, in the spirit of gh.

$ posit connect login https://connect.example.com             # OAuth, tokens in your OS keyring
$ posit connect api v1/user -q .username                      # gh-api-style raw request
$ posit connect deploy streamlit ./my-app                     # everything rsconnect can do

This project is in early-stage development and so far only supports Posit Connect's APIs.

Installation

Install posit-cli from PyPI with uv:

uv tool install posit-cli

To get unreleased changes, install from GitHub instead:

uv tool install git+https://github.com/posit-dev/posit-cli.git

If you authenticate to GitHub over SSH, use the git+ssh:// form (uv requires the git@ username):

uv tool install git+ssh://git@github.com/posit-dev/posit-cli.git

Each of these puts the posit executable on your PATH. To upgrade later, run uv tool upgrade posit-cli. See uv's Git authentication docs for tokens and other hosts.

Connect on Snowflake

To deploy to Posit Connect on Snowflake, install the Snowflake extra instead:

uv tool install 'posit-cli[snowflake]'
# or: pip install 'posit-cli[snowflake]'

This includes the Snowflake CLI. Before deploying, configure a Snowflake CLI connection with access to your Connect instance and authenticator set to snowflake_jwt (key-pair authentication) or oauth. Select it with --snowflake-connection-name when adding the Connect server with posit connect add; see posit connect add --help for options.

Getting started

1. Log in. Point posit at your Connect server and authenticate. This runs an OAuth 2.1 flow in your browser and saves the tokens in your OS keyring, so you only do it once per server:

$ posit connect login https://connect.example.com

2. Try a request. Confirm you're connected by asking Connect who you are:

$ posit connect api v1/user -q .username

3. Deploy something. Anything rsconnect can deploy, posit can too:

$ posit connect deploy streamlit ./my-app

That's it — from here, explore posit connect --help for the full command set.

Authentication

posit connect login runs an OAuth 2.1 flow and stores tokens in your OS keyring; posit connect api and the deploy commands reuse those credentials automatically (including token refresh). You can also point at a server ad hoc with --server/CONNECT_SERVER and --api-key/CONNECT_API_KEY.

Other tools, such as the Connect SDKs or curl, can use the same login through posit connect token, which prints the stored access token:

$ curl -H "Authorization: Bearer $(posit connect token)" https://connect.example.com/__api__/v1/user

If the server rejects the token, run posit connect token --refresh to get a new one. --format json prints machine-readable output. Exit status 4 means there are no usable credentials and you need to run posit connect login again.

posit connect api

A gh api-style raw REST client, authenticated with your saved credentials. PATH is relative to the Connect API root (the /__api__ prefix is added for you):

$ posit connect api v1/user                          # GET, pretty-printed JSON
$ posit connect api v1/user -q .username             # filter with a jq expression
$ posit connect api "v1/content?limit=3" -q '.[].name'

-q/--jq runs the response through jq, like gh api --jq: string results print unquoted, one per line.

-i/--include prepends the HTTP status line and response headers to the output (handy for inspecting rate limits, request IDs, or the server version):

$ posit connect api v1/user -i

--paginate (GET only) follows Connect's pagination and prints all pages' results combined. It handles both of Connect's pagination styles — the cursor style (e.g. v1/audit_logs) and the page-number style (e.g. v1/users, v1/groups) — and leaves unpaginated endpoints unchanged:

$ posit connect api v1/users --paginate -q 'length'   # count every user

PATH may also be a full URL on the configured server — convenient for pasting a paging.next link straight back in. A URL for a different host is rejected.

Query parameters vs. request body

Like gh api, -f/-F fields default to a POST request body (adding any field flips the method to POST unless you pass -X). To send query parameters on a read, put them in the path or force GET:

$ posit connect api "v1/users?page_size=5"   # query params in the path
$ posit connect api v1/users -X GET -f page_size=5          # or force GET
$ posit connect api v1/content -f name=my-app              # POST body (creates content)

posit connect version

Print the Connect server version using your saved credentials:

$ posit connect version
$ posit connect version --name production
$ posit connect version --server https://connect.example.com --api-key "$CONNECT_API_KEY"

The command supports -n/--name, -s/--server, -k/--api-key, --no-tls-verify, and -c/--cacert, with the same connection environment variables as posit connect api. It prints an empty line if the server hides its version. Rsconnect's CONNECT_SERVER_VERSION environment variable overrides the reported version.

posit connect *

posit wraps rsconnect-python: it re-exposes the full rsconnect command set under posit connect, in addition to the api utility. The version command is overridden to report the Connect server version.

Using posit with Claude Code

This repo ships a skill (at skills/posit-cli/) that teaches coding agents to drive posit — auth, posit connect api, and deploys. Install it with the skills CLI:

npx skills add posit-dev/posit-cli

Metadata

Release files for posit-cli 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for posit-cli 0.3.0
File Size Uploaded Provenance Actions
posit_cli-0.3.0.tar.gz 106.5 kB With provenance Details for posit_cli-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for posit-cli 0.3.0
File Interpreter ABI Platform Actions
posit_cli-0.3.0-py3-none-any.whl Python 3 none any Details for posit_cli-0.3.0-py3-none-any.whl

Total release size: 121.6 kB

Release files / posit_cli-0.3.0.tar.gz

Download URL posit_cli-0.3.0.tar.gz
Size 106.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d0cf9ce1b0556c05f2028b58908922ef51cb2cea7f6b58d458409aaadec0fed9
BLAKE2b-256 checksum
How to use checksums
279045a42ac39d653d50642abb90753a4d73128e2ddc5c5c0a9c94e19dc4f123
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / posit_cli-0.3.0-py3-none-any.whl

Download URL posit_cli-0.3.0-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c86fef8b27be570dea7baf5fdb96a581f926d79d88ae66a16295836cf5105a34
BLAKE2b-256 checksum
How to use checksums
09f8f057f7db3f4b3ef22bb22c5bfd22b25f3791b733443ed7d737fa3cfa911f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for posit-cli 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for posit_cli-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page