npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ghs-cli-tool

v1.1.0

Published

`ghs` is a command-line tool and GUI to manage SSH and GPG keys for GitHub accounts. It allows you to analyze, save configurations, create new keys, delete configurations, and switch between them easily.

Downloads

77

Readme

ghs - GitHub SSH and GPG Key Manager

ghs is a command-line tool and GUI to manage SSH and GPG keys for GitHub accounts. It allows you to analyze, save configurations, create new keys, delete configurations, and switch between them easily.

Features

  • Export and analyze GPG keys
  • Save and name GPG and SSH key configurations
  • Create new GPG and SSH key pairs
  • Clone repositories with specified SSH and GPG keys
  • Switch GitHub accounts using saved configurations
  • Set default GPG and SSH keys
  • Delete saved configurations
  • List all saved configurations
  • Dry-run mode for simulating commands without making changes
  • Modern GUI with dark and light modes

Installation

From the Repository

  1. Clone the repository:

    git clone https://github.com/dannymichel/ghs.git
  2. Navigate to the project directory:

    cd ghs
  3. Install the dependencies for the backend and frontend:

    npm install
    cd frontend
    npm install
    cd ../backend
    npm install
    cd ..
  4. Link the package globally:

    npm link

Global Installation via npm

You can install the tool globally using npm:

npm install -g ghs-cli-tool

Usage

You can use the ghs command to perform various tasks. Here are the available commands:

Analyze GPG Keys

Export and analyze your GPG keys.

ghs analyze

Save GPG and SSH Key Configuration

Save a new GPG and SSH key pair configuration. You can either pass the configuration name, GPG key, and SSH key directly as arguments, or run the command without arguments to select from options interactively.

ghs save [configName] [gpgKey] [sshKey]

or

ghs save

Create New GPG and SSH Key Pair

Create a new GPG and SSH key pair. You can either pass the necessary details directly as arguments, or run the command without arguments to provide details interactively.

ghs new [configName] [gpgName] [gpgEmail] [gpgPassphrase] [sshKeyName]

or

ghs new

Clone Repository

Clone a GitHub repository using specified SSH and GPG keys. You can either pass the URL, GPG key, and SSH key directly as arguments, or run the command without arguments to select from options interactively.

ghs clone [url] [gpgKey] [sshKey]

or

ghs clone

Switch GitHub Accounts

Switch the GitHub account using a saved configuration. You can either pass the configuration name directly as an argument, or run the command without arguments to select from options interactively.

ghs switch [configName]

or

ghs switch

Set Default Keys

Set default GPG and SSH keys for your operations. You can either pass the GPG key, SSH key, user name, and user email directly as arguments, or run the command without arguments to provide details interactively.

ghs default [gpgKey] [sshKey] [userName] [userEmail]

or

ghs default

Delete Saved Configuration

Delete a saved GPG and SSH key pair configuration. Use the --hard option to delete both the configuration and the actual keys. You can either pass the configuration name directly as an argument, or run the command without arguments to select from options interactively.

ghs delete [configName]
ghs delete --hard [configName]

or

ghs delete
ghs delete --hard

List All Saved Configurations

List all saved configurations.

ghs list

Export GPG and SSH Keys

Export GPG and SSH keys for a saved configuration. You can either pass the configuration name directly as an argument, or run the command without arguments to select from options interactively.

ghs export [configName]

or

ghs export

Dry-Run Mode

Simulate commands without making changes using the --dry-run option.

ghs clone --dry-run [url] [gpgKey] [sshKey]
ghs switch --dry-run [configName]
ghs default --dry-run [gpgKey] [sshKey] [userName] [userEmail]
ghs new --dry-run [configName] [gpgName] [gpgEmail] [gpgPassphrase] [sshKeyName]
ghs save --dry-run [configName] [gpgKey] [sshKey]
ghs delete --dry-run [configName]
ghs delete --hard --dry-run [configName]

Running the GUI

To run the GUI for managing your configurations, use the following command:

npm start

This will start both the frontend and backend servers. You can then access the GUI in your browser at http://localhost:3000.

Directory Structure

ghs/
│
├── bin/
│   └── ghs.js
├── backend/
│   ├── index.js
│   └── ...
├── frontend/
│   ├── public/
│   ├── src/
│   │   ├── App.js
│   │   ├── index.js
│   │   ├── themes.js
│   │   ├── ...
│   └── package.json
├── lib/
│   ├── config.js
│   ├── gpg.js
│   ├── ssh.js
│   ├── git.js
│   └── prompts.js
└── package.json
  • bin/ghs.js: Entry point for the CLI tool.
  • backend/index.js: Entry point for the backend server.
  • frontend/: Contains the frontend React application.
    • public/: Static assets for the frontend.
    • src/: Source code for the frontend.
      • App.js: Main application component.
      • index.js: Entry point for the React application.
      • themes.js: Contains theme configurations for light and dark modes.
  • lib/config.js: Handles loading and saving configuration.
  • lib/gpg.js: Functions for exporting, analyzing, saving, creating, setting default, and deleting GPG keys.
  • lib/ssh.js: Functions for managing SSH keys.
  • lib/git.js: Functions for cloning repositories and switching accounts.
  • lib/prompts.js: User prompts for various operations.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for details.