Stash files in FileStash.xyz from the command line
Project description
Stash CLI
Stash CLI is a command-line interface (CLI) tool for uploading and downloading files to and from the FileStash server. It simplifies file management by using file hashes for identification and retrieval. It supports both public and private uploads and downloads. The tool also includes an analysis feature that extracts information about an uploaded file.
This CLI is useful for developers and users who need a convenient way to store, share, and retrieve files securely.
Installation
Stash CLI requires Python 3.10 or later. We recommend managing your Python environment with pyenv or conda.
- Install
pipx: If you don't havepipxinstalled, usepip install pipx.pipxwill install Stash CLI into its own isolated environment, preventing dependency conflicts. - Install stash:
pipx install stash
Stash CLI will then be available in your system's PATH.
Usage
Uploading a File
stash up <file_path> [--server <server_url>] [--token <token>] [--analyze <boolean>]
file_path: Path to the file to upload (required).server: URL of the FileStash server. Defaults tohttp://localhost:8181/upload. The stash/constants.py file defines the base URL ashttp://localhost:8181. When using theupcommand,/uploadis appended. For the remote FileStash server, set it tohttps://filestash.xyz/upload.token: Authentication token (optional, but required for private uploads). If not provided, it uses theFILESTASH_TOKENenvironment variable. Set this variable in a.envfile or directly in your environment.analyze <boolean>: Analyze the contents of the file and describe it (default is True).
Downloading a File
stash down <hash> [--server <server_url>] [--token <token>] [--output-dir <output_directory>]
hash: Hash of the file to download (required).server: URL of the FileStash server. Defaults tohttp://localhost:8181/download. For the remote FileStash server, set it tohttps://filestash.xyz/download.token: Authentication token (optional, but required for private downloads). If not provided, it uses theFILESTASH_TOKENenvironment variable.output-dir: Directory to save the downloaded file (optional; defaults to the current directory).
Listing Files
stash list [--server <server_url>] [--token <token>] [--limit <integer>] [--filter-by <string>]
server: URL of the FileStash server. Defaults tohttp://localhost:8181/list. For the remote FileStash server, set it tohttps://filestash.xyz/list.token: Authentication token (optional but recommended). If not provided, it uses theFILESTASH_TOKENenvironment variable. The token increases the number of files that can be listed.limit: Maximum number of files to list (optional; defaults to 50).filter_by: Filter the files by a string pattern (optional).
Version
stash version
Displays the installed version of Stash CLI.
Development
Stash CLI uses poetry for dependency management.
- Install Poetry:
pipx install poetry(recommended) - Clone the Repository:
git clone https://github.com/ogre-run/stash-cli.git - Navigate to Project:
cd stash-cli - Install Dependencies:
poetry install - Activate Virtual Environment:
poetry shell
You can now run the CLI from within the virtual environment with stash <command>.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file filestash-0.1.0.tar.gz.
File metadata
- Download URL: filestash-0.1.0.tar.gz
- Upload date:
- Size: 27.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e80d3aa1571e1c4309ae3827c64cf7de53906d9d4c5deb7f3071ea678fb12dcd
|
|
| MD5 |
978a84e460fb65e3b63883992c47182a
|
|
| BLAKE2b-256 |
0fcc729459c6152432d84d48ac7ba50f926ff5965bb5b9bc1080e1996968bcde
|
File details
Details for the file filestash-0.1.0-py3-none-any.whl.
File metadata
- Download URL: filestash-0.1.0-py3-none-any.whl
- Upload date:
- Size: 29.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
627edac25a23fd897b42aaa21a65085d26852b93cecc631de75d574b83d735c5
|
|
| MD5 |
6e7dfbc7a46735afec97d26a315f5ac6
|
|
| BLAKE2b-256 |
014d767feb46655358535b2a6f1b593d09be932d9a64d0c5520fc2b422c99209
|