catbox-ng

Crates.iocatbox-ng
lib.rscatbox-ng
version0.9.2
created_at2025-06-19 17:50:12.43048+00
updated_at2025-06-19 17:50:12.43048+00
descriptionImplementation of Catbox.moe's API
homepagehttps://github.com/APT37/catbox
repositoryhttps://github.com/APT37/catbox
max_upload_size
id1718643
size92,241
(APT37)

documentation

https://github.com/APT37/catbox

README

CLI and library wrapper for the Catbox API

See FAQ for allowed filetypes and content.

Please consider supporting Catbox.moe by donating through Ko-fi or by purchasing items from the merch store (also supports direct donations) to help with the server costs.

Installation

AUR

Arch users may install one of our AUR packages.

Binaries

Pre-built binaries for Windows and Linux are available for every release.

From Source (with cargo)

# 1. build dependencies
sudo apt-get install git rustup

# 2. Rust toolchain
rustup default stable

# 3a. latest release (via crates.io)
cargo install catbox-ng

# 3b. latest commit (via GitHub)
cargo install --git=https://github.com/APT37/catbox

Authentication

Some commands require a authentication (via userhash). This can be set using both the CATBOX_USER_HASH environment variable or the --user argument.

The --user argument takes precedence over the environment variable.

Uploads without a userhash are anonymous.

Commands

All successful commands return the verbatim server response, usually a link to the given file or album, or an error.

catbox <cmd>

  • upload local files or URLs (authentication optional)
  • delete files
  • album see below
  • litter see examples

The album subcommand has additional subcommands:

catbox album <album_cmd>

  • create a new album (authentication optional)
  • delete an existing album
  • edit an existing album
  • add files to an existing album
  • remove files from an existing album

Examples

Upload a file:

catbox upload cute_picture.png

Upload multiple files:

catbox upload *.jpg  # Upload all jpg files
catbox upload image.png file.txt  # Upload image.png and file.txt

Delete a file:

catbox delete abc123.jpg --user 1234567890123456789012345
catbox delete https://files.catbox.moe/123456.png  # Or just 123456.png

Create an album:

catbox album create --title 'My album' --desc 'An excellent album' abc123.jpg def456.png

Upload a file to Litterbox for 3 days:

catbox litter --time 72h homework.zip

Library

You can compile and install the command line tool with Cargo:

cargo install catbox-ng

To use the library in your project, add the repo to your Cargo.toml:

[dependencies]
catbox-ng = "*"
Commit count: 58

cargo fmt