Skip to main content

rtd: simple Readthedocs CLI

Install

pip install rtd-cli
# Set this env var, or write the token to ~/.config/rtd-cli/token
 RTD_TOKEN=your_token

Usage

rtd --help
# Usage: rtd [OPTIONS] COMMAND [ARGS]...
#
#   Simple CLI wrapper for the Readthedocs REST API.
#
# Options:
#   --help  Show this message and exit.
#
# Commands:
#   api         Make a request to the Readthedocs REST API.
#   build       Trigger a build for a project version.
#   deactivate  Deactivate one or more versions
#   hide        Hide one or more versions
#   logs        Get build logs for a specific build ID.
#   open        Open project page in browser.

rtd api --help
# Usage: rtd api [OPTIONS] ENDPOINT
#
#   Make a request to the Readthedocs REST API.
#
#   RTD API docs: https://docs.readthedocs.io/en/stable/api/v3.html
#
# Options:
#   -b, --body TEXT                 JSON string to send in the body of a PATCH/POST request;
#                                   if absent, a GET request is sent
#   -m, --method [GET|POST|PATCH]   HTTP method to use; defaults to GET if no body,
#                                   PATCH if body provided
#   -u, --show-updated              After a PATCH/POST request (with -b/--body), send a GET
#                                   to the same endpoint, to verify the updated state of the
#                                   resource
#   --help                          Show this message and exit.

rtd build --help
# Usage: rtd build [OPTIONS] PROJECT
#
#   Trigger a build for a project version.
#
# Options:
#   -v, --version TEXT  Version slug (default: latest)
#   --help              Show this message and exit.

rtd logs --help
# Usage: rtd logs BUILD_ID
#
#   Get build logs for a specific build ID.

rtd open --help
# Usage: rtd open [OPTIONS] PROJECT
#
#   Open project page in browser.
#
# Options:
#   -b, --build TEXT  Open specific build page
#   -d, --docs        Open docs site (not dashboard)
#   --help            Show this message and exit.

Examples

List projects:

rtd api projects
# {
#   "count": …,
#   "next": null,
#   "previous": null,
#   "results": [
#     …
#   ]
# }

Trigger a build:

rtd build your_project
# or specify a version
rtd build your_project -v stable

View build logs:

rtd logs 30253885

Open project pages in browser:

rtd open levanter                    # Opens builds page
rtd open levanter -b 30253885        # Opens specific build
rtd open levanter -d                 # Opens docs site

Update project default branch:

rtd api projects/your_project/ -b '{"default_branch": "main"}' -u

Sync versions from repository:

rtd api projects/your_project/sync-versions/ -m POST

Hide all versions except for a specific list:

project=your_project
keep=(latest 1.11.)  # grep patterns to keep
limit=100

# Exclude `keep` patterns above, when calling `rtd hide` below
grep_args=(-v)
for v in "${keep[@]}"; do
  grep_args+=(-e "$v")
done

rtd api "projects/$project/versions?limit=$limit&active=true&built=true" \
| jq -r '.results[] | select(.hidden | not) | .slug' \
| grep "${grep_args[@]}" \
| xargs rtd hide -p $p

Metadata

Release files for rtd-cli 0.1.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 rtd-cli 0.1.0
File Size Uploaded
rtd_cli-0.1.0.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rtd-cli 0.1.0
File Interpreter ABI Platform
rtd_cli-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.9 kB

Release files / rtd_cli-0.1.0.tar.gz

Download URL rtd_cli-0.1.0.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bcf56661278f1dbef01062bb4891e4f4ba6ebad669985b338a161984d108aef4
BLAKE2b-256 checksum
How to use checksums
2061f4ff21cf941647e88290fc02a2a0966e3c158b5d922800bc1e5a6ccfa2b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 9, 2025.

Transparency log

Release files / rtd_cli-0.1.0-py3-none-any.whl

Download URL rtd_cli-0.1.0-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8b2b409ef6519ee7598e132f87a2fa16e79b28d78461b5d3233cbc1bcb7f4bc
BLAKE2b-256 checksum
How to use checksums
c3f840c092c1f01d1bf2f39c6683ff24d0443699e6038b85026fc07b38a763e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 9, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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