Use Scratch's asset servers to store files. To upload a file: deno run --allow-net --allow-read ./bin.ts upload ./path/to/file To download a file given a hash: deno run --allow-net --allow-write ./bin.ts download \ 24310a98bae36609aa4b184e0cd20988 ./path/to/file SUBCOMMANDS: upload Upload a file download Download a file --- Upload a file to Scratch's asset servers. Prints the resulting md5 hash that can be used to later download the file. Uploading files requires authentication, so you must provide your Scratch account's `scratchsessionsid` cookie. On the Scratch website whilst signed in, you can find this in DevTools (inspect element) > Application > Cookies > https://scratch.mit.edu > scratchsessionsid. Upload a file from a given path: SCRATCHSESSIONSID="..." deno run --allow-net --allow-env --allow-read \ ./bin.ts upload ./path/to/file Upload a file from stdin: cat ./path/to/file | SCRATCHSESSIONSID="..." deno run --allow-net --allow-env \ ./bin.ts upload USAGE: deno run --allow-net --allow-env --allow-read ./bin.ts upload [OPTIONS] [FILE] If FILE is omitted, then the file contents will be read from stdin. OPTIONS: -h, --help Prints help information -s, --session-id= Directly provide the `scratchsessionsid` cookie. -S, --session-id-path= Provide a path to a file containing the `scratchsessionsid` cookie. -c, --compress Whether to compress the file using the DEFLATE algorithm. -U, --url, --output-download-url Whether to output a link to a download URL instead of just the hash. ENVIRONMENT VARIABLES: SCRATCHSESSIONSID The Scratch account's `scratchsessionsid` cookie. (required) --- You must provide a `scratchsessionsid` cookie to authenticate the upload. You can provide it by either: - Setting the option `--session-id=` to the session ID. - Storing the session ID in a file, then setting the option `--session-id-path=` to the location of the file. - Setting the environment variable `SCRATCHSESSIONSID` to the session ID. For more information, try `deno run ./bin.ts upload --help`. --- Download a file stored on Scratch's asset servers given the md5 hash of the file output from the `upload` subcommand. Save a file to a given path: deno run --allow-net --allow-write ./bin.ts download \ 24310a98bae36609aa4b184e0cd20988 ./path/to/file Download a file and output it to stdout. deno run --allow-net ./bin.ts download 24310a98bae36609aa4b184e0cd20988 \ > ./path/to/file USAGE: deno run --allow-net --allow-write ./bin.ts download [OPTIONS] [HASH] [PATH] If PATH is omitted, then the downloaded file will be output to stdout. OPTIONS: -h, --help Prints help information -c, --compressed Whether the file was compressed. If this argument is specified, then the file will be decompressed per the DEFLATE algorithm. --- The file hash is required. For more information, try: deno run ./bin.ts download --help --- I wasn't expecting a subcommand "wow". USAGE: deno run --allow-net --allow-read --allow-write ./bin.ts [SUBCOMMAND] [OPTIONS] For more information, try `deno run ./bin.ts --help`.