Skip to main content

cloudsh

A Python CLI that wraps common Linux commands for both local and cloud files using panpath.

Pypi Github PythonVers Building Codacy coverage

Cloud Storage Provider dependencies:

gcloud-aio-storage
aioboto3
azure-storage-blob

Installation

pip install -U cloudsh

# Install for different cloud storage providers
pip install -U cloudsh[gcs]  # Google Cloud Storage
pip install -U cloudsh[aws]  # Amazon S3
pip install -U cloudsh[azure]  # Azure Blob Storage

# Install for all cloud storage providers
pip install -U cloudsh[all]

Usage

cloudsh provides common Linux commands that work with both local and cloud files. Currently supported commands include:

  • cat: Concatenate and print files
  • cp: Copy files and directories
  • head: Output the first part of files
  • less: Display file contents with forward and backward navigation
  • ls: List directory contents
  • mkdir: Make directories
  • more: Display file contents page by page
  • mv: Move files and directories
  • rm: Remove files and directories
  • tail: Output the last part of files
  • touch: Create empty files

And two additional commands:

  • complete: Generate shell completion scripts
  • sink: Redirect output to a file

Authentication

See https://github.com/pwwang/panpath for cloud backend configuration (ADC / GOOGLE_APPLICATION_CREDENTIALS for GCS, AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY for S3, and AZURE_STORAGE_CONNECTION_STRING for Azure).

The commands works on local files as the GNU/Linux commands do

$ cloudsh ls /tmp
$ cloudsh cp /tmp/file.txt /tmp/file2.txt

The commands works on cloud files

$ cloudsh ls gs://my-bucket
$ cloudsh touch gs://my-bucket/file.txt

The commands works between local and cloud files

$ cloudsh cp /tmp/file.txt gs://my-bucket/file.txt
$ cloudsh mv gs://my-bucket/file.txt /tmp/file.txt

The sink command redirects output to a file

# It is easy to redirect output to a local file
$ echo "Hello, World!" > /tmp/hello.txt
# But it is not so easy to redirect output to a cloud file, so we use `sink`
$ echo "Hello, World!" | cloudsh sink gs://my-bucket/hello.txt
# Append to a cloud file
$ echo "Hello, World!" | cloudsh sink -a gs://my-bucket/hello.txt

Drop-in Replacement for GNU/Linux Commands

Since the commands work on local files as well, you can make aliases to use cloudsh as a drop-in replacement for the GNU/Linux commands.

alias cat='cloudsh cat'
alias cp='cloudsh cp'
alias head='cloudsh head'
alias ls='cloudsh ls'
alias mkdir='cloudsh mkdir'
alias mv='cloudsh mv'
alias rm='cloudsh rm'
alias tail='cloudsh tail'
alias touch='cloudsh touch'

What if I want to use the original GNU/Linux commands?

# alias ls='cloudsh ls'
ls -- -l  # actually executes `/usr/bin/ls -l`

Shell Completion

Generating Shell Completion Scripts

cloudsh provides shell completion support, including the subcommands, options and both local and cloud paths, for bash, zsh and fish. To enable it:

# For bash
mkdir -p ~/.local/share/bash-completion
cloudsh complete --shell bash > ~/.local/share/bash-completion/cloudsh
activate-global-python-argcomplete --user
# Restart your shell
# For zsh
# Create the completions directory
mkdir -p ~/.zsh/completions

# Generate the Zsh script
cloudsh complete --shell zsh > ~/.zsh/completions/_cloudsh

# Update ~/.zshrc
echo 'fpath=(~/.zsh/completions $fpath)' >> ~/.zshrc
echo 'autoload -Uz compinit && compinit' >> ~/.zshrc

# Restart your shell
# For fish
cloudsh complete --shell fish > ~/.config/fish/completions/cloudsh.fish

Because of the latency when completing cloud paths, a message 'fetching ...' will be shown when completing cloud paths. export CLOUDSH_COMPLETE_NO_FETCHING_INDICATOR=1 to disable it.

Using a caching file for the completion to avoid latency when completing cloud paths

# Only cache the paths at depth 2 in the bucket
cloudsh complete --update-cache --depth 2 gs://my-bucket

Metadata

Release files for cloudsh 0.3.12

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

Source distribution (sdist)

Source distribution for cloudsh 0.3.12
File Size Uploaded Provenance Actions
cloudsh-0.3.12.tar.gz 43.4 kB Without provenance Details for cloudsh-0.3.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cloudsh 0.3.12
File Interpreter ABI Platform Actions
cloudsh-0.3.12-py3-none-any.whl Python 3 none any Details for cloudsh-0.3.12-py3-none-any.whl

Total release size: 94.7 kB

Release files / cloudsh-0.3.12.tar.gz

Download URL cloudsh-0.3.12.tar.gz
Size 43.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e5a500c193c78c61fec313ce583cbce7071b0864bdb643f15a76fe10f0ac5cc4
BLAKE2b-256 checksum
How to use checksums
2ccc2dfb4cd1be5434f11633fea7fe75a932952cdca030819b46207e31a1193f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cloudsh-0.3.12-py3-none-any.whl

Download URL cloudsh-0.3.12-py3-none-any.whl
Size 51.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f1b9ba5b95cbe358c6b73b81eae1d4d3bcfdacf933337393b6b75c2134155a66
BLAKE2b-256 checksum
How to use checksums
ff3f9faa6a96b97bebec335998ab0634968f3c10dfd63d82154ceb4bb8118380
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for cloudsh 0.3.12

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