Skip to main content

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.

  1. Install pipx: If you don't have pipx installed, use pip install pipx. pipx will install Stash CLI into its own isolated environment, preventing dependency conflicts.
  2. 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 to http://localhost:8181/upload. The stash/constants.py file defines the base URL as http://localhost:8181. When using the up command, /upload is appended. For the remote FileStash server, set it to https://filestash.xyz/upload.
  • token: Authentication token (optional, but required for private uploads). If not provided, it uses the FILESTASH_TOKEN environment variable. Set this variable in a .env file 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 to http://localhost:8181/download. For the remote FileStash server, set it to https://filestash.xyz/download.
  • token: Authentication token (optional, but required for private downloads). If not provided, it uses the FILESTASH_TOKEN environment 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 to http://localhost:8181/list. For the remote FileStash server, set it to https://filestash.xyz/list.
  • token: Authentication token (optional but recommended). If not provided, it uses the FILESTASH_TOKEN environment 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.

  1. Install Poetry: pipx install poetry (recommended)
  2. Clone the Repository: git clone https://github.com/ogre-run/stash-cli.git
  3. Navigate to Project: cd stash-cli
  4. Install Dependencies: poetry install
  5. Activate Virtual Environment: poetry shell

You can now run the CLI from within the virtual environment with stash <command>.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

filestash-0.1.0.tar.gz (27.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

filestash-0.1.0-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

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

Hashes for filestash-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e80d3aa1571e1c4309ae3827c64cf7de53906d9d4c5deb7f3071ea678fb12dcd
MD5 978a84e460fb65e3b63883992c47182a
BLAKE2b-256 0fcc729459c6152432d84d48ac7ba50f926ff5965bb5b9bc1080e1996968bcde

See more details on using hashes here.

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

Hashes for filestash-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 627edac25a23fd897b42aaa21a65085d26852b93cecc631de75d574b83d735c5
MD5 6e7dfbc7a46735afec97d26a315f5ac6
BLAKE2b-256 014d767feb46655358535b2a6f1b593d09be932d9a64d0c5520fc2b422c99209

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page