A CLI written in JavaScript to migrate, export, import, and purge reddit account data!
It migrates/exports/imports subscribed subreddits, followed users, friends, blocked users, multireddits, profile settings, and account preferences. It can also purge (mass-delete) your comments and submissions.
npm i -g cAttte/reddit-migrate
reddit-migrate [command] [options]
Display command help.
Migrate to a new reddit account.
Options:
-e <path>
,--env-file <path>
: Path of the .env file to load credentials from.-? <list>
,--which <list>
: A comma-separated list of attributes to migrate, or 'all'.
Import data to a reddit account.
Options:
-e <path>
,--env-file <path>
: Path of the .env file to load credentials from.-i <path>
,--input <path>
: Path of the input file. (required)-? <list>
,--which <list>
: A comma-separated list of attributes to import, or 'all'.
Export data from a reddit account.
Options:
-e <path>
,--env-file <path>
: Path of the .env file to load credentials from.-o <path>
,--output <path>
: Path of the output file. (required)-p
,--pretty
: Whether to prettify the output JSON.-w
,--overwrite
: Avoid the 'overwrite?' prompt if file already exists.-? <list>
,--which <list>
: A comma-separated list of attributes to export, or 'all'.
Mass-delete reddit account content.
Options:
-e <path>
,--env-file <path>
: Path of the .env file to load credentials from.-d <text>
,--edit <text>
: Text to edit messages and posts to before deleting.-? <type>
,--which <type>
: Submission type to delete; 'posts', 'comments', or 'all'.
As seen in the command options, you can pass the path/filename of a .env
file, containing the credentials of the reddit account(s). However, if it's not provided (or the credentials are not included in the file), the CLI will prompt you to enter them:
Check out example.env to find out how the file should look for each command.
- Head over to the Apps section of your reddit account preferences.
- Click on the create app button.
- Type whatever in the name and redirect URI fields. Make sure to select the script app type.
- Your client ID will be shown below the app name and type. The secret, next to the other app info.
This project uses the MIT License. Check it out for more info.
- Migrate/import profile picture and banner; these are not imported correctly with the URLs.
- Add an option to specify which data should be imported/exported/migrated.
- Add a feature to "clear" data; unsubscribe from all subreddits, unfollow everyone, etc.
- Add a feature to mass delete comments and posts, optionally editing them before.