~bacardi55/cleanABag

Small CLI tool to remove old articles from wallabag

89f7178 update readme

20 days ago

4682dc4 update readme

20 days ago

#cleanABag - A CLI tool to clean your (walla)bag

builds.sr.ht status license: AGPL-3.0-only

Official repository and project is on sourcehut. Github and codeberg are only mirrors. This is where binaries are uploaded.

cleanABag is a CLI tool for removing articles older than a given date from wallabag.

The goal is to avoid wasted storage of 100s or 1000s of articles that aren't needed in wallabag anymore.

To install, either download a binary from the release page or via the result of an automated build.

Or manually (you need go >= 1.17 and make):

git clone https://git.sr.ht/~bacardi55/cleanABag
cd cleanABag
make dependencies
make build

The binary will be in the bin directory.

Usage

cleanABag --help
Usage:
  cleanABag [command]

Available Commands:
  help        Help about any command
  prune       Delete old article from wallabag
  version     Print the version number of cleanABag

Flags:
  -c, --credentials string   config file with credentials to connect to wallabag (default is $HOME/.config/cleanABag/credentials.json) - Full path is needed.
  -h, --help                 help for cleanABag
  -v, --verbose              Verbose mode
cleanABag prune --help
Delete old article from wallabag

Usage:
  cleanABag prune [flags]

Flags:
  -d, --date string   Articles older than this date will be removed if they match the archived/starred flags, format "YYYY-MM-DD".
      --delete        Delete articles. Without this flag, it will only do a dry run.
  -h, --help          help for prune
  -s, --starred       Include starred entry in deletion. False will prevent starred article to be deleted.
  -u, --unread        Include unread entries for deletion. False will prevent unread articles from being deleted
Global Flags:
  -c, --credentials string   config file with credentials to connect to wallabag (default is $HOME/.config/cleanABag/credentials.json) - Full path is needed.  -v, --verbose              Verbose mode

Example:

# Remove archived articles older than 2021-12-31 (date in YYYY-MM-DD format) and that are not starred:
# Dry run:
cleanABag -c /path/to/credentials.json -d "2021-12-31"
# Delete for real:
cleanABag -c /path/to/credentials.json -d "2021-12-31" --delete

# Remove articles older than 2021-12-31, including unread but keep starred article
# Dry run:
cleanABag -c /path/to/credentials.json -d "2021-12-31" -u
# Delete for real:
cleanABag -c /path/to/credentials.json -d "2021-12-31" -u --delete

# Remove articles older than 2021-12-31, including unread and starred article
# Dry run:
cleanABag -c /path/to/credentials.json -d "2021-12-31" -u -s
# Delete for real:
cleanABag -c /path/to/credentials.json -d "2021-12-31" -u -s --delete

Example of credentials.json:

{
  "WallabagURL": "https://your.wallabag.tld",
  "ClientId": "client ID generate in your profile on wallabag"
  "ClientSecret": "client secrete generate in your profile on wallabag"
  "UserName": "your username",
  "UserPassword": "your password"
}