Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Search Tuning

IntelliShell provides advanced control over its search-ranking algorithms, allowing you to fine-tune how commands and variable suggestions are sorted to better match your personal workflow. These settings are located in the [tuning.commands] and [tuning.variables] sections of your config.toml file.

The ranking system for both commands and variables works by assigning points from different sources (like text relevance or usage history) and calculating a final weighted score. By adjusting the points allocated to each source, you can influence which factors are more important in the search results.

Command Search Tuning

The final score for a searched command is a weighted sum of points from three sources: how well the text matches the query, how often the command has been used, and the directory where it was last used.

# Configuration to tune the command search ranking algorithm.
#
# The final score for a command is a weighted sum of points from three sources:
# 1. Usage Score: How often the command has been globally used
# 2. Path Score: Where the command has been used before
# 3. Text Relevance: How well the command's text matches the search query (if any)
[tuning.commands]
# Total points assigned to the global usage of a command
usage.points = 100

# Total points assigned for matching any usage on a relevant path
path.points = 300
# Weights applied to a command path points based on where it was used
path.exact = 1.0
path.ancestor = 0.5
path.descendant = 0.25
path.unrelated = 0.1

# Total points assigned to the normalized text relevance score
text.points = 600
# The weight for the command's `cmd` field in the text search
text.command = 2.0
# The weight for the command's `description` field in the text search
text.description = 1.0

# --- "auto" Mode Specific Tuning ---
# Multiplier for high-confidence prefix matches
text.auto.prefix = 1.5
# Multiplier for standard "all words must match" fuzzy results
text.auto.fuzzy = 1.0
# Multiplier for lower-confidence "any word can match" relaxed results
text.auto.relaxed = 0.5
# A boost multiplier to add when the search term matches the start of a command
text.auto.root = 2.0

Command Scoring Parameters

KeyDescription
usage.pointsTotal points assigned based on the command's global usage count
path.pointsTotal points assigned based on the command's usage history in relation to the current directory
path.exactMultiplier for a command used in the exact same directory
path.ancestorMultiplier for a command used in a parent directory
path.descendantMultiplier for a command used in a child directory
path.unrelatedMultiplier for a command used in an unrelated directory
text.pointsTotal points assigned based on how well the command's text matches the search query
text.commandThe weight given to matches within the command string itself (e.g., docker run...)
text.descriptionThe weight given to matches within the command's description and hashtags

"Auto" Mode Specific Tuning

These settings only apply when the search mode is set to "auto". They control how much weight is given to different kinds of text matches to produce more intuitive results.

KeyDescription
text.auto.prefixA multiplier for high-confidence results where the query is a prefix of the command or alias
text.auto.fuzzyA multiplier for standard fuzzy-matched results where all words in the query are found
text.auto.relaxedA multiplier for lower-confidence results where only some words in the query are found
text.auto.rootA boost applied when the first search term matches the very beginning of a command string

Variable Suggestion Tuning

When you replace variables in a command, IntelliShell suggests previously used values. The ranking of these suggestions is determined by a score calculated from two sources: the context of other variables in the command and the path where the value was used. Total usage count is used as a tie-breaker.

# Configuration to tune the variables suggestion ranking algorithm.
#
# The final score for a variable suggestion is a weighted sum of points from two sources:
# 1. Context Score: Other variable values already selected to the command
# 2. Path Score: Where the value has been used before
# The total usage will be used as a tie-breaker if the same points are scored
[tuning.variables]
# Total points assigned for matching contextual information (e.g., previous variables values)
context.points = 700

# Total points assigned for matching any usage on a relevant path
path.points = 300
# Weights applied to a variable path score based on where it was used
path.exact = 1.0
path.ancestor = 0.5
path.descendant = 0.25
path.unrelated = 0.1

Variable Scoring Parameters

KeyDescription
context.pointsTotal points assigned for matching the context (i.e., other variable values already selected)
path.pointsTotal points assigned based on the value's usage history relative to the current directory
path.exactMultiplier for a value used in the exact same directory
path.ancestorMultiplier for a value used in a parent directory
path.descendantMultiplier for a value used in a child directory
path.unrelatedMultiplier for a value used in an unrelated directory

This concludes the configuration guide. With your setup perfectly tuned, let's dive into the detailed breakdown of each Command Line Tool.