Socket
Socket
Sign inDemoInstall

@oclif/plugin-autocomplete

Package Overview
Dependencies
84
Maintainers
2
Versions
79
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @oclif/plugin-autocomplete

autocomplete plugin for oclif


Version published
Weekly downloads
538K
decreased by-0.78%
Maintainers
2
Install size
4.43 MB
Created
Weekly downloads
 

Package description

What is @oclif/plugin-autocomplete?

@oclif/plugin-autocomplete is a plugin for the Oclif CLI framework that provides autocomplete functionality for CLI commands. It helps users by suggesting command completions, options, and arguments as they type, improving the user experience and efficiency.

What are @oclif/plugin-autocomplete's main functionalities?

Enable Autocomplete

This feature enables autocomplete for the CLI application. The code sample demonstrates how to enable autocomplete using the @oclif/plugin-autocomplete package.

const { Command } = require('@oclif/core');
const Autocomplete = require('@oclif/plugin-autocomplete').default;

class MyCommand extends Command {
  async run() {
    this.log('Enabling autocomplete...');
    await Autocomplete.enable();
  }
}

MyCommand.run();

Generate Autocomplete Script

This feature generates the autocomplete script for the CLI application. The code sample shows how to generate and log the autocomplete script using the @oclif/plugin-autocomplete package.

const { Command } = require('@oclif/core');
const Autocomplete = require('@oclif/plugin-autocomplete').default;

class MyCommand extends Command {
  async run() {
    this.log('Generating autocomplete script...');
    const script = await Autocomplete.generate();
    this.log(script);
  }
}

MyCommand.run();

Disable Autocomplete

This feature disables autocomplete for the CLI application. The code sample demonstrates how to disable autocomplete using the @oclif/plugin-autocomplete package.

const { Command } = require('@oclif/core');
const Autocomplete = require('@oclif/plugin-autocomplete').default;

class MyCommand extends Command {
  async run() {
    this.log('Disabling autocomplete...');
    await Autocomplete.disable();
  }
}

MyCommand.run();

Other packages similar to @oclif/plugin-autocomplete

Changelog

Source

3.0.3 (2023-12-10)

Bug Fixes

  • deps: bump @oclif/core from 3.12.0 to 3.14.1 (#566) (8a44057)

Readme

Source

@oclif/plugin-autocomplete

autocomplete plugin for oclif (bash, zsh and powershell)

Version Downloads/week License

Usage

Run <cli> autocomplete to generate the autocomplete files for your current shell.

Topic separator

Since oclif v2 it's possible to use spaces as a topic separator in addition to colons.

For bash and zsh each topic separator has different autocomplete implementations, if the CLI supports using a space as the separator, plugin-autocomplete will generate completion for that topic.

If you still want to use the colon-separated autocomplete you can set OCLIF_AUTOCOMPLETE_TOPIC_SEPARATOR to colon and re-generate the autocomplete files.

Docs: https://oclif.io/docs/topic_separator

Commands

oclif-example autocomplete [SHELL]

Display autocomplete installation instructions.

USAGE
  $ oclif-example autocomplete [SHELL] [-r]

ARGUMENTS
  SHELL  (zsh|bash|powershell) Shell type

FLAGS
  -r, --refresh-cache  Refresh cache (ignores displaying instructions)

DESCRIPTION
  Display autocomplete installation instructions.

EXAMPLES
  $ oclif-example autocomplete

  $ oclif-example autocomplete bash

  $ oclif-example autocomplete zsh

  $ oclif-example autocomplete powershell

  $ oclif-example autocomplete --refresh-cache

See code: src/commands/autocomplete/index.ts

Keywords

FAQs

Last updated on 10 Dec 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc