Skip to content

APT37/catbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 = "*"

About

Rust wrapper for the Catbox.moe API

Topics

Resources

License

Stars

Watchers

Forks

Contributors 5

Languages