Giter Site home page Giter Site logo

phuctm97 / shell.how Goto Github PK

View Code? Open in Web Editor NEW
257.0 3.0 8.0 1.71 MB

Explain shell commands using next-generation autocomplete Fig.

Home Page: https://shell.how

License: MIT License

Shell 0.42% JavaScript 2.72% TypeScript 96.02% CSS 0.84%
shell commandline bash howto autocomplete

shell.how's Introduction

shell.how ยท CI

Explain shell commands using next-generation autocomplete from Fig.

shell.how - Explain how your shell command works | Product Hunt

Contributing

Requirements

  • Node 14

  • Yarn 1.22+

Setup

  1. Install requirements

  2. Clone the repository

  3. Run yarn to install dependencies

Develop

Tech stack

  • TypeScript

  • Next.js

  • Tailwind CSS

  • Recoil for state management, it works natively with React concurrent mode & has builtin caching, allows lean pattern for querying dynamic data (see hooks/use-spec.ts)

  • React concurrent mode for loading data before rendering components & handling errors

Start development

  • Run yarn start to start development

  • Commit adhering to Angular commit convention, use yarn commit or Code conventional commits to commit interactively

  • Submit a PR and make sure required status checks pass

  • When a PR is merged or code is pushed to main:

    • Vercel deploys latest changes to shell.how

    • Github validates and creates a new release if there're relevant changes

Understand parser

The parser has 2 steps:

  1. Escape and split the string into tokens delimited white space, a quoted string is a single token. Nested quotes are supported, too.

  2. Load Fig's autocomplete spec for the command (the first token from step 1). Iterate through the tokens, validate, and annotate the tokens with information from the spec.

interface Token extends SimpleToken, Fig.BaseSuggestion {
  indices: [number, number]; // [start, end], end is exclusive
  value: string; // a copy of [start, end) from original string
  type: "command" | "subcommand" | "option" | "argument";
}

Author

Minh-Phuc Tran (@phuctm97) - Fig

shell.how's People

Contributors

brendanfalk avatar dependabot[bot] avatar phuctm97 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

shell.how's Issues

Reporting a vulnerability

Hello!

I hope you are doing well!

We are a security research team. Our tool automatically detected a vulnerability in this repository. We want to disclose it responsibly. GitHub has a feature called Private vulnerability reporting, which enables security research to privately disclose a vulnerability. Unfortunately, it is not enabled for this repository.

Can you enable it, so that we can report it?

Thanks in advance!

PS: you can read about how to enable private vulnerability reporting here: https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository

Reporting a vulnerability

Hello!

I hope you are doing well!

We are a security research team. Our tool automatically detected a vulnerability in this repository. We want to disclose it responsibly. GitHub has a feature called Private vulnerability reporting, which enables security research to privately disclose a vulnerability. Unfortunately, it is not enabled for this repository.

Can you enable it, so that we can report it?

Thanks in advance!

PS: you can read about how to enable private vulnerability reporting here: https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository

v1.1

Some of features would be really awesome to have in the next release ๐Ÿš€:

  • Parser: Handle single-quoted strings.
  • Parser: Other improvements to make sure parser's first step always return correct number of tokens.
  • Parser: Handle advanced syntax of options: grouped options, option using =
  • Parser: Handle arguments with isOptional, isPersistent, isRepeatable, etc, differently.
  • Performance: Install Fig's completion spec locally and static render first result โ†’ avoid (many) network calls client-side.
  • SEO: Generate static sitemaps for all commands defined in spec โ†’ increase SEO, potentially make this the best place to search & learn shell command ๐Ÿ”ฅ.
  • Socials: Generate OG image dynamically for command being queried.

Support Substitutions

IE: sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

support for newer node version

as a fig user i was excited to build and play with shell.how as well as considering it likely to be helpful in building/debugging fig completions.

however, the node 14 requirement is a show-stopper as V8 8.6 is required to build node for the arm64 architecture (for m1 macs) which as far as i know is only available in node 15 and greater.

while i know it is technically possible to run node 14 in translated/rosetta mode, i'm not interested in pursuing that bag of hurt.

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.