Skip to main content

cf-share-file

Share one file over the internet using a Cloudflare quick tunnel. The command starts a local HTTP server, launches cloudflared, and prints the public file URL to standard output. Press Ctrl+C to stop sharing.

Installation

Requires Python 3.10 or newer and the standalone cloudflared executable on your PATH. Installing this package does not install cloudflared.

uvx cf-share-file --help

Requires uv. uvx downloads the package and runs it in an isolated environment. For a persistent command, use uv tool install cf-share-file.

Usage

uvx cf-share-file ./report.pdf
uvx cf-share-file ./report.pdf --auth 'alice:change-this-password'
uvx cf-share-file --help

With a persistent installation, you can run cf-share-file directly. The local server listens on 127.0.0.1; the port is always chosen automatically. Only the selected file path is served. GET and HEAD are supported. Logs go to standard error; the public URL goes to standard output.

The package includes qrcode and displays a terminal QR code for the public file URL on standard error. Scan it to open the file on another device. With --auth, the browser still requires credentials; they are not in the QR code.

You can also run the downloaded script without any Python dependencies:

python3 cf_share_file.py ./report.pdf

If qrcode is not installed, the script prints the URL and skips the QR code. The external cloudflared executable is still required in both modes.

Without --auth, anyone who knows the public URL can download the file. With --auth, requests require HTTP Basic authentication. Command-line credentials may be visible in shell history or process listings. The temporary tunnel depends on Cloudflare's service. The URL may need a few seconds before it becomes reachable.

Development

uv run python -m unittest discover -s tests -v
uvx --from build pyproject-build
uvx twine check --strict dist/*

Publishing

The current version is 0.2.0. Build from a clean checkout using the commands above, ensuring dist/ contains only the current release. Upload to TestPyPI:

uvx twine upload --repository testpypi dist/*

Verify the TestPyPI release in an isolated environment:

uvx --isolated --index https://test.pypi.org/simple/ --default-index https://pypi.org/simple/ cf-share-file@0.2.0 --help

Then upload the same artifacts to PyPI:

uvx twine upload dist/*

Use an API token when Twine prompts for credentials. Never commit credentials. For subsequent releases, update the version in pyproject.toml and build fresh artifacts; PyPI does not allow replacing an existing release file. GitHub Actions runs tests and validates distributions; publishing is manual.

License

MIT; see LICENSE.

Metadata

Release files for cf-share-file 0.2.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 cf-share-file 0.2.0
File Size Uploaded Provenance Actions
cf_share_file-0.2.0.tar.gz 6.2 kB Without provenance Details for cf_share_file-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cf-share-file 0.2.0
File Interpreter ABI Platform Actions
cf_share_file-0.2.0-py3-none-any.whl Python 3 none any Details for cf_share_file-0.2.0-py3-none-any.whl

Total release size: 12.1 kB

Release files / cf_share_file-0.2.0.tar.gz

Download URL cf_share_file-0.2.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c905704bb0459e3007ab3186675e45827c470dd01d60f7bc845cc36e38a25f86
BLAKE2b-256 checksum
How to use checksums
e67128626edda269ba8880182151578618ec662eee672f5a2184851140d7e3a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / cf_share_file-0.2.0-py3-none-any.whl

Download URL cf_share_file-0.2.0-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b286ad8d3a1a938571dbd92f424d6a97f4d6fc8a9eea9aa1875042079b22dc5
BLAKE2b-256 checksum
How to use checksums
8b33a504d3c7aa24c9039d220ac398caf1ba019a9770a1aca2bcf653b38f0e30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for cf-share-file 0.2.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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