Stash files in FileStash.xyz from the command line
Project description
Stash CLI
Stash CLI is a command-line interface (CLI) tool built with Python for interacting with the FileStash server (https://filestash.xyz). It simplifies file management by using content hashes to manage uploads, downloads, analysis and listing of files. It supports both public and private file uploads. The tool also includes an analysis feature, enabling informative descriptions about uploaded files.
This CLI is designed to be a convenient tool for developers and users who need a way to store, share, and retrieve files securely and efficiently. The server component is built as a proxy in front of a cloud storage bucket, with added functionalities.
Installation
Stash CLI requires Python 3.10 or later and the pipx package manager. We recommend using pipx to manage your Python installations, which can help prevent dependency conflicts.
-
Install or upgrade
pipx:pip install --user pipx python3 -m pipx ensurepath
-
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 tohttps://filestash.xyz/upload. For local development against a local instance of the server, set it tohttp://localhost:8181/upload(seeconstants.pyfor server defaults if running a local instance).--token: Authentication token (optional, required for private uploads). If not provided, it uses theFILESTASH_TOKENenvironment variable. Set this variable in a.envfile or directly in your environment. SetFILESTASH_TOKEN = <YOUR_TOKEN>.--analyze: 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 tohttps://filestash.xyz/download. For local development against a local instance of the server, set it tohttp://localhost:8181/download.--token: Authentication token (optional, 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 tohttps://filestash.xyz/list. For local development against a local instance of the server, set it tohttp://localhost:8181/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 using stash <command>. You can also install Stash CLI locally using poetry build && pip install dist/*.whl, which is the recommended way for developing and testing local changes. For a full uninstall, rm -r dist followed by pipx uninstall filestash is the recommended procedure.
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.2.tar.gz.
File metadata
- Download URL: filestash-0.1.2.tar.gz
- Upload date:
- Size: 28.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
091a47138aafa217f6ed7dd505ef9fa25004d3627b10039897bc00937bd34db8
|
|
| MD5 |
15d2c6f6f3df164689f55a7d6783bd3a
|
|
| BLAKE2b-256 |
7c0e530d1eb12b3ae8a57f6ce634bb591927f123a86024fdf471b7f67d4fa0e2
|
File details
Details for the file filestash-0.1.2-py3-none-any.whl.
File metadata
- Download URL: filestash-0.1.2-py3-none-any.whl
- Upload date:
- Size: 29.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
565a993a8f6816a75381e21939aafcd91532362e3b3a1f3b73173c7f2a64fe35
|
|
| MD5 |
a872c7c3e0e258ac339b5b48f6e0d4cc
|
|
| BLAKE2b-256 |
05e0204483c436527f27b82efed796b2ea66ea2546f22bbaf32cfdcd34984737
|