bytestashy

Crates.iobytestashy
lib.rsbytestashy
version0.3.2
created_at2025-06-05 19:37:38.196904+00
updated_at2025-12-09 00:20:23.39178+00
descriptionA command-line interface for ByteStash for the easy posting of snippets without opening a browser.
homepage
repositoryhttps://github.com/LetsDrinkSomeTea/bytestashy
max_upload_size
id1702250
size143,703
(LetsDrinkSomeTea)

documentation

README

bytestashy

bytestashy is a CLI application that communicates with the ByteStash API to quickly store files as snippets or retrieve existing ones.

Installation

A recent Rust installation is required (at least Rust 1.74 with Edition 2024). The tool can be installed directly from crates.io:

cargo install bytestashy

Alternatively, clone this repository and build from source:

cargo build --release

Commands

Authentication

Before the first upload, an API key for ByteStash must be generated:

bytestashy login <API_URL>

Configuration is stored in an OS-specific config folder (for example under $XDG_CONFIG_HOME/bytestashy/config.json on Linux). The API key itself is saved securely in your system keyring.

Create Snippets

Upload files as snippets. The program will interactively prompt for title, description, visibility and categories:

bytestashy create <FILES...>

List Snippets

Display a paginated list of your snippets:

bytestashy list [OPTIONS]

Options:

  • --all, -a: Display all snippets (no pagination)
  • --number, -n <N>: Page size (default: 10)
  • --page, -p <N>: Page number to display (starting at 1)

Get Snippets

Retrieve and download a snippet by ID:

bytestashy get <ID>

The command will show snippet details and prompt whether to download the files.

Update Snippets

Replace all files in an existing snippet:

bytestashy update <ID> <FILES...>

The program will prompt for updated title, description, visibility and categories, pre-filling with current values.

Delete Snippets

Delete a snippet by ID:

bytestashy delete <ID> [OPTIONS]

Options:

  • --force, -f: Skip confirmation dialog

Search Snippets

Search through your snippets with various options:

bytestashy search <QUERY> [OPTIONS]

Options:

  • --sort, -s <ORDER>: Sort order (newest, oldest, alpha-asc, alpha-desc)
  • --search-code: Search within code content (not just titles/descriptions)

Available sort options:

  • newest - Most recently updated first
  • oldest - Oldest first
  • alpha-asc - Alphabetical by title (A-Z)
  • alpha-desc - Alphabetical by title (Z-A)

Shell Completions

Generate shell completion scripts for enhanced command-line experience:

bytestashy --shell <SHELL>

Supported shells: bash, zsh, fish, powershell

Installation examples:

Bash:

bytestashy --shell bash > /etc/bash_completion.d/bytestashy
# or for user-only installation:
bytestashy --shell bash > ~/.local/share/bash-completion/completions/bytestashy

Zsh:

bytestashy --shell zsh > ~/.zsh/completions/_bytestashy
# Make sure ~/.zsh/completions is in your $fpath

Fish:

bytestashy --shell fish > ~/.config/fish/completions/bytestashy.fish

After installation, restart your shell or source the completion file to enable tab completion for all bytestashy commands and options.

License

This project is licensed under the GPLv3. See LICENSE.

References

Commit count: 0

cargo fmt