### Install IntelliShell using curl (Linux/macOS/Git Bash/WSL) Source: https://lasantosr.github.io/intelli-shell/guide/installation Installs IntelliShell by downloading and executing an installation script from GitHub. This method automatically detects the OS and architecture, downloads the correct binary, and sets up shell integration. It can be skipped by setting INTELLI_SKIP_PROFILE=1. ```bash curl -sSf https://raw.githubusercontent.com/lasantosr/intelli-shell/main/install.sh | sh ``` -------------------------------- ### Install IntelliShell using cargo-binstall Source: https://lasantosr.github.io/intelli-shell/guide/installation Installs IntelliShell using the cargo-binstall tool, which installs pre-compiled binaries. This is an alternative to building from source. Manual shell integration is required after installation. ```rust cargo binstall intelli-shell --locked ``` -------------------------------- ### Build and Install IntelliShell from Source using Cargo Source: https://lasantosr.github.io/intelli-shell/guide/installation Installs IntelliShell by compiling it directly from crates.io using the Rust toolchain. This method requires the Microsoft Visual C++ Redistributable on Windows and allows for specific build flags like LIBSQLITE3_FLAGS. Manual shell integration is required after installation. ```rust LIBSQLITE3_FLAGS="-DSQLITE_ENABLE_MATH_FUNCTIONS" cargo install intelli-shell --locked ``` -------------------------------- ### Configure IntelliShell Shell Integration for Bash Source: https://lasantosr.github.io/intelli-shell/guide/installation Enables IntelliShell's interactive features and hotkeys by adding an initialization command to the Bash profile file (`~/.bashrc` or `~/.bash_profile`). This should be run after manual installation or if the installer script was skipped. ```bash eval "$(intelli-shell init bash)" ``` -------------------------------- ### Install IntelliShell using PowerShell script Source: https://lasantosr.github.io/intelli-shell/guide/installation Installs IntelliShell on Windows using PowerShell. It first sets the execution policy to allow script execution and then downloads and runs the installation script from GitHub. This method also handles shell integration automatically. ```powershell Set-ExecutionPolicy RemoteSigned -Scope CurrentUser irm https://raw.githubusercontent.com/lasantosr/intelli-shell/main/install.ps1 | iex ``` -------------------------------- ### Configure IntelliShell Shell Integration for Fish Source: https://lasantosr.github.io/intelli-shell/guide/installation Enables IntelliShell's interactive features and hotkeys by sourcing an initialization script into the Fish shell's configuration file (`~/.config/fish/config.fish`). This command should be executed after manual installation. ```fish intelli-shell init fish | source ``` -------------------------------- ### Configure IntelliShell Shell Integration for Nushell Source: https://lasantosr.github.io/intelli-shell/guide/installation Enables IntelliShell's interactive features for Nushell by saving the initialization script to the vendor autoload directory. This ensures IntelliShell is loaded automatically when Nushell starts. This is required for manual installations. ```powershell mkdir ($nu.data-dir | path join "vendor/autoload") intelli-shell init nushell | save -f ($nu.data-dir | path join "vendor/autoload/intelli-shell.nu") ``` -------------------------------- ### Docker Command Example Source: https://lasantosr.github.io/intelli-shell/guide/basic_usage This is a basic example of a docker run command with a placeholder for the image name, used to demonstrate bookmarking and variable replacement in IntelliShell. ```shell docker run -it --rm {{image}} ``` -------------------------------- ### Install IntelliShell Binary and Configure Shell Integration Source: https://lasantosr.github.io/intelli-shell/print This command downloads and executes an installation script that automatically detects your OS and architecture, downloads the correct binary, and sets up shell integration for shells like Bash, Zsh, and PowerShell. It's the recommended method for quick setup. To skip automatic profile updates, set the INTELLI_SKIP_PROFILE=1 environment variable. ```shell curl -sSf https://raw.githubusercontent.com/lasantosr/intelli-shell/main/install.sh | sh ``` -------------------------------- ### Configure IntelliShell Shell Integration for Zsh Source: https://lasantosr.github.io/intelli-shell/guide/installation Enables IntelliShell's interactive features and hotkeys by adding an initialization command to the Zsh configuration file (`~/.zshrc`). This is necessary for users who installed IntelliShell manually or skipped shell integration during automatic installation. ```zsh eval "$(intelli-shell init zsh)" ``` -------------------------------- ### Fetch tldr Command Examples into IntelliShell Library Source: https://lasantosr.github.io/intelli-shell/print The 'tldr fetch' command downloads command examples from the official tldr pages repository and imports them into your IntelliShell library. These examples are stored in a separate 'tldr' category to avoid mixing with personal bookmarks. Re-running the command updates the local copy. ```bash intelli-shell tldr fetch ``` ```bash intelli-shell tldr fetch common ``` ```bash intelli-shell tldr fetch --command git --command docker ``` -------------------------------- ### Import Commands from tldr Pages Source: https://lasantosr.github.io/intelli-shell/guide/basic_usage Populate IntelliShell with command templates from the tldr pages project. This helps in quickly getting examples for new tools. Commands are imported into a separate 'tldr' space. ```shell intelli-shell tldr fetch -c tar -c git ``` -------------------------------- ### Configure IntelliShell Shell Integration for PowerShell Source: https://lasantosr.github.io/intelli-shell/guide/installation Enables IntelliShell's interactive features and hotkeys for PowerShell by invoking the initialization command sourced from the IntelliShell executable. This is required when IntelliShell is installed manually or if shell integration was skipped. ```powershell intelli-shell init powershell | Out-String | Invoke-Expression ``` -------------------------------- ### Install and Integrate IntelliShell (Bash, PowerShell, Cargo) Source: https://context7.com/context7/lasantosr_github_io_intelli-shell/llms.txt Instructions for installing IntelliShell using various methods including a curl script for Linux/macOS, PowerShell for Windows, and Cargo for manual installation. It also covers shell integration commands for Bash and Zsh, and setting custom hotkeys. ```bash # Automatic installation (Linux/macOS) curl -sSf https://raw.githubusercontent.com/lasantosr/intelli-shell/main/install.sh | sh # Shell integration (add to ~/.bashrc, ~/.zshrc, etc.) eval "$(intelli-shell init bash)" # Bash eval "$(intelli-shell init zsh)" # Zsh # Custom hotkeys (set before init command) export INTELLI_SEARCH_HOTKEY="\C-t" # Change search from ctrl+space to ctrl+t export INTELLI_BOOKMARK_HOTKEY="\C-b" # Bookmark hotkey export INTELLI_VARIABLE_HOTKEY="\C-l" # Variable replacement hotkey export INTELLI_FIX_HOTKEY="\C-x" # AI fix hotkey export INTELLI_SKIP_ESC_BIND=1 # Disable ESC to clear line ``` ```powershell # Windows PowerShell Set-ExecutionPolicy RemoteSigned -Scope CurrentUser irm https://raw.githubusercontent.com/lasantosr/intelli-shell/main/install.ps1 | iex ``` ```bash # Manual installation with Cargo LIBSQLITE3_FLAGS="-DSQLITE_ENABLE_MATH_FUNCTIONS" cargo install intelli-shell --locked # Verify installation intelli-shell --version # Shell integration for Fish intelli-shell init fish | source ``` -------------------------------- ### Fetch tldr pages for current OS Source: https://lasantosr.github.io/intelli-shell/reference/tldr_fetch This command downloads command examples from the tldr pages repository relevant to your current operating system and the common pages. It's the simplest way to populate your IntelliShell library with useful command examples. ```bash intelli-shell tldr fetch ``` -------------------------------- ### Git Command Example with Hashtag Source: https://lasantosr.github.io/intelli-shell/guide/basic_usage An example of a git command to checkout a branch, including a description with a hashtag. This showcases how hashtags can be used for categorizing and filtering commands in IntelliShell. ```shell git checkout {{branch}} ``` -------------------------------- ### Example: Interactive Completion with AI Assistance Source: https://lasantosr.github.io/intelli-shell/reference/completion_new This example opens the interactive TUI to add a completion for the 'container' variable. The `--ai` flag enables AI to suggest the provider command, which can be reviewed before saving. ```bash intelli-shell completion new -i --ai container ``` -------------------------------- ### Fetch specific tldr category Source: https://lasantosr.github.io/intelli-shell/reference/tldr_fetch This command fetches tldr pages for a specified category from the official repository. You can use this to get examples for a particular collection of commands, like 'common', or platform-specific ones if not automatically fetched. ```bash intelli-shell tldr fetch common ``` -------------------------------- ### Verify IntelliShell Installation Source: https://lasantosr.github.io/intelli-shell/print This command checks if IntelliShell is installed and accessible in your system's PATH by printing its version. A successful output indicates that the installation was successful and the tool is ready to be used. ```bash intelli-shell --version ``` -------------------------------- ### Example: Global Completion for 'remote' Variable Source: https://lasantosr.github.io/intelli-shell/reference/completion_new This example demonstrates how to add a global dynamic completion for any variable named 'remote'. The 'git remote' command will be executed to provide suggestions. ```bash intelli-shell completion new remote "git remote" ``` -------------------------------- ### Fetch specific tldr commands Source: https://lasantosr.github.io/intelli-shell/reference/tldr_fetch This command allows you to fetch tldr examples for one or more specific commands. Use the '--command' flag followed by the command name. This option can be repeated to specify multiple commands. ```bash intelli-shell tldr fetch --command git --command docker ``` -------------------------------- ### Define Commands and Completions in IntelliShell Source: https://lasantosr.github.io/intelli-shell/guide/syncing Demonstrates the syntax for defining commands, aliases, descriptions, and dynamic variable completions in IntelliShell's configuration files. Comments preceding a command define its description, and lines starting with '$' define completions. ```shell # A multi-line description for a command # with a #hashtag for organization. git log --oneline --graph --decorate # [alias:tfp] Plan infrastructure changes for a specific environment. # This command is multi-line for readability. terraform plan \ -var-file="envs/{{env}}.tfvars" # A global completion for any `{{branch}}` variable. $ branch: git branch --format='%(refname:short)' # A command-specific completion for the `{{env}}` variable when using `terraform`. $ (terraform) env: find envs -type f -name "*.tfvars" -printf "%P\n" | sort | sed 's/\.tfvars$//' ``` -------------------------------- ### Define Workspace Commands with .intellishell Source: https://lasantosr.github.io/intelli-shell/guide/workspace This snippet demonstrates the structure of an `.intellishell` file used to define workspace-specific commands and completions. Comments before commands serve as descriptions. It includes examples for Terraform operations like formatting, planning, applying, and state management, along with custom completions for environments and resources. ```shell #!intelli-shell # Format all Terraform files in the project terraform fmt -recursive # [alias:tfp] Plan infrastructure changes for a specific environment terraform plan -var-file="envs/{{env}}.tfvars" # [alias:tfa] Apply infrastructure changes for a specific environment terraform apply -var-file="envs/{{env}}.tfvars" # Show the state for a specific resource terraform state show '{{resource}}' ## -- Completions -- $ (terraform) env: find envs -type f -name "*.tfvars" -printf "%P\n" | sort | sed 's/\.tfvars$//' $ (terraform) resource: terraform state list ``` -------------------------------- ### Import Commands with Tags Source: https://lasantosr.github.io/intelli-shell/guide/syncing Add tags to imported commands for better organization using the --add-tag flag. This example imports commands from a file and tags them with '#project'. ```bash intelli-shell import -t project path/to/commands.file ``` -------------------------------- ### Make IntelliShell Executable Source: https://lasantosr.github.io/intelli-shell/print Ensures the 'intelli-shell' binary has execute permissions. This is crucial if you installed manually or are facing permission errors. ```shell # Find the binary and make it executable chmod +x "$(which intelli-shell)" ``` -------------------------------- ### Configure IntelliShell Key Bindings (TOML) Source: https://lasantosr.github.io/intelli-shell/configuration/keybindings Example TOML configuration for IntelliShell's key bindings. This section allows users to customize actions like quitting, updating, deleting, confirming, executing, AI prompting, and search mode toggling by mapping them to specific key combinations. ```toml # Configuration for the key bindings used to interact with the Terminal User Interface (TUI). # Key bindings map an action within the application to one or more key press combinations. # # Each action can be bound to a single key event string or a list of key event strings. # If a list is provided, pressing any of the listed combinations will trigger the action. # # Key event strings are parsed from a simple format: # - Modifiers (optional, separated by `-` or `+`): `ctrl`, `shift`, `alt` # - Followed by the key name or character [keybindings] # Exit the TUI gracefully quit = "esc" # Update the currently highlighted record or item (e.g., edit a command) update = ["ctrl-u", "ctrl-e", "F2"] # Delete the currently highlighted record or item delete = "ctrl-d" # Confirm a selection or action related to the highlighted record confirm = ["tab", "enter"] # Execute the action associated with the highlighted record or item (e.g., run a command) execute = ["ctrl-enter", "ctrl-r"] # Prompt ai about suggestions (e.g. when searching for commands) ai = ["ctrl-i", "ctrl-x"] # Toggle the search mode search_mode = "ctrl-s" # Toggle whether to search for user commands only or include workspace and tldr's search_user_only = "ctrl-o" ``` -------------------------------- ### Fetch and List TLDR Pages - IntelliShell Source: https://context7.com/context7/lasantosr_github_io_intelli-shell/llms.txt Fetch tldr pages for specific commands or an entire platform, list cached commands, and clear the tldr cache. This functionality helps bootstrap your command library with community-driven examples. ```bash # Fetch tldr pages for specific commands intelli-shell tldr fetch -c tar -c git # Fetch all pages for a platform intelli-shell tldr fetch --platform linux # List cached tldr commands intelli-shell tldr list # Clear tldr cache intelli-shell tldr clear ``` -------------------------------- ### Export Docker Commands with Regex Filter Source: https://lasantosr.github.io/intelli-shell/guide/syncing Filter commands for export using a regular expression. This example exports only commands starting with 'docker' to a local file, ensuring only relevant completions are included. ```bash intelli-shell export --filter "^docker" docker_commands.sh ``` -------------------------------- ### Run IntelliShell Update Command Source: https://lasantosr.github.io/intelli-shell/reference/update This command initiates the process to check for and apply updates to IntelliShell. It works by downloading the latest release and replacing the current executable if installed via the official script. For other installation methods, it provides instructions on how to update manually. ```shell intelli-shell update ``` -------------------------------- ### Example: Command-Specific Completion for 'branch' Source: https://lasantosr.github.io/intelli-shell/reference/completion_new This example shows how to add a dynamic completion for the 'branch' variable, but only when used with the 'git' command. The 'git branch --format='%(refname:short)'' command provides the suggestions. ```bash intelli-shell completion new --command git branch "git branch --format='%(refname:short)'" ``` -------------------------------- ### Example: Neon Theme Configuration (TOML) Source: https://lasantosr.github.io/intelli-shell/configuration/theming An example TOML configuration for a 'Neon' theme in IntelliShell, featuring bright, vivid colors. It showcases the use of specific ANSI 8-bit indexed colors and RGB values for a vibrant terminal experience. The 'highlight' setting is set to 'none' to disable background highlighting for list items. ```toml [theme] primary = "default" secondary = "dim" accent = "136" comment = "rgb(106, 153, 66)" error = "dark red" highlight = "none" highlight_symbol = "» " highlight_primary = "220" highlight_secondary = "222" highlight_accent = "208" highlight_comment = "rgb(143, 221, 75)" ``` -------------------------------- ### Clear All Imported tldr Commands - IntelliShell Source: https://lasantosr.github.io/intelli-shell/reference/tldr_clear Removes all tldr command examples from the IntelliShell library. This is useful for resetting the tldr command cache or starting fresh with tldr examples. It does not affect user-created bookmarks. ```shell intelli-shell tldr clear ``` -------------------------------- ### Configure OpenAI Model in IntelliShell Source: https://lasantosr.github.io/intelli-shell/configuration/ai Example configuration to integrate an OpenAI model, such as GPT-4o, into IntelliShell. Ensure the OPENAI_API_KEY environment variable is set with a valid key. This snippet defines a new model alias 'gpt-4o' within the AI catalog. ```ini [ai.catalog.gpt-4o] provider = "openai" model = "gpt-4o" ``` -------------------------------- ### Setting AI API Keys Source: https://context7.com/context7/lasantosr_github_io_intelli-shell/llms.txt Sets environment variables for AI API keys required by Intelli-Shell. Examples are provided for Google Gemini, OpenAI, Anthropic, and local Ollama configurations. Dependencies: Shell environment. Input: API key string. Output: Environment variable set. ```bash export GEMINI_API_KEY="your-api-key-here" # export OPENAI_API_KEY="your-key" # export ANTHROPIC_API_KEY="your-key" ``` -------------------------------- ### IntelliShell `fix` Example: Git Command Typo Source: https://lasantosr.github.io/intelli-shell/reference/fix Illustrates how `intelli-shell fix` corrects a common typo in a Git command. The example shows the original command, the error output (diagnostics to stderr), and the corrected command printed to stdout, demonstrating its programmatic usability. ```shell intelli-shell fix "git comit amend" ``` -------------------------------- ### Register Kubernetes Namespace Completion (Shell) Source: https://lasantosr.github.io/intelli-shell/guide/variables Registers a command-scoped completion for the 'kubectl namespace' command. It executes 'kubectl get ns --no-headers -o custom-columns=':.metadata.name'' to list all available Kubernetes namespaces, providing suggestions for the '{{namespace}}' variable. ```shell intelli-shell completion new --command kubectl namespace "kubectl get ns --no-headers -o custom-columns=':.metadata.name'" ``` -------------------------------- ### Make IntelliShell Binary Executable Source: https://lasantosr.github.io/intelli-shell/troubleshooting Ensures the 'intelli-shell' binary has execute permissions. This is typically done after manual installation or if permission issues arise. It uses the `chmod` command to modify file permissions and `which` to locate the binary. ```shell chmod +x "$(which intelli-shell)" ``` -------------------------------- ### Clear Specific Category of tldr Commands - IntelliShell Source: https://lasantosr.github.io/intelli-shell/reference/tldr_clear Removes tldr command examples for a specified category (e.g., 'osx') from the IntelliShell library. This allows for granular control over which tldr examples are kept. User-created bookmarks are unaffected. ```shell # Remove only the macOS-specific commands intelli-shell tldr clear osx ``` -------------------------------- ### Register Context-Aware Pod Completion (Shell) Source: https://lasantosr.github.io/intelli-shell/guide/variables Registers a context-aware completion for the 'kubectl pod' command. This completion uses the '{{namespace}}' variable to filter suggestions, executing 'kubectl get pods {{-n {{namespace}}}} --no-headers -o custom-columns=':.metadata.name''. This ensures pod suggestions are relevant to the selected namespace. ```shell intelli-shell completion new --command kubectl pod "kubectl get pods {{-n {{namespace}}}} --no-headers -o custom-columns=':.metadata.name'" ``` -------------------------------- ### Configure Local Ollama Model in IntelliShell Source: https://lasantosr.github.io/intelli-shell/configuration/ai Example configuration for using a local model with Ollama in IntelliShell. The OLLAMA_API_KEY environment variable is typically not required for local instances. This snippet defines 'llama3' as a local model alias. If Ollama is on a different host, the URL can be specified. ```ini [ai.catalog.local-llama] provider = "ollama" model = "llama3" # If Ollama is running on a different host, specify the URL: ``` -------------------------------- ### Clear Imported tldr Commands from IntelliShell Library Source: https://lasantosr.github.io/intelli-shell/print The 'tldr clear' command removes command examples previously imported from tldr pages. This allows for cleanup of the library without affecting personal bookmarks. If no category is specified, all tldr commands are removed. ```bash intelli-shell tldr clear ``` ```bash # Remove only the macOS-specific commands intelli-shell tldr clear osx ``` -------------------------------- ### Configure Logging Filter (TOML) Source: https://lasantosr.github.io/intelli-shell/print Sets the logging filter level for the application using the tracing-subscriber environment filter syntax. This controls which log messages are recorded, with examples showing how to set global levels or specific module levels. ```TOML filter = "info" ``` -------------------------------- ### Configure Anthropic Claude Model in IntelliShell Source: https://lasantosr.github.io/intelli-shell/configuration/ai Example configuration to integrate an Anthropic Claude model, like Claude 4.0 Sonnet, into IntelliShell. The ANTHROPIC_API_KEY environment variable must be set. This snippet adds 'claude-sonnet-4-0' as a provider model alias. ```ini [ai.catalog.claude-sonnet] provider = "anthropic" model = "claude-sonnet-4-0" ``` -------------------------------- ### Capturing Corrected Command in a Shell Variable Source: https://lasantosr.github.io/intelli-shell/reference/fix Demonstrates a practical scripting example of how to capture the corrected command output from `intelli-shell fix` into a shell variable. This showcases the utility of `fix` in automated workflows where command output needs to be processed. ```shell fixed_cmd=$(intelli-shell fix "git comit amend") ``` -------------------------------- ### Example: Gruvbox Inspired Theme Configuration (TOML) Source: https://lasantosr.github.io/intelli-shell/configuration/theming This TOML configuration demonstrates a theme inspired by the Gruvbox color scheme, characterized by warm, retro tones. It utilizes hexadecimal color codes, bold modifiers, and italic attributes to achieve a distinct visual style. The 'highlight_secondary' uses a 'dim' modifier alongside a hexadecimal color. ```toml [theme] primary = "#ebdbb2" secondary = "#a89984" accent = "bold #b8bb26" comment = "italic #928374" error = "bold #fb4934" highlight = "#458588" highlight_symbol = "» " highlight_primary = "#ebdbb2" highlight_secondary = "dim #ebdbb2" highlight_accent = "bold #fabd2f" highlight_comment = "italic dim #ebdbb2" ``` -------------------------------- ### Import Commands from Text Sources using AI Source: https://lasantosr.github.io/intelli-shell/guide/basic_usage Use the AI to extract and convert commands from any text source, including blog posts, tutorials, or shell history. The AI parses the content and creates reusable templates with variables. ```shell intelli-shell import -i --ai --history bash ``` ```shell intelli-shell import -i --ai "https://my-favorite-cheatsheet.com" ``` -------------------------------- ### Bookmark Commands with IntelliShell Source: https://context7.com/context7/lasantosr_github_io_intelli-shell/llms.txt Demonstrates how to save commands as reusable snippets (bookmarks) in IntelliShell. It covers non-interactive, interactive, and AI-generated bookmarking, including options for aliases and descriptions. ```bash # Non-interactive: bookmark a simple command intelli-shell new 'docker ps -a' # With alias and description intelli-shell new 'docker run -it --rm {{image}}' \ --alias 'dr' \ --description 'Run a temporary docker image #docker' # Interactive mode: opens TUI to add details intelli-shell new -i 'git checkout {{branch}}' # AI-generated command from description intelli-shell new -i --ai 'undo last n commits' ``` -------------------------------- ### Bookmark command using AI with interactive review Source: https://lasantosr.github.io/intelli-shell/reference/new Leverages AI to generate a command and its description based on a natural language prompt. The `-i` flag is recommended to review and edit the AI's suggestions before saving, ensuring accuracy. ```bash intelli-shell new -i --ai 'undo last n commits' ``` -------------------------------- ### IntelliShell Local File Backup and Restore Source: https://lasantosr.github.io/intelli-shell/guide/syncing Shows how to export your IntelliShell command library to a local backup file and how to restore it from that file. This is the simplest method for creating a portable snapshot. ```shell # Back up to a file intelli-shell export my_commands.bak # Restore from the file intelli-shell import my_commands.bak ``` -------------------------------- ### Connect to Groq using OpenAI-Compatible API Source: https://lasantosr.github.io/intelli-shell/configuration/ai This configuration connects IntelliShell to Groq for high-speed inference using a Llama 3 model. It specifies the 'openai' provider, the 'llama-3.1-8b-instant' model, the Groq API endpoint, and the environment variable for the API key. ```toml [ai.catalog.groq-llama] provider = "openai" model = "llama-3.1-8b-instant" url = "https://api.groq.com/openai/v1" api_key_env = "GROQ_API_KEY" ``` -------------------------------- ### Configure Groq OpenAI-Compatible Endpoint Source: https://lasantosr.github.io/intelli-shell/print This configuration connects to Groq's high-speed inference service using an OpenAI-compatible endpoint. It specifies the provider as 'openai', the model as 'llama-3.1-8b-instant', the API URL, and the environment variable for the API key. ```toml [ai.catalog.groq-llama] provider = "openai" model = "llama-3.1-8b-instant" url = "https://api.groq.com/openai/v1" api_key_env = "GROQ_API_KEY" ``` -------------------------------- ### Bookmark command interactively with pre-filled details Source: https://lasantosr.github.io/intelli-shell/reference/new Initiates the interactive TUI to bookmark a command, pre-filling the command string. This allows for manual addition of alias and description within the TUI. ```bash intelli-shell new -i 'git checkout {{branch}}' ``` -------------------------------- ### Bookmark command with alias and description Source: https://lasantosr.github.io/intelli-shell/reference/new Adds a command to the IntelliShell library with a specified alias and description. The description can include hashtags for organization. This provides a more searchable and organized bookmark. ```bash intelli-shell new 'docker run -it --rm {{image}}' --alias 'dr' --description 'Run a temporary docker image #docker' ``` -------------------------------- ### Generate Shell Commands from Natural Language Descriptions Source: https://lasantosr.github.io/intelli-shell/guide/basic_usage Open the IntelliShell search UI with Ctrl+Space, describe the desired command in natural language (e.g., 'find all files larger than 10MB'), and press Ctrl+I to generate the command. ```shell find . -type f -size +10M ``` -------------------------------- ### Search and Execute IntelliShell Commands Source: https://context7.com/context7/lasantosr_github_io_intelli-shell/llms.txt Illustrates how to find and execute saved commands using IntelliShell. It includes interactive and non-interactive search options, specific search modes, full-screen interactive mode, and AI-powered command generation. ```bash # Interactive search (equivalent to ctrl+space hotkey) intelli-shell search --interactive # Non-interactive search (prints to stdout) intelli-shell search docker # Search with specific mode intelli-shell search -m exact --user-only docker # Full-screen interactive mode intelli-shell search -i --full-screen # AI-powered command generation from natural language intelli-shell search -i --ai 'find all files larger than 10MB in current folder' # Advanced fuzzy search syntax examples: # Exclude term: docker !test # Exact substring: 'docker-compose' # Whole word: 'docker' # Prefix: ^git # Suffix: .sh$ # Inverse: !deprecated # OR operator: docker | kubernetes nginx ``` -------------------------------- ### Intelli-Shell Command Export and Import Source: https://context7.com/context7/lasantosr_github_io_intelli-shell/llms.txt Enables synchronization and sharing of command libraries across machines or teams. Supports exporting/importing to local files, GitHub Gists, and HTTP endpoints, with options for filtering, interactive review, and AI-powered import from history or URLs. Dependencies: Intelli-Shell. Input: File paths, Gist IDs, URLs, filters. Output: Synchronized command library. ```bash # Export to local file intelli-shell export my_commands.bak # Import from local file intelli-shell import my_commands.bak # Export to GitHub Gist (requires GIST_TOKEN) export GIST_TOKEN="ghp_your_token_here" intelli-shell export --gist 137846d029efcc59468ff2c9d2098b4f # Import from Gist URL intelli-shell import https://gist.github.com/lasantosr/137846d029efcc59468ff2c9d2098b4f # Import specific file from Gist intelli-shell import --gist 137846d029efcc59468ff2c9d2098b4f/docker.sh # Export to HTTP endpoint with authentication intelli-shell export -H "Authorization: Bearer my-token" \ -X POST https://my-api.com/commands # Filter export: only docker commands intelli-shell export --filter "docker" docker_commands.sh # Interactive export: review before saving intelli-shell export -i --filter "docker" docker_commands.bak # Dry run: preview import without saving intelli-shell import --dry-run https://example.com/commands.sh # Add tags during import intelli-shell import -t work -t production prod_commands.sh # AI-powered import from shell history intelli-shell import -i --ai --history bash # AI-powered import from URL intelli-shell import -i --ai "https://my-favorite-cheatsheet.com" ``` -------------------------------- ### Define AI Model Catalog for IntelliShell Source: https://lasantosr.github.io/intelli-shell/configuration/ai This configuration section defines the connection details for AI models used by IntelliShell. It allows specifying the provider (e.g., 'gemini') and the specific model name (e.g., 'gemini-flash-latest') for aliases like 'main' and 'fallback'. ```ini [ai.catalog.main] provider = "gemini" model = "gemini-flash-latest" [ai.catalog.fallback] provider = "gemini" model = "gemini-flash-lite-latest" ``` -------------------------------- ### Intelli-Shell Completion Management Source: https://context7.com/context7/lasantosr_github_io_intelli-shell/llms.txt Manages command completions for various scenarios, including global, command-specific, and context-aware completions. It allows for creating, listing, and deleting completions. Dependencies: Intelli-Shell. Input: Command name, completion script. Output: Configured completion. ```bash intelli-shell completion new branch "git branch --format='%(refname:short)'" intelli-shell completion new --command git branch "git branch --format='%(refname:short)'" intelli-shell completion new user "awk -F: '$3 >= 1000 {print $1}' /etc/passwd" intelli-shell completion new --command kubectl namespace "kubectl get ns --no-headers -o custom-columns=':.metadata.name'" intelli-shell completion new --command kubectl pod "kubectl get pods {{-n {{namespace}}}} --no-headers -o custom-columns=':.metadata.name'" intelli-shell completion list intelli-shell completion delete --command git branch ``` -------------------------------- ### Interactively Browse IntelliShell Completions Source: https://lasantosr.github.io/intelli-shell/reference/completion_list This command opens an interactive Text-based User Interface (TUI) to browse, edit, and delete completions. It allows users to preview suggestions in real-time, providing a dynamic way to manage completions. ```shell intelli-shell completion list -i ``` -------------------------------- ### Groq OpenAI-Compatible Endpoint Configuration Source: https://lasantosr.github.io/intelli-shell/configuration/ai Connect to Groq's high-speed inference for Llama 3 models using their OpenAI-compatible API. ```APIDOC ## Groq OpenAI-Compatible Endpoint ### Description Connect to Groq's high-speed inference for Llama 3 models using their OpenAI-compatible API. ### Method Configuration (Not an HTTP method) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```toml [ai.catalog.groq-llama] provider = "openai" model = "llama-3.1-8b-instant" url = "https://api.groq.com/openai/v1" api_key_env = "GROQ_API_KEY" ``` ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### IntelliShell Custom System Prompts Source: https://lasantosr.github.io/intelli-shell/configuration/ai Customize system prompts for 'suggest', 'fix', and 'completion' tasks to control AI behavior, tone, and output format. ```APIDOC ## IntelliShell Custom System Prompts ### Description Customize system prompts for 'suggest', 'fix', and 'completion' tasks to control AI behavior, tone, and output format. Use special placeholders for contextual information. ### Method Configuration (Not an HTTP method) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```toml [ai.prompts] # Example for 'suggest' task (actual prompts are more detailed) suggest = "You are an AI assistant. Your task is to suggest commands. ##OS_SHELL_INFO## ##WORKING_DIR##" fix = "You are an AI assistant. Your task is to fix commands. ##OS_SHELL_INFO## ##WORKING_DIR## ##SHELL_HISTORY##" completion = "You are an AI assistant. Your task is to complete commands. ##OS_SHELL_INFO## ##WORKING_DIR##" ``` ### Available Placeholders - `##OS_SHELL_INFO##`: Replaced with details about the current operating system and shell. - `##WORKING_DIR##`: Replaced with the current working directory path and a tree-like view of its contents. - `##SHELL_HISTORY##`: Replaced with the last few commands from the shell's history (only available for the `fix` prompt). ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Generate Shell Command with AI Source: https://lasantosr.github.io/intelli-shell/print Use IntelliShell's AI to generate shell commands by describing the desired task. Press Ctrl+Space to open the search UI, type your description, and then press Ctrl+I to generate the command. Generated commands are for one-time use unless bookmarked. ```shell # Example: find all files larger than 10MB in the current folder find . -type f -size +10M ``` -------------------------------- ### Enable AI Integration in IntelliShell Source: https://lasantosr.github.io/intelli-shell/configuration/ai This configuration snippet shows how to globally enable AI-powered functionality in IntelliShell. Ensure you have the necessary API keys set as environment variables for the chosen AI provider. ```ini [ai] # A global switch to enable or disable all AI-powered functionality enabled = false ``` -------------------------------- ### Preview IntelliShell Import with Dry Run Source: https://lasantosr.github.io/intelli-shell/troubleshooting Allows users to test the import process for commands and their associated data without actually modifying the IntelliShell database. The `--dry-run` flag helps diagnose formatting issues in the import file before making permanent changes. ```shell intelli-shell import --dry-run /path/to/commands.txt ``` -------------------------------- ### IntelliShell GitHub Gist Integration Source: https://lasantosr.github.io/intelli-shell/guide/syncing Illustrates exporting and importing IntelliShell libraries to/from GitHub Gists. This method is useful for cloud synchronization across devices or sharing with teammates. It requires a GitHub Personal Access Token with 'gist' scope for exporting. ```shell # The --gist flag is required when the location could be mistaken for a file name intelli-shell export --gist 137846d029efcc59468ff2c9d2098b4f/command.sh # Or use the URL intelli-shell import https://gist.github.com/lasantosr/137846d029efcc59468ff2c9d2098b4f ``` -------------------------------- ### Import Commands from Public Gists Source: https://lasantosr.github.io/intelli-shell/guide/basic_usage Import command collections shared by the community from public Gists. This allows for easy sharing and discovery of tool-specific workflows. You can import all commands or from a specific file. ```shell intelli-shell import https://gist.github.com/lasantosr/137846d029efcc59468ff2c9d2098b4f ``` ```shell intelli-shell import --gist 137846d029efcc59468ff2c9d2098b4f/docker.sh ``` -------------------------------- ### IntelliShell CLI Basic Structure Source: https://lasantosr.github.io/intelli-shell/reference/index Defines the fundamental syntax for executing IntelliShell commands from the command line. This structure is used for all subcommands and their associated options and arguments. ```bash intelli-shell [SUBCOMMAND] [OPTIONS] [ARGS] ``` -------------------------------- ### Connect to xAI using OpenAI-Compatible API Source: https://lasantosr.github.io/intelli-shell/configuration/ai This configuration allows IntelliShell to connect to xAI's models, such as 'grok-4'. It sets the provider to 'openai', specifies the model, the xAI API endpoint, and the environment variable for the API key. ```toml [ai.model.grok] provider = "openai" model = "grok-4" url = "https://api.x.ai/v1" api_key_env = "XAI_API_KEY" ``` -------------------------------- ### IntelliShell Default Gist Sync Source: https://lasantosr.github.io/intelli-shell/guide/syncing Demonstrates how to use a configured default Gist for exporting and importing IntelliShell libraries. When a default Gist is set, you can use the keyword 'gist' to sync with it. ```shell # Export to the default Gist intelli-shell export gist # Import from the default Gist intelli-shell import gist ``` -------------------------------- ### IntelliShell CLI: Import commands from a GitHub Gist Source: https://lasantosr.github.io/intelli-shell/reference/import This command imports shell commands and completions from a GitHub Gist. It's useful for sharing and onboarding commands provided by others in the community or by teammates. ```bash intelli-shell import https://gist.github.com/lasantosr/137846d029efcc59468ff2c9d2098b4f ``` -------------------------------- ### Configure AI Model Catalog for IntelliShell Source: https://lasantosr.github.io/intelli-shell/print This TOML configuration section defines the AI models available in IntelliShell's catalog. Each entry, identified by an alias (e.g., 'main', 'fallback'), specifies the AI provider and the exact model name to be used. This allows IntelliShell to connect to different AI services. ```toml __ [ai.catalog.main] provider = "gemini" model = "gemini-flash-latest" [ai.catalog.fallback] provider = "gemini" model = "gemini-flash-lite-latest" ``` -------------------------------- ### Display All IntelliShell Completions Source: https://lasantosr.github.io/intelli-shell/reference/completion_list This command displays all configured dynamic variable completions, both global and command-specific, in a non-interactive format. It is useful for a general overview of available completions. ```shell intelli-shell completion list ``` -------------------------------- ### Registering Global Dynamic Completions in IntelliShell Source: https://lasantosr.github.io/intelli-shell/print Create a global completion for a variable name that applies to any command by omitting the --command flag. This is ideal for universally useful variables like system usernames. Command-specific completions always take precedence over global ones. ```shell # A global completion for `{{user}}`, useful for commands like `chown {{user}} ...` intelli-shell completion new user "awk -F: '\$3 >= 1000 {print \$1}' /etc/passwd" ``` -------------------------------- ### IntelliShell Variable Templates and Formatting Source: https://context7.com/context7/lasantosr_github_io_intelli-shell/llms.txt Explains IntelliShell's variable templating feature, allowing dynamic commands. It covers basic variable syntax, secret variables, predefined options, and variable formatting functions like kebab-case, URL encoding, and chaining functions. ```bash # Basic variable syntax echo "Hello, {{user}}!" # Secret variables (not saved in history) curl -u user:{{{password}}} https://api.example.com/data # Variables with predefined options docker-compose {{up|down|logs}} # Variable formatting functions git checkout -b feature/{{description:kebab}} # Input: "My New Feature" → Output: "feature/my-new-feature" # Available functions: # kebab: My Project → My-Project # snake: My Project → My_Project # upper: hello → HELLO # lower: HELLO → hello # url: a/b?c=1 → a%2Fb%3Fc%3D1 # Chain multiple functions echo {{text:lower:url}} # Variable replacement without saving (ctrl+l hotkey) # Type: ssh {{hostname}} # Press ctrl+l to fill in {{hostname}} without searching bookmarks ``` -------------------------------- ### Predefined Options for IntelliShell Variables Source: https://lasantosr.github.io/intelli-shell/guide/variables Shows how to define a list of predefined options for a variable using the pipe `|` character. These options appear as 'derived' suggestions in the IntelliShell UI, useful for commands with known subcommands. ```shell docker-compose {{up|down|logs}} ``` -------------------------------- ### Configure IntelliShell Data Directory Source: https://lasantosr.github.io/intelli-shell/configuration/general Specifies the directory for IntelliShell data, including command database and logs. Defaults to system-specific locations if left empty. Can be overridden by the `INTELLI_STORAGE` environment variable for database file path. ```toml # The default directory for application data, such as the stored commands database. # If this value is left empty, the application will use the system's default data directory: # - ~/.local/share/intelli-shell (on Linux, unless overridden by XDG_DATA_HOME) # - ~/Library/Application Support/org.IntelliShell.Intelli-Shell (on macOS) # - %APPDATA%\IntelliShell\Intelli-Shell\data (on Windows) data_dir = "" ``` -------------------------------- ### Configure xAI OpenAI-Compatible Endpoint Source: https://lasantosr.github.io/intelli-shell/print This configuration connects to xAI's models using an OpenAI-compatible endpoint. It sets the provider to 'openai', the model to 'grok-4', the API URL, and the environment variable for the API key. ```toml [ai.model.grok] provider = "openai" model = "grok-4" url = "https://api.x.ai/v1" api_key_env = "XAI_API_KEY" ``` -------------------------------- ### IntelliShell Variable Suggestion Ranking Tuning Source: https://lasantosr.github.io/intelli-shell/print Configuration section for tuning the variable suggestion ranking algorithm in IntelliShell. It outlines the scoring system based on completion, context, and path relevance, with total usage count as a tie-breaker. ```toml # Configuration to tune the variables suggestion ranking algorithm. # # The final score for a variable suggestion is a weighted sum of points from three sources: # 1. Completion Score: The value is present on the dynamic completions for the variable # 2. Context Score: Other variable values already selected to the command # 3. 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] ``` -------------------------------- ### Define Basic Variables in Commands Source: https://lasantosr.github.io/intelli-shell/print Create reusable command templates by using variables enclosed in double curly braces, e.g., `{{variable_name}}`. When executing a command with variables, IntelliShell prompts for values, making specific commands dynamic and versatile. The '<...>' syntax is also accepted for compatibility. ```shell echo "Hello, {{user}}!" ``` -------------------------------- ### Register Global User Completion (Shell) Source: https://lasantosr.github.io/intelli-shell/guide/variables Creates a global completion for the '{{user}}' variable, applicable to any command. It uses 'awk' to parse '/etc/passwd' and suggest usernames with UIDs greater than or equal to 1000, useful for commands like 'chown'. ```shell # A global completion for `{{user}}`, useful for commands like `chown {{user}} ...` intelli-shell completion new user "awk -F: '$3 >= 1000 {print $1}' /etc/passwd" ``` -------------------------------- ### Export user commands and completions with 'export' Source: https://lasantosr.github.io/intelli-shell/print The 'export' command shares or backs up user-defined commands and completions to an external location. By default, it exports in a human-readable text format. It does not include commands fetched from 'tldr' pages or workspace-specific items. The destination can be a file path, HTTP(S) URL, or GitHub Gist ID/URL. Output can be directed to stdout. ```shell intelli-shell export [OPTIONS] [LOCATION] ``` ```shell intelli-shell export my_commands.bak ``` ```shell # GIST_TOKEN is set in the environment intelli-shell export --gist 1a2b3c4d5e6f7g8h9i0j ``` ```shell intelli-shell export --filter "#gcp" ``` -------------------------------- ### IntelliShell CLI Interactive Mode Flags Source: https://lasantosr.github.io/intelli-shell/reference/index Illustrates how to run IntelliShell commands interactively using the `-i` or `--interactive` flag. It also shows options for forcing TUI rendering styles: inline (`-l`, `--inline`) and full-screen (`-f`, `--full-screen`). ```bash # Interactive mode intelli-shell [COMMAND] -i # Interactive mode with inline rendering intelli-shell [COMMAND] --interactive --inline # Interactive mode with full-screen rendering intelli-shell [COMMAND] -i -f ``` -------------------------------- ### Enable AI Integration in IntelliShell Source: https://lasantosr.github.io/intelli-shell/print This configuration snippet shows how to globally enable all AI-powered functionality within IntelliShell. Ensure this is set to `true` for any AI features to become active. AI integration is disabled by default. ```toml __ [ai] # A global switch to enable or disable all AI-powered functionality enabled = false ``` -------------------------------- ### Configure GitHub Gist Integration Source: https://lasantosr.github.io/intelli-shell/print Sets default parameters for importing and exporting to GitHub Gists. Requires the Gist `id` and optionally a `token` for private Gists. The `GIST_TOKEN` environment variable overrides the `token` setting. ```ini __ # Configuration for the default gist to use when importing or exporting (if no other is explicitly set) [gist] # The id of the gist, you can get it from the url after the username id = "" # Token to authenticate the API call to GH when exporting # GIST_TOKEN env variable will take precedence over the config value token = "" ```