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

Built distribution (wheel)

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

Total release size: 12.0 kB

Release files / cf_share_file-0.3.0.tar.gz

Download URL cf_share_file-0.3.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f0f0c8892c1d7fd239788e77b73137cda891305375ca08e5f4d31a837948b039
BLAKE2b-256 checksum
How to use checksums
5259a34fd39b6f8296b6b3bc2511d4260f6bf41026d2798b84bee450efeb4ac8
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.3.0-py3-none-any.whl

Download URL cf_share_file-0.3.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c6b0c4137da789927ddd36dd9248d5a2e2be4e50ca4b137bd37f4af710c3012
BLAKE2b-256 checksum
How to use checksums
b9c640287c06bbbf09a80378c96c6ba7c2e55c91665d2ad92f15833ae276e35a
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.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.

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