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

tahsin-cli

v1.0.1

Published

A CLI tool to intact with tahsin's gh repos.

Downloads

12

Readme

banner

yourcli

A cli template that let you create your own cli, this cli can be used to interact with your github repos - open it in browser or clone it. ALso has some additional features.

Here is step by step guide to create yourcli =>

Note - before you create you cli, make sure you have installed nodejs and git on your machine.

1 /

Clone this repository,

git clone https://github.com/iamovi/yourcli.git

2 /

Open cloned project with your favorite code editor,

3 /

Install dependencies,

npm i

4 /

Before setting up, let's run it locally to see everything okay or not,

  • open terminal and run -
chmod +x index
  • run next -
./index
  • if the Output -
iamovi@ovismint:~/Desktop/yourcli$ ./index
? Choose a category: (Use arrow keys)
❯ projects 
  cli-tools 
  libraries 
  games 
  others 
  Exit 
  • then everything is working buttery clean.

Alright, let's move to next step - we will make the cli our own =>

Note - please follow comments inside code files, you can see what you have to do.

Let's set up package.json file first -

  • open package.json file,
  • read comments section first from there,
"name": "marufovi-cli",
  • change the name to your desired name, Example example-cli
  "description": "A CLI tool to intact with Maruf OVi's gh repos.",
  • change description if needed,
  "bin": {
    "marufovi": "./index"
  },
  • change marufovi to your name, this command will be used to run your cli,
  "keywords": [
    "marufovi",
    "web-dev",
    "marufovis-cli"
  ],
  • change keywords if needed,
  "author": "Maruf OVi",
  • change author if needed.

We set up your package.json file, Lets move to next step,

Let's add your projects and repos to the cli -

  • open repositories.js file from main folder, path - main/repositories.js

  • just follow those comments,

  • by doing those your repositories.js is set up,

  • okay now open categories.js file,

// categories.js
export const categories = ['projects', 'cli-tools', 'libraries', 'games', 'others'];

// edit or add more catagories if needed
  • you will see these code,
  • just follow those comments as you did on repositories.js file.

Hmmm seems like your repos and your details are set to your cli, well done.

Now let's move to next step -

  • open index file, this is the main file of your cli
  • you can see comments there too just follow those comments carefully
  • but let me show you
if (urlChoice.url === 'gmail') {
  console.log('Gmail: [email protected]'); // add your gmail here
  • add your email here,
if (actionChoice.action === 'Open') {
  shell.exec(`open https://github.com/your_username/${selectedRepository}`);
} else if (actionChoice.action === 'Clone') {
  const cloneUrl = `https://github.com/your_username/${selectedRepository}.git`;
  const cloneSuccess = shell.exec(`git clone ${cloneUrl}`).code === 0;
  // make sure to change you_username to your actual github username
  • replace the your_username with your actual github account username,
  • this will interact with your github repos to clone it or open it.

And yesss you did it (We did it!!!), your cli is read to BOOM 💥.

But it's always better to test locally first -

./index
  • run it and check your cli is working fine or need or check if anything needs to be changed.

Here is another way to test your cli locally

  • open terminal in the project directory and run -
npm link

The npm link command is used in Node.js to create a symbolic link between a package and a local directory. This can be helpful during development when you want to test changes to a package in a real-world scenario without having to publish it to the npm registry.

  • now run the command that you gave in package.json file.
  "bin": {
    "marufovi": "./index"
  },
  • if it is marufovi then simply run marufovi in your terminal , the cli will run,
  • after testing unlink cli
npm unlink marufovi
  • replace marufovi with yours.

Publish to npm

Congrats you made your cli, Let's publish it to npm so that anyone (you, your friends, others) can use use your cli to interact with you and with your gh repos,

  • open terminal in your cli project directory,
npm login
  • login your npm account, if you don't have then create one,
npm publish
  • run this command to publish your cli to npm registry,
  • now you can check your cli package in npm website.

Installation of your cli

Let's install your cli in your machine =>

  • open terminal
npm i -g your_cli
  • replace your_cli with the name of your actual cli, that you gave it `package.json file
  "name": "marufovi-cli",
  • Once it installed globally in your machine,
  • simply run your cli -
  "bin": {
    "marufovi": "./index"
  },
  • with the name that you gave here,
marufovi
  • your cli will run!
  • now choose actions and enjoy.

If you facing any problems during making your cli, feel free to contact with me 😊.

Maruf OVi

[email protected]

License

MIT