New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

edithe

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

edithe

A command line tool template

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

cli-starter

A command line tool template.

Try it now!

Create repo from this template on Github

Or:

$ npx degit peterroe/cli-starter my-cli
$ cd my-cli
$ pnpm i    # npm install -g pnpm

Development

You can debug your cli tool in project.

$ npx esno src/index.ts  # run your cli tool in debug mode

or link your cli tool to global

$ pnpm stub
$ pnpm link --global

Example

This command will help you understand how cli tool works:

$ npx esno src/index.ts -h # show help
$ npx esno src/index.ts -v # show version
$ npx esno src/index.ts lint one two --name peterroe # demo usage

# link global
$ my-cli -h # show help
$ my-cli -v # show version
$ my-cli lint one two --name peterroe # demo usage

And then you can rewrite src/index.ts to what you want

Here are some projects that use cli-starter: renamestind

More usage about cac please see cac

Build && Publish

Update the name:

{
- "name": "cli-starter",
+ "name": "xxx",
  "bin": {
-   "cli-starter": "./dist/index.mjs"
+   "xxx": "./dist/index.mjs"
  },

Build it:

$ pnpm build

Publish to npm:

$ pnpm release # or npm publish directly

Try yourself!

Install your own command line tool:

$ npm install -g xxx
$ xxx -h
$ xxx -v

Then use it...

Keywords

cli

FAQs

Package last updated on 31 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts