Coder Social home page Coder Social logo

basixkor / autocomplete Goto Github PK

View Code? Open in Web Editor NEW

This project forked from withfig/autocomplete

0.0 1.0 0.0 22.9 MB

Fig adds autocomplete to your terminal.

Home Page: https://fig.io

License: MIT License

Shell 0.01% JavaScript 0.01% TypeScript 99.99% Dockerfile 0.01%

autocomplete's Introduction

Fig logo Fig logo


Badge: macOS Badge: Sign up (public beta) Badge: Documentation Badge: contributors Badge: Join the Discord server Badge: Follow on Twitter

Fig makes the command line easier for individuals and more collaborative for teams.

Our most popular product is Autocomplete. As you type, Fig pops up subcommands, options, and contextually relevant arguments in your existing terminal.

⚡️ Installation

NOTE: Once it's downloaded, launch the app to set up Fig!


Demo of Fig's visual autocomplete in a terminal


👋 What are "completion specs"?

A completion spec is a declarative schema that specifies the subcommands, options and args for a CLI tool. Fig uses these schemas to generate suggestions.


😎 Contribute your first spec in < 3 minutes

Use the steps below or follow our getting started guide: fig.io/docs

Prerequisites:

  • Download Fig for macOS
  • Node and NPM (or Yarn)

Steps

  1. Click here to fork this repo.

  2. Clone your forked repo and create an example spec

    # Replace `YOUR_GITHUB_USERNAME` with your own github username
    git clone https://github.com/YOUR_GITHUB_USERNAME/autocomplete.git fig-autocomplete
    cd fig-autocomplete
    
    # Add withfig/autocomplete as a remote
    git remote add upstream https://github.com/withfig/autocomplete.git
    
    # Install packages
    npm install
    
    # Create an example spec (call it "abc")
    npm run create-spec abc
    
    # Turn on "dev mode"
    npm run dev
  3. Now go to your terminal and type abc[space]. Your example spec will appear. 😊

Other things to know

  • Edit your spec in TypeScript in the src/ folder
  • On save, specs are compiled to the build/ folder
  • In dev mode, specs are read from the build folder, and generators run every keystroke.

🏠 Make completions for local scripts

You can use Fig's autocomplete for your own tools too. Here's how to create private completions:

# Make sure you're in your home directory
cd ~

# Create your .fig/autocomplete folder
npx @withfig/autocomplete-tools init
cd ~/.fig/autocomplete

# Create your completions!
npm run create-spec xyz
npm run publish-spec -p src/xyz.ts

You can also create completions for project scripts, or even add custom suggestions to official specs. Read more at fig.io/docs/guides/private-autocomplete


📦 Other available package.json commands

# Typecheck all specs in the src/ folder
npm test

# Compile typescripts specs from src/ folder to build/ folder
npm run build

# Lint and fix issues
npm run lint:fix

🔥 Contributions

We would love contributions for:

  • new completion specs
  • errors with existing completion specs (e.g. missing subcommands, options, or arguments)
  • generators for argument suggestions
  • better descriptions, icons etc
  • themes!

If you aren't able to contribute, please feel free to open an issue.

😊 Need Help?

Join our community
Discord logo

🧑‍💻 Teams / Enterprise

Want to use Fig to add autocomplete internal CLI tools? Or want to use Fig at work but have security / compliance concerns?

We would love to help get you set up. Please email [email protected]

🙋‍♀️ FAQ

What terminals does Fig work with?

Fig works with the native macOS Terminal app, iTerm, Tabby, Hyper, Kitty, WezTerm, and Alacritty. It also works in the integrated terminals of VSCode, JetBrains IDEs, Android Studio, and Nova.

Want to see another terminal included? Check our issue tracker and add your support for it!

How does Fig work?

Fig uses the Accessibility API on Mac to position the window, and integrates with your shell to read what you've typed.

Does Fig work on Windows or Linux?

Not yet, Fig is only available on macOS for now. Windows and Linux support is in progress!

How can I download Fig?

Run brew install fig or, downloading the app at fig.io/download. Then, launch the Fig app!

Can I use Fig to build autocomplete for my team's internal scripts and CLI tools?

Yes! Check out our guide on how to get started building autocomplete specs.

How do I submit a PR?

Check out our How to Contribute guide. Many of Fig's 200+ contributors made their first open source contribution to Fig!

Fig doesn't work for me!

Join the Discord server and we'll debug it. Fixing Fig in your setup will fix it for other people too! 🙂

Did we miss something?

Get in touch at [email protected] or chat with us on Discord.


✨ Contributors

Grid of profile icons of the 200+ contributors

autocomplete's People

Contributors

a7medev avatar ankithm28 avatar bogdaaamn avatar brendanfalk avatar clo4 avatar cstrnt avatar dannyaziz avatar dependabot[bot] avatar fedeci avatar fig-io avatar fwesss avatar geenva avatar gh-action-bump-version avatar grant0417 avatar jubeki avatar kailan avatar lsh avatar mamercad avatar mrhappyma avatar mschrage avatar nmassardot avatar nutlope avatar quiibz avatar rmorey avatar rolandtshen avatar seonggwonyoon avatar sullivan-sean avatar whobutsb avatar withfig-bot avatar yavko avatar

Watchers

 avatar

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.