Giter Club home page Giter Club logo

usage's Introduction

Usage

Usage is a spec and CLI for defining CLI tools. Arguments, flags, environment variables, and config files can all be defined in a Usage spec. It can be thought of like OpenAPI (swagger) for CLIs. Here are some potential reasons for defining your CLI with a Usage spec:

  • Generate autocompletion scripts
  • Generate markdown documentation
  • Generate man pages
  • Use an advanced arg parser in any language
  • Scaffold one spec into different CLI frameworks—even different languages
  • [coming soon] Host your CLI documentation on usage.sh

See more at usage.jdx.dev.

Warning

This is beta software and may have breaking changes both with the CLI and schema design. You've been warned.

usage's People

Contributors

jdx avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

usage's Issues

discussion - self-completing commends

heya,

this looks fab! One thing I've been wondering about is some sort of self-documenting/completing mechanism - e.g. some way for bins/scripts to act as their own completer.

having a way to get a usage spec out of a script/bin (e.g. your double-shebang mechanism) is one half, but the other is for the command itself to be recursively involved in completions. Think e.g. a field that wants an s3:// url, or an scp remotehost:/remotepath field. Not fleshed out sorry, I'll come back to this :)

AUR Package

Apologies if this isn't the right spot. This issue is shared a bit between mise and usage.

I've recently started getting the Error: usage not found. message when attempting tab completions when using mise. I can go ahead and install mise, but it would certainly be handy if there was a usage and usage-bin package available in the AUR. I'd be happy to create such a thing but I'm aware you've already got release scripts set up for mise, so I thought it'd be worth asking in case you'd like to set up a similar thing for usage.

The other thing I'd wonder is whether mise and mise-bin should get updated so that they list usage as a dependency in the AUR. Happy to raise a separate issue in the mise repo for that though.

Specifying usage examples in the spec

The dokku project uses some faux reflection and fancy footwork to generate cli help output as well as markdown docs from files. One thing that is nice is that we can show examples to users for usage.

I'm wondering if that would be possible to somehow spec out. Examples have a cli command as well as a description of the command, and are shown in the section for that particular subcommand.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

cargo
Cargo.toml
  • kdl 4
  • miette 5
  • thiserror 1
  • clap 4
  • indexmap 2
  • shell-escape 0.1
  • log 0.4
  • itertools 0.12.0
  • once_cell 1.19.0
  • insta 1
cli/Cargo.toml
  • clap 4
  • env_logger 0.10
  • exec 0.3.1
  • itertools 0.12.0
  • log 0.4
  • miette 5
  • once_cell 1

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.