Skip to main content

drgn

A full-stack CLI library for deploying and managing enterprise-grade command line applications.

Usage

Create a simple CLI

import drgn, { Command, Option } from 'https://deno.gg/drgn@v0.5.2'

const sayCommand = new Command({
  name: 'say',
  alias: 's',
  description: 'Say something to me.'
}, ({ _ }) => {
  console.log(_[1]) // mycli say hello -> 'hello'
})

const cli = new drgn()
  .name('mycli')
  .command(sayCommand)
  .run

export default cli

Install your CLI (for autoupdates)

# -n: the name under which your cli should be installed
# -u: the url to your script - MUST be hosted on deno.land, e.g. https://deno.land/x/mycli/$version/cli/mod.ts

deno run -A -q https://deno.land/x/drgn@v0.5.2/installer.ts -n mycli -u mycli@$version/cli/mod.ts