This is the official documentation for Anypaste. Found a grammar mistake or something unclear? Contribute to this on the anypaste-website repo.
/usr/bin/anypasteis a nice spot), mark it executable, then you're ready to go! The quickest way to install is just the following command:
sudo curl -o /usr/bin/anypaste https://anypaste.xyz/sh && sudo chmod +x /usr/bin/anypaste
ap_pluginsin your config file.
anypaste /path/file1 /path/file2
echo 'Upload me!' | anypaste
echo 'Upload me!' | anypaste - /path/file1 /path/file2
anypaste -p gfycat /path/filename
anypaste -fp gfycat /path/filename
anypaste -xp gfycat /path/filename
anypaste -i /path/filename
anypaste -hto display the built-in help text.
anypaste -C. It will tell you where it was placed (usually
~/.config/anypaste.confon Linux and
~/.anypaste.confon Mac). The default file is fairly self-explanatory, you should be able to figure out how to use it based on the comments in it.
export arr_name=('arr_val_1' 'arr_val_2' 'arr_val_3')(you don't need
# Comments here
ap_plugins. It's an array of enabled plugins. If multiple plugins are compatible, the first one will be used, so order matters. It's the only option which doesn't need
exportbefore it. You can find a list of plugins and options they support here.
~/.anypaste-plugins(you'll need to create the folder). So, the basic procedure for installing a plugin is:
~/.anypaste-pluginsif it does not yet exist:
mkdir -p ~/.anypaste-plugins
curl -o ~/.anypaste-plugins/example example.com/example
chmod +x ~/.anypaste-plugins/example
ap_pluginsarray in your config file:
ap_pluginsarray in your config file to determine which plugins are enabled. You need to add new plugins to it, and can disable built-in plugins by removing them from it.
anypaste.conf. The exact way to do this varies by plugin. With streamable, you need to set the
streamable_passwordoptions in your config file to the email and password for your Streamable account. For example:
get_required_config: Your plugin should return a newline-separated list of required configuration options. If these options are not set, your plugin will be considered incompatible, and the user will be prompted.
check_eligibility: Your plugin should check whether the current file is compatible. The absolute path to the file will be in the environment variable
ap_path, and the mime type of the file (determined using
file --mime-type) will be in
ap_mime. It's ok for your plugin to print some sort of message if the file is "almost" compatible (for example, correct file type but over size limit).
upload: Your plugin should upload the current file (in env variable
ap_path). Assume that the file has already been checked for compatibility.