### Install IntelliShell using cargo-binstall Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/installation.md Installs IntelliShell using the `cargo-binstall` tool, which fetches pre-compiled binaries. This is an alternative to building from source. Ensure `cargo-binstall` is installed. ```rust cargo binstall intelli-shell --locked ``` -------------------------------- ### Install IntelliShell from Source (Rust) Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/installation.md Builds and installs the IntelliShell binary from its source code using Cargo, Rust's package manager. Requires the Rust toolchain and sets a flag for SQLite functions. Ensure you have Rust installed. ```rust LIBSQLITE3_FLAGS="-DSQLITE_ENABLE_MATH_FUNCTIONS" cargo install intelli-shell --locked ``` -------------------------------- ### Install IntelliShell via curl (Linux/macOS) Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/installation.md This command downloads and executes the IntelliShell installation script from a remote URL. It automatically detects the OS and architecture to set up the binary and shell integration. Ensure you have `curl` installed. ```shell curl -sSf https://raw.githubusercontent.com/lasantosr/intelli-shell/main/install.sh | sh ``` -------------------------------- ### Install IntelliShell via PowerShell (Windows) Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/installation.md This PowerShell script installs IntelliShell on Windows. It requires execution policy to be set and downloads the installation script. The Microsoft Visual C++ Redistributable is a prerequisite. ```powershell Set-ExecutionPolicy RemoteSigned -Scope CurrentUser irm https://raw.githubusercontent.com/lasantosr/intelli-shell/main/install.ps1 | iex ``` -------------------------------- ### Configure IntelliShell for Nushell Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/installation.md Sets up IntelliShell initialization for Nushell. This involves creating a directory and saving the output of the init command to a file in the Nushell vendor directory. Requires IntelliShell to be installed. ```nu mkdir ($nu.data-dir | path join "vendor/autoload") intelli-shell init nushell | save -f ($nu.data-dir | path join "vendor/autoload/intelli-shell.nu") ``` -------------------------------- ### Fetch TLDR Examples Source: https://context7.com/lasantosr/intelli-shell/llms.txt Fetches command examples from TLDR pages for the current platform or specific categories/commands. Supports filtering from files or stdin. ```bash intelli-shell tldr fetch intelli-shell tldr fetch common intelli-shell tldr fetch linux intelli-shell tldr fetch osx intelli-shell tldr fetch windows intelli-shell tldr fetch --command git --command docker intelli-shell tldr fetch --filter-commands commands.txt echo -e "git\ndocker\ntar" | intelli-shell tldr fetch --filter-commands - ``` -------------------------------- ### AI-Powered Import from Website/Blog Source: https://github.com/lasantosr/intelli-shell/blob/main/src/_examples/import.txt Shows how to leverage AI to extract command templates directly from a website or blog. This is useful for parsing command examples found in online documentation or articles. ```bash intelli-shell import --ai http://blog.website.com/kubectl-commands-cheatsheet ``` -------------------------------- ### Configure IntelliShell for Bash Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/installation.md Adds IntelliShell initialization to your Bash shell. This line should be added to your `~/.bashrc` or `~/.bash_profile` to enable hotkeys and features. Assumes IntelliShell is installed and in your PATH. ```bash eval "$(intelli-shell init bash)" ``` -------------------------------- ### Configure IntelliShell for PowerShell Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/installation.md Initializes IntelliShell within PowerShell by executing the output of the `init powershell` command. This should be added to your PowerShell profile. Ensure IntelliShell is installed. ```powershell intelli-shell init powershell | Out-String | Invoke-Expression ``` -------------------------------- ### Configure IntelliShell for Fish Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/installation.md Integrates IntelliShell with the Fish shell by sourcing its initialization script. This command should be added to your `~/.config/fish/config.fish` file. IntelliShell must be installed. ```fish intelli-shell init fish | source ``` -------------------------------- ### Preview Gist Commands with Dry Run Source: https://github.com/lasantosr/intelli-shell/blob/main/src/_examples/import.txt This example illustrates how to preview commands from a GitHub Gist without importing them. The `--dry-run` flag allows verification of parsing and content before committing to the import. ```bash intelli-shell import --dry-run --gist 1234567890abcdef1234567890abcdef/docker_commands.sh ``` -------------------------------- ### IntelliShell Configuration TOML Source: https://context7.com/lasantosr/intelli-shell/llms.txt Example TOML configuration file for IntelliShell, detailing settings for updates, inline TUI, search behavior, logging, keybindings, and theming. ```toml # Config location: ~/.config/intelli-shell/config.toml (Linux/macOS) # Windows: %APPDATA%\IntelliShell\Intelli-Shell\config.toml # Basic settings check_updates = true inline = true # Use inline TUI (vs full-screen) [search] delay = 250 # Debounce delay for search (ms) mode = "auto" # Options: auto, fuzzy, regex, exact, relaxed user_only = false # Exclude TLDR by default exec_on_alias_match = false # Execute immediately on alias match [logs] enabled = false filter = "info" # Options: trace, debug, info, warn, error # Customize keybindings [keybindings] quit = "esc" update = ["ctrl-u", "ctrl-e", "f2"] delete = "ctrl-d" confirm = ["enter", "tab"] execute = ["ctrl-enter", "ctrl-r"] ai = ["ctrl-i", "ctrl-x"] search_mode = "ctrl-s" search_user_only = "ctrl-o" # Theme customization [theme] primary = "" # Default terminal color secondary = "dim" accent = "yellow" comment = "italic green" error = "dark red" highlight = "dark grey" highlight_symbol = "ยป " # Colors support: named colors, RGB, hex, ANSI codes # Examples: "red", "rgb(255, 100, 50)", "#ff6432", "6" # Modifiers: bold, dim, italic, underline # Default Gist for import/export [gist] id = "abc123def456" token = "" # Or use GITHUB_TOKEN env var ``` -------------------------------- ### Install IntelliShell and Integrate with Shells Source: https://context7.com/lasantosr/intelli-shell/llms.txt Provides installation instructions for Linux, macOS, and Windows, along with commands to integrate IntelliShell with various shells like Bash, Zsh, Fish, PowerShell, and Nushell. Ensure proper execution policy is set for PowerShell. ```bash # Install on Linux/macOS/Windows (sh-compatible shells) curl -sSf https://raw.githubusercontent.com/lasantosr/intelli-shell/main/install.sh | sh # Generate shell integration script for Bash intelli-shell init bash >> ~/.bashrc # Generate for other shells intelli-shell init zsh >> ~/.zshrc intelli-shell init fish >> ~/.config/fish/config.fish intelli-shell init powershell >> $PROFILE intelli-shell init nushell >> ~/.config/nushell/config.nu # Verify integration is working (should print the shell script) intelli-shell init bash ``` ```powershell # For Windows PowerShell Set-ExecutionPolicy RemoteSigned -Scope CurrentUser irm https://raw.githubusercontent.com/lasantosr/intelli-shell/main/install.ps1 | iex intelli-shell init powershell >> $PROFILE ``` -------------------------------- ### Configure IntelliShell for Zsh Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/installation.md Adds IntelliShell initialization to your Zsh shell. This command should be added to your `~/.zshrc` file to enable interactive keybindings. Ensure IntelliShell is installed. ```zsh eval "$(intelli-shell init zsh)" ``` -------------------------------- ### Import Commands from Gist Source: https://github.com/lasantosr/intelli-shell/blob/main/src/_examples/import.txt Shows how to import commands directly from a configured default GitHub Gist. This is a convenient way to manage and share command sets. ```bash intelli-shell import gist ``` -------------------------------- ### Import Commands from Stdin Source: https://github.com/lasantosr/intelli-shell/blob/main/src/_examples/import.txt This example shows how to import commands by piping them from standard input (stdin) using a here-document. This is useful for scripting or when commands are generated dynamically. ```bash intelli-shell import << EOF // This is a sample command echo Hello World! EOF ``` -------------------------------- ### Fetch TLDR Pages for Specific Commands Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/tldr_fetch.md This command fetches TLDR examples for one or more specified commands using the `--command` flag. You can repeat the flag to include multiple commands. ```sh intelli-shell tldr fetch --command git --command docker ``` -------------------------------- ### Pre-fill Interactive UI for Bookmarking Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/new.md This example illustrates using the 'new' command with the '-i' flag to pre-fill the interactive TUI. This allows for a hybrid approach where the command string is provided, but the alias and description can be added interactively. ```shell intelli-shell new -i 'git checkout {{branch}}' ``` -------------------------------- ### Clear TLDR Examples Source: https://context7.com/lasantosr/intelli-shell/llms.txt Clears imported TLDR examples, either all of them or for specific categories. ```bash intelli-shell tldr clear intelli-shell tldr clear linux ``` -------------------------------- ### Fetch Default TLDR Pages Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/tldr_fetch.md This command fetches the default and system-relevant TLDR pages for your operating system. It is the simplest way to start populating your IntelliShell library with common and useful command examples. ```sh intelli-shell tldr fetch ``` -------------------------------- ### Bookmark a Simple Command Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/new.md This example demonstrates how to quickly save a command to the IntelliShell library without providing additional details. The command string is enclosed in single quotes to ensure that special characters are preserved. ```shell intelli-shell new 'echo "Hello, IntelliShell!"' ``` -------------------------------- ### Add Command with Alias and Description Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/new.md This example shows how to bookmark a command with an alias for easy searching and a detailed description including hashtags for organization. This makes the command more discoverable and maintainable within the library. ```shell intelli-shell new 'docker run -it --rm {{image}}' --alias 'dr' --description 'Run a temporary docker image #docker' ``` -------------------------------- ### Interactively Bookmark a New Command (Shell) Source: https://github.com/lasantosr/intelli-shell/blob/main/src/_examples/cli.txt Opens an interactive interface to bookmark a new command. This is useful for quickly saving frequently used commands with associated metadata. Invoked using `intelli-shell new -i`. ```shell intelli-shell new -i ``` -------------------------------- ### Export All Commands to a File Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/export.md This example demonstrates the basic usage of the `export` command to create a local backup of all user-defined commands and completions into a file named `my_commands.bak`. No special options are required for this simple backup scenario. ```sh intelli-shell export my_commands.bak ``` -------------------------------- ### IntelliShell Command and Completion Definitions Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/syncing.md Defines the format for commands, aliases, descriptions, and dynamic variable completions in IntelliShell. Comments starting with '#' precede commands as descriptions, and lines starting with '$' define completions. ```shell # -------------------------------------------------------------- # Commands # -------------------------------------------------------------- # 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" # -------------------------------------------------------------- # Completions # -------------------------------------------------------------- # 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 and Completions in .intellishell Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/workspace.md This example demonstrates the format of an .intellishell file. It includes comments for descriptions, direct commands, aliased commands, and shell command-based completions for specific contexts like 'env' and 'resource'. ```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 ``` -------------------------------- ### Non-Interactive Variable Replacement with API Token Source: https://github.com/lasantosr/intelli-shell/blob/main/src/_examples/replace.txt This example demonstrates non-interactive variable replacement using intelli-shell. It pre-fills the API token from the environment and URL-encodes the user query. Shell quoting is important for commands with meta-characters. ```bash intelli-shell replace -e API_TOKEN -e USER_QUERY='my query text' 'curl -H "Authorization: Bearer {{{api_token}}}" https://api.example.com/data?query={{user_query:url}}' ``` -------------------------------- ### Install IntelliShell for PowerShell on Windows Source: https://github.com/lasantosr/intelli-shell/blob/main/README.md This command installs or updates the IntelliShell binary for Windows PowerShell. It may require setting the execution policy and downloads the installation script to execute. ```powershell Set-ExecutionPolicy RemoteSigned -Scope CurrentUser # Optional: Only needed if scripts are disabled irm https://raw.githubusercontent.com/lasantosr/intelli-shell/main/install.ps1 | iex ``` -------------------------------- ### AI-Powered Import from Atuin History Source: https://github.com/lasantosr/intelli-shell/blob/main/src/_examples/import.txt This example utilizes AI to extract command templates from Atuin history. It offers an interactive mode to discard or edit extracted commands before importing them into intelli-shell. ```bash intelli-shell import -i --ai --history atuin ``` -------------------------------- ### Export User Commands (Shell) Source: https://github.com/lasantosr/intelli-shell/blob/main/src/_examples/cli.txt Exports all user-defined commands. This is useful for backup or migration purposes. Invoked using `intelli-shell export user.commands`. ```shell intelli-shell export user.commands ``` -------------------------------- ### Interactively List Stored Completions (Shell) Source: https://github.com/lasantosr/intelli-shell/blob/main/src/_examples/cli.txt Lists all stored command completions interactively. This allows users to review, manage, and select available completion suggestions. Invoked using `intelli-shell completion list -i`. ```shell intelli-shell completion list -i ``` -------------------------------- ### Interactively Import User Commands (Shell) Source: https://github.com/lasantosr/intelli-shell/blob/main/src/_examples/cli.txt Provides an interactive interface for importing user commands. This allows for selective import and review of commands from external sources. Invoked using `intelli-shell import -i user.commands`. ```shell intelli-shell import -i user.commands ``` -------------------------------- ### Import Commands from Custom URL Source: https://github.com/lasantosr/intelli-shell/blob/main/src/_examples/import.txt Demonstrates importing commands from a custom URL. intelli-shell supports importing directly from web endpoints, accepting either plain text content or a JSON format similar to its export. ```bash intelli-shell import https://api.example.com/custom-endpoint ``` -------------------------------- ### Basic Non-Interactive Replacement with IntelliShell Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/replace.md This example demonstrates how to use the `intelli-shell replace` command to substitute a variable in a command string directly on the command line. It takes a command template with a placeholder and provides the value for the placeholder using the `--env` option. ```shell intelli-shell replace 'echo "Hello, {{name}}!"' --env name=World # Output: echo "Hello, World!" ``` -------------------------------- ### Interactive Import with Filtering and Tagging Source: https://github.com/lasantosr/intelli-shell/blob/main/src/_examples/import.txt Demonstrates interactive import of commands from a specified file path. It allows filtering and adding a tag to the command description if it's missing. This is useful for organizing and refining imported commands. ```bash intelli-shell import -i -t docker --filter docker path/to/shared.commands ``` -------------------------------- ### Non-Interactive Replacement and Execution from Environment Source: https://github.com/lasantosr/intelli-shell/blob/main/src/_examples/replace.txt This snippet illustrates non-interactive variable replacement where values are sourced from environment variables. The resulting command is then piped to 'sh' for execution. ```bash intelli-shell replace -E "aws s3 sync {{local_path}} s3://{{bucket_name}}/{{remote_path}} --delete" | sh ``` -------------------------------- ### Fetch Specific TLDR Category Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/tldr_fetch.md This command allows you to fetch TLDR pages for a specific category, such as 'common'. This is useful when you only need examples from a particular set of pages. ```sh intelli-shell tldr fetch common ``` -------------------------------- ### Generate Command with AI Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/new.md This example showcases the AI-powered command generation feature. By providing a natural language prompt with the '--ai' flag and '-i' for interactive review, IntelliShell can generate a command and its details. The '-i' flag is recommended to review and edit the AI's suggestions. ```shell intelli-shell new -i --ai 'undo last n commits' ``` -------------------------------- ### List all variable completions (Shell) Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/completion_list.md Lists all configured dynamic variable completions, both global and command-specific, in a non-interactive format. No specific dependencies are required beyond the intelli-shell installation. ```sh intelli-shell completion list ``` -------------------------------- ### Populating IntelliShell Variables from Environment Variables Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/replace.md This example illustrates how to use the `--use-env` flag with `intelli-shell replace` to automatically populate variables from existing environment variables. It assumes an environment variable `FILENAME` is set and substitutes it into a `tar` command. ```shell # Set an environment variable export FILENAME="report.pdf" # Use the --use-env flag to automatically find and replace {{filename}} intelli-shell replace 'tar -czvf archive.tar.gz {{filename}}' --use-env # Output: tar -czvf archive.tar.gz report.pdf ``` -------------------------------- ### Configure AI Model Catalog in IntelliShell Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/configuration/ai.md This TOML configuration sets up the AI model catalog in IntelliShell, defining connection details for various AI providers and models. It includes examples for Gemini, OpenAI, and Ollama, specifying their respective provider types and model names. ```toml [ai.catalog.gemini] provider = "gemini" model = "gemini-pro" [ai.catalog.gpt4-fast] provider = "openai" model = "gpt-4-turbo-preview" [ai.catalog.ollama-llama3] provider = "ollama" model = "llama3" ``` -------------------------------- ### Send to a Custom Server via HTTP POST Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/export.md This example demonstrates exporting commands to a custom HTTP endpoint using the `POST` method. It includes a custom `Authorization` header and specifies the target URL. The `-X POST` option sets the HTTP method, and `-H "Authorization: Bearer my-token"` adds the authentication header. ```sh intelli-shell export -H "Authorization: Bearer my-token" -X POST https://my-api/commands ``` -------------------------------- ### Interactively Search Stored Commands (Shell) Source: https://github.com/lasantosr/intelli-shell/blob/main/src/_examples/cli.txt Allows interactive searching and filtering of stored commands. It can be initialized with a filter, such as "git", to narrow down the search results. Invoked using `intelli-shell search -i [filter]`. ```shell intelli-shell search -i git ``` -------------------------------- ### Interactive Variable Replacement via Stdin Source: https://github.com/lasantosr/intelli-shell/blob/main/src/_examples/replace.txt This snippet shows how to pipe a command string into intelli-shell for interactive variable replacement. The command and its variables are read from standard input, and the interactive UI prompts the user for values. ```bash echo "tar -czvf {{archive_name}}.tar.gz {{source_dir}}" | intelli-shell replace -i ``` -------------------------------- ### Interactively Select Commands to Export Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/export.md This example shows how to use the interactive mode (`-i`) to select specific commands for export. It first filters commands related to 'docker' and then opens a TUI for review and selection before saving to `docker_commands.bak`. This provides fine-grained control over what is exported. ```sh intelli-shell export -i --filter "docker" docker_commands.bak ``` -------------------------------- ### IntelliShell Variable Replacement using Standard Input Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/replace.md This example shows how to pipe a command template containing variables into the `intelli-shell replace` command. The command reads from standard input, allowing for dynamic population of variables, such as an authentication token for a `curl` request. ```shell echo 'curl -H "Auth: {{token}}"' | intelli-shell replace --env token=xyz123 # Output: curl -H "Auth: xyz123" ``` -------------------------------- ### Export a Subset of Commands using Filter Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/export.md This example illustrates exporting only specific commands that match a regular expression. The `--filter` option is used to select commands related to `#gcp`, and only completions relevant to these filtered commands are exported to standard output. ```sh intelli-shell export --filter "#gcp" ``` -------------------------------- ### Make IntelliShell Executable (Shell) Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/troubleshooting.md Ensures the 'intelli-shell' binary has execute permissions on Linux/macOS systems. This is crucial if you encounter 'Permission Denied' errors during manual installations or due to file system issues. It uses the 'which' command to locate the binary and 'chmod +x' to set the execute permission. ```sh # Find the binary and make it executable chmod +x "$(which intelli-shell)" ``` -------------------------------- ### Launching Interactive TUI for IntelliShell Variable Replacement Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/replace.md This example shows how to invoke the interactive TUI for the `intelli-shell replace` command using the `-i` or `--interactive` flag. This prompts the user to enter values for variables within a command template, such as file names and host details for an `scp` command. ```shell intelli-shell replace -i 'scp {{file}} {{user}}@{{host}}:/remote/path' ``` -------------------------------- ### Interactively Replace Variables in a Command (Shell) Source: https://github.com/lasantosr/intelli-shell/blob/main/src/_examples/cli.txt Enables interactive replacement of variables within a command string. This is helpful for templated commands where specific values need to be substituted. Invoked using `intelli-shell replace -i "[command_template]"`. ```shell intelli-shell replace -i "echo {{message}}" ``` -------------------------------- ### Clear All Imported tldr Commands with Intelli-Shell Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/tldr_clear.md This command clears all tldr commands that have been imported into your Intelli-Shell library. It's useful for resetting your tldr command collection or removing all tldr examples from search results. ```shell intelli-shell tldr clear ``` -------------------------------- ### Export to a Private GitHub Gist Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/export.md This example shows how to export commands and completions to a private GitHub Gist. It requires the `GIST_TOKEN` environment variable to be set with a GitHub Personal Access Token that has the `gist` scope. The `--gist` flag explicitly tells IntelliShell to treat the provided ID as a Gist. ```sh # GIST_TOKEN is set in the environment intelli-shell export --gist 1a2b3c4d5e6f7g8h9i0j ``` -------------------------------- ### Store a Command Non-Interactively (Shell) Source: https://github.com/lasantosr/intelli-shell/blob/main/src/_examples/cli.txt Stores a command non-interactively, allowing for direct saving of commands with optional alias and description. This is useful for scripting or bulk command storage. Invoked using `intelli-shell new "[command]" --alias "[alias]" --description "[description]"`. ```shell intelli-shell new "find . -name '*.py'" --alias "lp" --description "Find Python files" ``` -------------------------------- ### Configure Anthropic Claude Models in IntelliShell Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/configuration/ai.md Configures an Anthropic Claude model, like Claude 4.0 Sonnet, for use with IntelliShell. The configuration specifies 'anthropic' as the provider and the corresponding model identifier. This setup assumes access to the Anthropic API. ```toml [ai.catalog.claude-sonnet] provider = "anthropic" model = "claude-sonnet-4-0" ``` -------------------------------- ### Capturing Corrected Command in a Shell Variable Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/fix.md This example shows how to capture the corrected command output by 'intelli-shell fix' into a shell variable. The corrected command is sent to stdout, allowing it to be easily assigned to a variable for further programmatic use in scripts. ```shell fixed_cmd=$(intelli-shell fix "git comit amend") echo "The corrected command is: $fixed_cmd" ``` -------------------------------- ### Bookmark and Search Commands with IntelliShell Source: https://context7.com/lasantosr/intelli-shell/llms.txt Demonstrates how to bookmark new commands, with options for aliases, descriptions, and AI-assisted generation from natural language. It also covers interactive and query-based searching, including regex and user-specific searches. ```bash # Bookmark a simple command intelli-shell new "docker ps -a" # Bookmark with alias and description intelli-shell new "docker ps -a" \ --alias "dps" \ --description "List all Docker containers including stopped ones" # Bookmark a command with variables intelli-shell new "ssh {{user}}@{{server}}" \ --alias "ssh-prod" \ --description "SSH into production servers #prod" # Bookmark with AI assistance (generates command from natural language) intelli-shell new --ai --interactive # Then type: "list all processes using port 8080" # Search for commands interactively (opens TUI) intelli-shell search --interactive # Search with initial query intelli-shell search "docker" --interactive # Search with specific mode intelli-shell search "git.*commit" --mode regex --interactive # Search user commands only (exclude TLDR examples) intelli-shell search --user-only --interactive # Use AI to generate commands from natural language intelli-shell search "find large files" --ai --interactive ``` -------------------------------- ### Clear Specific tldr Category with Intelli-Shell Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/tldr_clear.md This command clears tldr commands belonging to a specified category from your Intelli-Shell library. For example, you can remove only macOS-specific commands by specifying 'osx'. This operation does not affect user-created bookmarks. ```shell # Remove only the macOS-specific commands intelli-shell tldr clear osx ``` -------------------------------- ### Import Commands from tldr Pages Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/basic_usage.md Populates the IntelliShell library with command templates from the tldr pages project. The `fetch` command imports pages for specified commands or categories, creating a separate space for these commands. ```sh intelli-shell tldr fetch -c tar -c git ``` -------------------------------- ### Bookmark a Docker Command with Variables Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/basic_usage.md Demonstrates how to bookmark a frequently used Docker command that includes a variable for the image name. This allows for easy reuse and variable replacement later. ```sh docker run -it --rm {{image}} ``` -------------------------------- ### Clone IntelliShell Repository Source: https://github.com/lasantosr/intelli-shell/blob/main/CONTRIBUTING.md Clones the IntelliShell project repository from GitHub and navigates into the project directory. This is the first step to setting up the development environment. ```shell git clone https://github.com/lasantosr/intelli-shell.git cd intelli-shell ``` -------------------------------- ### Import Commands from Text with AI Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/basic_usage.md Utilizes AI to extract and convert commands from any text source, including URLs and shell history files, into reusable IntelliShell templates with variables. Use the `--ai` flag with the `import` command. ```sh intelli-shell import -i --ai --history bash intelli-shell import -i --ai "https://my-favorite-cheatsheet.com" ``` -------------------------------- ### Create Shell Completion with AI Assistance Source: https://context7.com/lasantosr/intelli-shell/llms.txt Creates a new completion configuration for a shell variable using AI assistance for generating the provider command. Requires interactive input. ```bash intelli-shell completion new --ai --interactive ``` -------------------------------- ### Import Commands from GitHub Gist Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/import.md Onboards commands and completions shared from a public GitHub Gist. This facilitates collaboration and the use of community-contributed command sets. ```shell intelli-shell import https://gist.github.com/lasantosr/137846d029efcc59468ff2c9d2098b4f ``` -------------------------------- ### Generate Commands from Descriptions using AI Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/basic_usage.md Allows users to generate shell commands by simply describing the desired task in natural language. Press Ctrl+I in the IntelliShell search prompt or bookmarking UI after entering the description. ```sh find all files larger than 10MB in the current folder ``` -------------------------------- ### Bookmark a Git Command with Variables Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/basic_usage.md Illustrates bookmarking a Git command to check out a branch, using a variable for the branch name. This showcases the utility of IntelliShell for version control workflows. ```sh git checkout {{branch}} ``` -------------------------------- ### Import and Export Command Libraries Source: https://context7.com/lasantosr/intelli-shell/llms.txt Explains the functionality for exporting and sharing command libraries. Commands can be exported to standard output, a file, or directly to a GitHub Gist, requiring appropriate authentication for Gist export. ```bash # Export to stdout intelli-shell export # Export to file intelli-shell export commands.txt --file # Export to GitHub Gist intelli-shell export gist-id --gist # Requires GITHUB_TOKEN environment variable or configured gist.token ``` -------------------------------- ### Define Workspace-Specific Commands Source: https://context7.com/lasantosr/intelli-shell/llms.txt Defines project-level commands in a .intellishell file, which are automatically loaded and prioritized within the project directory. Supports aliases, script execution, and completions. ```bash cat > .intellishell << 'EOF' \ #!intelli-shell \ # [alias:dev] Start development server \ npm run dev -- --host 0.0.0.0 \ # [alias:build] Build for production \ npm run build \ # Deploy to environment \ ./deploy.sh {{staging|production}} \ ## -- Completions -- \ $ (./deploy.sh) staging|production: echo -e "staging\nproduction" \ EOF ``` -------------------------------- ### IntelliShell Export/Import to GitHub Gist Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/syncing.md Sync your command library with a GitHub Gist for personal cloud sync or sharing. Requires a GitHub Personal Access Token with 'gist' scope. Supports various Gist URL formats and shorthand notations. ```shell # Export to a Gist using its ID and filename intelli-shell export --gist 137846d029efcc59468ff2c9d2098b4f/command.sh # Import from a Gist using its URL intelli-shell import https://gist.github.com/lasantosr/137846d029efcc59468ff2c9d2098b4f # Export to the default Gist (if configured) intelli-shell export gist # Import from the default Gist (if configured) intelli-shell import gist ``` -------------------------------- ### List Shell Completions Source: https://context7.com/lasantosr/intelli-shell/llms.txt Lists all configured shell completions, or filters them for a specific command. Supports interactive listing. ```bash intelli-shell completion list intelli-shell completion list kubectl ``` -------------------------------- ### Preview Intelli-Shell Imports with Dry Run Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/syncing.md The --dry-run flag with the import command allows previewing the commands and completions that would be imported from a file or URL. The actions are printed to the terminal without actually saving them to the library. ```sh intelli-shell import --dry-run https://example.com/some-commands.sh ``` -------------------------------- ### Preview Import with Dry Run Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/import.md Performs a trial run of the import process without modifying the IntelliShell library. This allows inspection of remote file contents before committing changes. ```shell intelli-shell import --dry-run https://config.my-company.com/shared-commands ``` -------------------------------- ### Configure Groq for OpenAI-Compatible API in IntelliShell Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/configuration/ai.md Integrates with Groq's high-speed inference service by configuring it as an OpenAI-compatible endpoint in IntelliShell. This requires setting the provider to 'openai', specifying the Groq model, the API endpoint URL, and the API key environment variable. ```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 Gist Integration Settings Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/configuration/general.md Sets default parameters for importing/exporting to GitHub Gists, useful for backing up or sharing commands. Requires a Gist ID and optionally a GitHub token with `gist` scope for private Gist management. ```toml id = "" # Your default GitHub Gist ID token = "" # GitHub Personal Access Token with gist scope ``` -------------------------------- ### Import Commands from URL Source: https://context7.com/lasantosr/intelli-shell/llms.txt Imports shell commands from a remote URL. Requires the --http flag and supports interactive confirmation. ```bash intelli-shell import https://example.com/commands.txt --http --interactive ``` -------------------------------- ### Variable Replacement and Template Functions Source: https://context7.com/lasantosr/intelli-shell/llms.txt Explains how to use IntelliShell to replace dynamic variables within command templates. Supports interactive replacement, environment variable substitution, explicit value assignment, and includes formatting functions like kebab-case and snake_case. ```bash # Replace variables interactively echo "docker exec -it {{container}} bash" | intelli-shell replace --interactive # Replace using environment variables intelli-shell replace --use-env <<< "echo {{api-key}}" # Automatically suggests $API_KEY if it exists # Replace with explicit values intelli-shell replace --env "container=my-app" <<< "docker logs {{container}}" # Command with choice variables echo "git reset {{--soft|--hard}} HEAD~1" | intelli-shell replace --interactive # User selects either --soft or --hard # Command with formatting functions echo "git checkout -b {{feature|bugfix}}/{{{description:kebab}}}" | intelli-shell replace # Transforms "My New Feature" to "my-new-feature" # Available formatting functions: kebab, snake, upper, lower, url # Example: {{branch:snake:upper}} transforms "my feature" to "MY_FEATURE" # Secret variables (triple braces) - not saved to history echo "export TOKEN={{{secret-token}}}" | intelli-shell replace --interactive ``` -------------------------------- ### Create Shell Completion for Variable Source: https://context7.com/lasantosr/intelli-shell/llms.txt Creates a new completion configuration for a shell variable, specifying the namespace, command, and a provider command to generate values. ```bash intelli-shell completion new "namespace" \ --command "kubectl" \ --provider "kubectl get namespaces -o name | sed 's|namespace/||'" ``` -------------------------------- ### Defining Workspace-Specific Commands with .intellishell Source: https://github.com/lasantosr/intelli-shell/blob/main/README.md Details the creation of a `.intellishell` file in the project's root directory to define workspace-specific commands. These commands are temporary, prioritized, and can be shared with a team, making them ideal for common tasks like build or deploy scripts. ```shell # .intellishell file content example build_project() { echo "Building project..." make build }; ``` -------------------------------- ### Import Commands with AI Parsing Source: https://context7.com/lasantosr/intelli-shell/llms.txt Imports shell commands by parsing natural language from a file using AI. Requires --file and --ai flags. ```bash intelli-shell import blog-post.md --file --ai --interactive ``` -------------------------------- ### IntelliShell Export/Import to Local File Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/syncing.md Export your command library to a local backup file or restore from an existing backup file. This is the simplest method for creating a portable snapshot of your library. ```shell # Back up to a file intelli-shell export my_commands.bak # Restore from the file intelli-shell import my_commands.bak ``` -------------------------------- ### Import Commands from GitHub Gist Source: https://context7.com/lasantosr/intelli-shell/llms.txt Imports shell commands from a GitHub Gist, identified by its ID or URL. Supports interactive confirmation. ```bash intelli-shell import abc123def456 --gist --interactive intelli-shell import https://gist.github.com/user/abc123 --gist --interactive ``` -------------------------------- ### Import Commands from Community Gists Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/basic_usage.md Imports command collections from public GitHub Gists into the IntelliShell library. Users can import all commands from a Gist URL or specify a particular file within a Gist. ```sh intelli-shell import https://gist.github.com/lasantosr/137846d029efcc59468ff2c9d2098b4f intelli-shell import --gist 137846d029efcc59468ff2c9d2098b4f/docker.sh ``` -------------------------------- ### Convert Shell History to Bookmarks with AI Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/import.md Leverages AI to parse shell history (bash, zsh, fish, nushell, powershell, atuin) into IntelliShell commands. The interactive mode is recommended for curating the results before importing. ```shell intelli-shell import -i --ai --history bash ``` -------------------------------- ### Export to HTTP Endpoint with Custom Headers Source: https://context7.com/lasantosr/intelli-shell/llms.txt Exports commands to a specified HTTP URL using a PUT request, including custom headers for authentication. ```bash intelli-shell export https://api.example.com/commands \ --http \ --header "Authorization: Bearer token" \ --request PUT ``` -------------------------------- ### Context-Aware Shell Completions Source: https://context7.com/lasantosr/intelli-shell/llms.txt Creates shell completions that are context-aware, using {{...}} blocks that are conditionally included based on other variable values. ```bash intelli-shell completion new "pod" \ --command "kubectl" \ --provider "kubectl get pods {{-n {{namespace}}}} -o name" ``` -------------------------------- ### Configure xAI for OpenAI-Compatible API in IntelliShell Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/configuration/ai.md Connects to xAI models using IntelliShell by leveraging their OpenAI-compatible API. The configuration includes 'openai' as the provider, the specific xAI model, 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" ``` -------------------------------- ### Import Commands with Tags Source: https://context7.com/lasantosr/intelli-shell/llms.txt Imports shell commands from a file and assigns tags to them using the --add-tag option. ```bash intelli-shell import commands.txt --file --add-tag "work" --add-tag "docker" ``` -------------------------------- ### Import Commands from Shell History with AI Source: https://context7.com/lasantosr/intelli-shell/llms.txt Imports commands from shell history (bash, zsh, fish) using AI parsing for better context. Supports interactive confirmation. ```bash intelli-shell import --history bash --ai --interactive intelli-shell import --history zsh --ai --interactive intelli-shell import --history fish --ai --interactive ``` -------------------------------- ### Import Commands from File Source: https://context7.com/lasantosr/intelli-shell/llms.txt Imports shell commands from a local file. The --interactive flag allows for user confirmation during import. ```bash intelli-shell import commands.txt --file --interactive ``` -------------------------------- ### Import Commands from Local File Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/import.md Restores IntelliShell commands and completions from a local backup file. This is a straightforward way to manage and transfer command libraries. ```shell intelli-shell import my_commands.bak ``` -------------------------------- ### Build IntelliShell Project Source: https://github.com/lasantosr/intelli-shell/blob/main/CONTRIBUTING.md Compiles the IntelliShell project using Cargo, Rust's build system and package manager. This command is used after cloning the repository to build the executable. ```shell cargo build ``` -------------------------------- ### Default Suggestions with Pipe Syntax in Shell Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/variables.md Illustrates how to provide default suggestions for a variable using the pipe symbol '|'. These options appear as choices in the IntelliShell UI, useful for predefined subcommands or options. ```sh # Provides 'up', 'down', and 'logs' as initial suggestions docker-compose {{up|down|logs}} ``` -------------------------------- ### Dry Run Import Source: https://context7.com/lasantosr/intelli-shell/llms.txt Performs a dry run of the import process, previewing commands without actually importing them. Requires the --dry-run flag. ```bash intelli-shell import commands.txt --file --dry-run ``` -------------------------------- ### Configure IntelliShell Data Directory Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/configuration/general.md Specifies the directory for IntelliShell data like command database, logs, and state files. An empty string uses system defaults. This can be overridden by the `INTELLI_STORAGE` environment variable for direct database file control. ```toml data_dir = "" ``` -------------------------------- ### Formatting Variables with Intelli-Shell Source: https://github.com/lasantosr/intelli-shell/blob/main/README.md Explains how to apply formatting functions directly within variable placeholders in Intelli-Shell. This is useful for transforming input data on the fly, such as converting a description into a kebab-case format suitable for git branch names. ```shell git checkout -b {{feature|bugfix}}/{{{description:kebab}}} ``` -------------------------------- ### Using Environment Variables in Intelli-Shell Source: https://github.com/lasantosr/intelli-shell/blob/main/README.md Shows how Intelli-Shell can automatically suggest and utilize environment variables. If a variable placeholder like `{{{api-key}}}` is used, Intelli-Shell will look for a corresponding environment variable (e.g., `$API_KEY`) and use its value. ```shell {{{api-key}}} ``` -------------------------------- ### Extract Commands from Web Page with AI Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/import.md Utilizes AI to parse unstructured text from web pages, extracting command templates. The interactive mode allows review and selection before importing into the IntelliShell library. ```shell intelli-shell import -i --ai https://www.example.com/cheatsheet ``` -------------------------------- ### Configure DeepSeek for OpenAI-Compatible API in IntelliShell Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/configuration/ai.md Enables the use of DeepSeek models through IntelliShell by configuring their OpenAI-compatible API. This involves setting the provider to 'openai', defining the DeepSeek model, its API endpoint, and the necessary API key environment variable. ```toml [ai.model.deepseek] provider = "openai" model = "deepseek-chat" url = "https://api.deepseek.com" api_key_env = "DEEPSEEK_API_KEY" ``` -------------------------------- ### IntelliShell CLI Basic Structure Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/index.md This is the fundamental structure for executing any command within the IntelliShell CLI. It specifies the base command, followed by an optional subcommand, options, and arguments. ```shell intelli-shell [SUBCOMMAND] [OPTIONS] [ARGS] ``` -------------------------------- ### Format IntelliShell Code Source: https://github.com/lasantosr/intelli-shell/blob/main/CONTRIBUTING.md Formats the IntelliShell project's code using the nightly Rust toolchain's `fmt` command. This ensures consistent code style across the project before committing changes. ```shell cargo +nightly fmt ``` -------------------------------- ### Configure OpenAI Models in IntelliShell Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/configuration/ai.md Defines an OpenAI model, such as GPT-4o, within the IntelliShell catalog. This requires specifying the provider as 'openai' and the model name. No external dependencies are needed beyond the OpenAI API access. ```toml [ai.catalog.gpt-4o] provider = "openai" model = "gpt-4o" ``` -------------------------------- ### Preview Command Import with Dry Run (Shell) Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/troubleshooting.md Demonstrates how to use the '--dry-run' flag with the 'intelli-shell import' command to preview the parsing of an import file without making any changes. This is useful for diagnosing formatting issues in command import files. ```sh intelli-shell import --dry-run /path/to/commands.txt ``` -------------------------------- ### Launch Interactive Search in Full-Screen Mode Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/reference/search.md Launches the interactive TUI and forces it to render in full-screen mode, providing a larger interface for searching and selecting commands. ```sh intelli-shell search -i --full-screen ``` -------------------------------- ### Saving Shell Functions with Intelli-Shell Source: https://github.com/lasantosr/intelli-shell/blob/main/README.md Demonstrates how to save entire shell functions for reuse within Intelli-Shell. This allows for complex command sequences to be stored and recalled easily. It uses standard shell syntax for function definition and then integrates it into the Intelli-Shell placeholder system. ```shell custom_echo() { echo "hey: $@"; }; custom_echo {{text}}; ``` -------------------------------- ### IntelliShell Export/Import to Custom HTTP Endpoint Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/guide/syncing.md Sync your command library with a custom HTTP endpoint for private, centralized storage. Supports PUT requests for export and can handle plain text or JSON formats for import. Custom headers for authentication can be specified. ```shell # Export to a private, authenticated endpoint intelli-shell export -H "Authorization: Bearer {{{private-token}}}" https://my-server.com/commands # Import from the same endpoint intelli-shell import -H "Authorization: Bearer {{{private-token}}}" https://my-server.com/commands ``` -------------------------------- ### Configure Local Ollama Models in IntelliShell Source: https://github.com/lasantosr/intelli-shell/blob/main/docs/src/configuration/ai.md Sets up IntelliShell to use a local model served by Ollama, such as Llama 3. This configuration uses 'ollama' as the provider and specifies the local model name. An optional 'url' parameter can be used if Ollama is running on a different host. ```toml [ai.catalog.local-llama] provider = "ollama" model = "llama3" # If Ollama is running on a different host, specify the URL: # url = "http://192.168.1.100:11434" ``` -------------------------------- ### Search Commands within Workspace Source: https://context7.com/lasantosr/intelli-shell/llms.txt Searches for commands within the current workspace directory. Workspace commands are prioritized in the search results. ```bash cd /path/to/project intelli-shell search --interactive ```