npm version

github-pewpew preview

Why?

Have you ever had too much fun with the GitHub API and ended up creating too many dummy repos? Me too šŸ˜…!

I made this little CLI tool to clean up repositories quickly. Iā€™m planning to add some flags and regexp to delete in bulk in the future. Let me know if that sounds interesting to you.

Get the latest version published in npm. Itā€™s open-sourced on GitHub under MIT license.

šŸ“¦ github-pewpew v1.2.2 on April 5, 2022

A new version 1.2.2 has been published to npm. Itā€™s a minor update, but itā€™s a special one: we are launching a brand new website and logo.

github-pewpew preview

šŸ“¦ github-pewpew v1.2.0 on August 24, 2021

I published version github-pewpew v 1.2.0 to npm. A much-needed refactor after v1.1.0 that improves the overall stability of the app. You can now get more than 100 results, as there was no pagination in prior versions.

Many bugs have been fixed, and the authentication process is now more robust when tokens get invalidated in different scenarios. Iā€™ve also added some testing using Mocha to cover the authentication flow.

Next, Iā€™m porting everything to TypeScript. I hope you like it, and thanks for the feedback!

šŸ“¦ github-pewpew v1.1.3 on August 14, 2021

A new version github-pewpew v 1.1.3 is published in npm. Itā€™s an important update as itā€™s making it way easier to use than before. Itā€™s also lighter in size.

The auth solution wasnā€™t too friendly, so I re-implemented it using OAuth, and itā€™s working like a charm. Plus, it doesnā€™t need to ask for the username. You automatically get a validation code copied to your clipboard, paste it, and you are good to go! Kudos to @mamuso for suggesting me this mechanism I never used before.

I also added persistent configuration. Thereā€™s no more need to sign in every time you run the command. During this implementation, I learned about os.homedir(), the differences between operating systems, and how they store user configuration files.

Hereā€™s how it works:

function getConfigDir(homeDir) {
  const configDir = path.join(
    homeDir,
    process.platform === 'win32'
      ? path.join('AppData', 'Roaming', PACKAGE_AUTHOR, PACKAGE.name)
      : path.join('Library', `com.${PACKAGE_AUTHOR}.${PACKAGE.name}`)
  );

  return configDir;
}

// Windows: adrianmg\AppData\Roaming\adrianmg\github-pewpew
// macOS/UNIX: /Users/adrianmg/Library/com.adrianmg.github-pewpew

The win32 solution wonā€™t work for systems older than Windows Vista. I guess thatā€™s OK in 2021? Some npm packages provide a robust solution covering all the different platforms, but it felt like a waste of weight for such a small tool. Plus, Iā€™m learning a few things along the way.

šŸ“¦ github-pewpew v1.0.0 on August 11, 2021

The first public version, github-pewpew v 1.0.0 released on npm. The authentification is relying on both e-mail and PAT (Personal Acess Token) with a repo_delete scope. Although it works, itā€™s adding too much friction as the user must constantly copy and paste the value to get permissions to delete repositories.

github-pewpew preview

Iā€™m planning to reduce friction via a refactor that will use OAuth as the mechanism to get permissions.

Questions? Ideas? Bugs?

If you run into any issues or youā€™d like to share your thoughts, feel free to open an issue in this repository or hit me up on Twitter.