@salesforce/b2c-tooling-sdk / cli / CommandSearchIndex
Class: CommandSearchIndex
Defined in: packages/b2c-tooling-sdk/src/cli/command-search.ts:157
Searchable index over CLI commands.
Example
import {CommandSearchIndex} from '@salesforce/b2c-tooling-sdk/cli';
// Inside an oclif command:
const index = new CommandSearchIndex(this.config.commands, this.config.topics);
const results = index.search('deploy cartridges', {bin: this.config.bin});Constructors
Constructor
new CommandSearchIndex(
commands,topics):CommandSearchIndex
Defined in: packages/b2c-tooling-sdk/src/cli/command-search.ts:161
Parameters
commands
readonly SearchableCommand[]
topics
readonly SearchableTopic[] = []
Returns
CommandSearchIndex
Accessors
size
Get Signature
get size():
number
Defined in: packages/b2c-tooling-sdk/src/cli/command-search.ts:197
Number of indexed (non-hidden) commands.
Returns
number
Methods
search()
search(
query,options):CommandSearchResult[]
Defined in: packages/b2c-tooling-sdk/src/cli/command-search.ts:208
Search commands by free-text query.
Parameters
query
string
Free-text query (e.g. deploy cartridges, sandbox reset)
options
CommandSearchOptions = {}
Result limit, topic filter, and binary name
Returns
Matching commands, best first