### Installing Keyboard Shortcuts Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Installs Viby's convenient keyboard shortcuts for enhanced command-line interaction. ```sh yb shortcuts ``` -------------------------------- ### Installing and Using Keyboard Shortcuts Source: https://github.com/johanli233/viby/blob/main/docs/viby_使用示例.md Describes how to install Viby's keyboard shortcuts and demonstrates their usage. By pressing `Ctrl+Q` after typing a command or a question, the input is automatically prefixed with `yb`, allowing Viby to process it. ```sh yb shortcuts ``` ```sh git log # 按 Ctrl+Q # -> 变为: yb git log # -> [AI 解析并解释 Git 日志] ``` ```sh 分析系统内存使用情况 # 按 Ctrl+Q # -> 变为: yb 分析系统内存使用情况 ``` -------------------------------- ### Starting Embedding Server Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Initiates the embedding server, which is essential for enabling Viby's intelligent tool discovery capabilities. ```sh yb tools embed start ``` -------------------------------- ### Installing Viby from PyPI Source: https://github.com/johanli233/viby/blob/main/README.md This snippet demonstrates how to install the Viby AI agent using either pip or uv package managers. It's the recommended way to get Viby up and running quickly. ```Shell pip install viby # OR uv tool install viby ``` -------------------------------- ### Listing Available Tools Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Displays a list of all tools currently available and integrated with Viby. ```sh yb tools list ``` -------------------------------- ### Configuring MCP Tools via Interactive Setup Source: https://github.com/johanli233/viby/blob/main/docs/viby_使用示例.md Explains how to enable and configure MCP tools within Viby's interactive configuration wizard. This step is necessary to allow Viby to utilize external tools for enhanced functionality. ```sh yb --config ``` -------------------------------- ### Starting Viby Embedding Server Source: https://github.com/johanli233/viby/blob/main/README.md This command starts the embedding server, which is required for Viby's smart tool discovery and semantic search capabilities to function. It should be run before using these features. ```Shell yb tools embed start ``` -------------------------------- ### Analyzing Git Status and Log for Next Steps Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Illustrates passing Git repository status and recent commit logs to Viby using shell command substitution to get recommendations on next actions. ```sh yb vibe "$(git status) $(git log --oneline -5) What should I do next?" ``` -------------------------------- ### Installing Viby from Source Source: https://github.com/johanli233/viby/blob/main/README.md This snippet shows an alternative installation method for Viby directly from its source code using the uv package manager. This is useful for development or when you need the latest unreleased features. ```Shell uv pip install -e . ``` -------------------------------- ### Managing Embedding Models for Tool Discovery Source: https://github.com/johanli233/viby/blob/main/docs/viby_使用示例.md Outlines the commands for managing Viby's embedding models, which are used for semantic tool discovery. This includes downloading, starting, checking status, updating, listing, and stopping the embedding server, as well as directly using specific tools. ```sh yb tools embed download ``` ```sh yb tools embed start ``` ```sh yb tools embed status ``` ```sh yb tools embed update ``` ```sh yb tools list ``` ```sh yb tools use weather "北京的天气" ``` ```sh yb tools embed stop ``` -------------------------------- ### Using Shortcut for Direct Question Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Shows how typing a natural language question and pressing `Ctrl+Q` automatically converts it into a Viby query for analysis. ```sh Analyze system memory usage # press Ctrl+Q # -> becomes: yb vibe Analyze system memory usage ``` -------------------------------- ### Basic Q&A with Viby Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Demonstrates the simplest way to use Viby by directly asking a question, which Viby processes to provide an answer or generate code. ```sh yb "Write a binary search algorithm in Python" ``` -------------------------------- ### Using Shortcut to Explain Git Log Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Illustrates how typing a command like `git log` and pressing `Ctrl+Q` transforms it into a Viby query, which then explains the Git log output. ```sh git log # press Ctrl+Q # -> becomes: yb vibe git log # -> [AI parses and explains the Git log] ``` -------------------------------- ### Summarizing File Content with Redirect Input Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Demonstrates using input redirection (`<`) to feed the content of a file (`article.txt`) to Viby for summarization. ```sh yb vibe "Summarize this article" < article.txt ``` -------------------------------- ### Enabling MCP Tools via Interactive Configuration Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Shows how to access Viby's interactive configuration interface to enable or adjust settings for MCP tools. ```sh yb --config ``` -------------------------------- ### Switching Language via Configuration Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Accesses Viby's interactive configuration to change the interface language settings. ```sh yb --config ``` -------------------------------- ### Installing Viby Keyboard Shortcuts Source: https://github.com/johanli233/viby/blob/main/README.md Explains how to install Viby's convenient keyboard shortcuts, which automatically detect your shell type. After installation, it's necessary to reload your shell configuration or restart your terminal for the shortcuts to become active. ```sh yb shortcuts ``` -------------------------------- ### Using Specific Tool Directly Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Demonstrates how to explicitly invoke a specific tool (e.g., 'weather') with a given query, bypassing the need for the embedding server. ```sh yb tools use weather "Weather in Beijing" ``` -------------------------------- ### Generating and Executing Compression Command Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Illustrates how Viby can generate a shell command (e.g., `tar`) based on a request and prompt for direct execution. ```sh yb vibe "Compress all log files in the current directory" ``` -------------------------------- ### Direct Run with Explicit Vibe Command Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Illustrates using the `vibe` command for direct execution of a query, where Viby processes the request and provides relevant information or recommendations. ```sh yb vibe Recommend some Python learning resources ``` -------------------------------- ### Launching Viby Configuration Wizard (Shell) Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md This command launches the interactive configuration wizard for Viby, enabling users to set API keys, default models, parameters, and integration options. It's the primary way to customize Viby's behavior. ```Shell yb --config ``` -------------------------------- ### Analyzing System Resources with Combined Shell Output Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Shows how to combine outputs from multiple shell commands (`ps aux`, `free -h`) using command substitution and pass them to Viby for a comprehensive system resource analysis. ```sh yb vibe "$(ps aux | grep python) $(free -h) Which Python processes are using the most memory?" ``` -------------------------------- ### Downloading Embedding Model Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Downloads the necessary embedding model for Viby's semantic search and intelligent tool discovery features, required before first use. ```sh yb tools embed download ``` -------------------------------- ### Asking a Basic Question with Viby Source: https://github.com/johanli233/viby/blob/main/README.md This example illustrates how to ask Viby a simple question, demonstrating its ability to generate code or information. The 'yb vibe' prefix can be simplified to just 'yb' for convenience. ```Shell yb vibe "Write a quicksort in python" # -> Sure! Here is a quicksort algorithm implemented in **Python**: yb "Write a quicksort in python" # -> Same result as above ``` -------------------------------- ### Analyzing Git Diff with Pipe Input Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Demonstrates how Viby can receive input from a pipe, specifically analyzing the output of `git diff` to summarize code changes. ```sh git diff | yb vibe "What are the main changes in this code?" ``` -------------------------------- ### Simplifying File Content via Pipe Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Shows how to pipe the content of a file (`complex_code.py`) to Viby for analysis and simplification, useful for code refactoring. ```sh cat complex_code.py | yb vibe "Simplify this code" ``` -------------------------------- ### Viewing Generated Shell Commands History Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Displays a history of shell commands that were generated and executed through Viby. ```sh yb history shell ``` -------------------------------- ### Explicit Vibe Command for Q&A Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Shows how to use the explicit `vibe` command with Viby for basic question and answer interactions, providing an alternative to direct questioning. ```sh yb vibe "Write a binary search algorithm in Python" ``` -------------------------------- ### Stopping Embedding Server Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Shuts down the Viby embedding server, which is used for tool discovery. ```sh yb tools embed stop ``` -------------------------------- ### Checking Embedding Server Status Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Provides a command to check the current operational status of the Viby embedding server. ```sh yb tools embed status ``` -------------------------------- ### Updating Tool Embeddings Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Updates the embeddings for available tools, ensuring that Viby's tool discovery mechanism is based on the latest information. ```sh yb tools embed update ``` -------------------------------- ### Exporting Viby History to File Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Exports the entire interaction history from Viby to a specified JSON file for external analysis or backup. ```sh yb history export history.json ``` -------------------------------- ### Using TavilyAI Search Tool Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Illustrates Viby's integration with tools like TavilyAI for performing searches and retrieving up-to-date information on complex topics. ```sh yb vibe "Recent research advances in quantum computing" ``` -------------------------------- ### Listing Recent Viby History Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Displays the most recent interaction history with Viby, defaulting to the last 10 records. ```sh yb history list ``` -------------------------------- ### Basic Questioning with Viby Source: https://github.com/johanli233/viby/blob/main/docs/viby_使用示例.md Demonstrates the simplest way to use Viby by directly asking a question. Viby will process the natural language query and provide a relevant response, such as generating code. ```sh yb "用Python写一个二分查找算法" ``` -------------------------------- ### Listing More Viby History Records Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Allows specifying a limit to retrieve a larger number of historical interaction records from Viby. ```sh yb history list --limit 20 ``` -------------------------------- ### Using Viby for Simple Answers with Fast Model (Shell) Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md This command uses the 'vibe' model in 'fast' mode for quick, straightforward answers, suitable for simple tasks like translation. It prioritizes speed over deep reasoning. ```Shell yb --fast vibe "Translate 'Hello, World!' to Chinese" ``` -------------------------------- ### Clearing All Viby History Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Provides a command to clear all stored interaction history in Viby, prompting for user confirmation before proceeding. ```sh yb history clear ``` -------------------------------- ### Using MCP Integrated Tools Source: https://github.com/johanli233/viby/blob/main/docs/viby_使用示例.md Demonstrates how Viby automatically leverages integrated tools via the MCP (Model Context Protocol) to answer specific queries, such as fetching real-time weather or performing web searches using tools like TavilyAI. ```sh yb vibe "巴黎现在的天气怎么样?" ``` ```sh yb vibe "最近有关量子计算的研究进展" ``` -------------------------------- ### Searching Viby History by Keyword Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Enables searching through Viby's interaction history using specific filter criteria, such as a keyword like 'Python'. ```sh yb history search "Python" ``` -------------------------------- ### Accessing Viby Configuration Wizard Source: https://github.com/johanli233/viby/blob/main/docs/viby_使用示例.md Provides the command to launch Viby's interactive configuration wizard. This wizard allows users to set various parameters, including API keys, default models, model parameters, MCP integration, language, and embedding settings, with configurations saved to specific files. ```sh yb --config ``` -------------------------------- ### Analyzing Directory Contents with Shell Magic Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Demonstrates using shell command substitution (`$()`) to pass the output of `ls -la` to Viby, enabling it to explain the purpose of files in the current directory. ```sh yb vibe "$(ls -la) Explain what these files are for" ``` -------------------------------- ### Interactive Viby Configuration Source: https://github.com/johanli233/viby/blob/main/README.md Describes how to launch Viby's interactive configuration wizard, which guides the user through setting up various preferences. This includes API endpoint and key, model settings, MCP tools, and interface language. ```sh yb --config ``` -------------------------------- ### Analyzing Command Output with Pipe Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Illustrates piping the output of a shell command (`ls -la`) to Viby to analyze and identify recently modified files. ```sh ls -la | yb vibe "Which files were modified recently?" ``` -------------------------------- ### Integrating `git status` Output into Viby Queries Source: https://github.com/johanli233/viby/blob/main/README.md This example shows how Viby can process the output of 'git status' to provide intelligent suggestions, such as which files to commit first, based on the current Git repository state. ```Shell yb vibe "$(git status) Which files should I commit first?" ``` -------------------------------- ### Generating and Executing Shell Commands Source: https://github.com/johanli233/viby/blob/main/docs/viby_使用示例.md Shows how Viby can generate a shell command based on a request and then allow direct execution by pressing Enter. This streamlines common command-line tasks. ```sh yb vibe "压缩当前目录下所有的日志文件" ``` -------------------------------- ### Explicit `vibe` Command Usage Source: https://github.com/johanli233/viby/blob/main/docs/viby_使用示例.md Shows how to explicitly use the `vibe` command for basic question answering. It also illustrates that quotes are optional for single-line queries when `vibe` is used as the default command. ```sh yb vibe "用Python写一个二分查找算法" ``` ```sh yb vibe 推荐几个Python学习资源 ``` -------------------------------- ### Exporting Viby History for Specific Time Range Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Allows exporting Viby interaction history within a defined date range to a specified file. ```sh yb history export --from "2024-01-01" --to "2024-01-31" jan_history.json ``` -------------------------------- ### Switching Viby Interface Language Source: https://github.com/johanli233/viby/blob/main/docs/viby_使用示例.md Explains how to change Viby's interface language through its interactive configuration wizard. This allows users to set their preferred language for the application. ```sh yb --config ``` -------------------------------- ### Automatic Tool Usage for Weather Query Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Demonstrates Viby's ability to automatically identify and use an appropriate MCP tool (e.g., weather tool) to answer specific queries. ```sh yb vibe "What's the weather like in Paris right now?" ``` -------------------------------- ### Generating Shell Command for File Search Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md Shows Viby's capability to analyze a natural language query and generate a corresponding shell command, such as finding large files. ```sh yb vibe "Find the 5 largest files on my system" ``` -------------------------------- ### Selecting Specific Models for Viby Tasks Source: https://github.com/johanli233/viby/blob/main/README.md This example shows how to explicitly select different AI models (e.g., 'think' for complex analysis, 'fast' for quick responses) when interacting with Viby, allowing for optimized performance based on task complexity. ```Shell # Use think model for complex analysis yb --think vibe "Analyze this complex algorithm and suggest optimizations" # Use fast model for quick responses yb --fast vibe "Translate 'Hello, World!' to French" ``` -------------------------------- ### Utilizing Multiple AI Models Source: https://github.com/johanli233/viby/blob/main/docs/viby_使用示例.md Illustrates how Viby supports using different AI models for various query types, such as a 'think' model for deep analysis or a 'fast' model for quick answers. It also shows how to set a default model via the configuration. ```sh yb --think vibe "分析这个复杂算法的时间复杂度和可能的优化方向" ``` ```sh yb --fast vibe "将'Hello, World!'翻译成中文" ``` ```sh yb --config ``` -------------------------------- ### Analyzing Current Environment with Shell Magic Source: https://github.com/johanli233/viby/blob/main/docs/viby_使用示例.md Explains how to use shell command substitution (`$()`) to pass the output of other commands as context to Viby. This enables Viby to analyze the current environment, such as directory contents, process status, or Git repository state, and provide relevant insights or suggestions. ```sh yb vibe "$(ls -la) 解释一下这些文件的用途" ``` ```sh yb vibe "$(ps aux | grep python) $(free -h) 哪些 Python 进程占用内存较多?" ``` ```sh yb vibe "$(git status) $(git log --oneline -5) 建议我接下来应该做什么?" ``` -------------------------------- ### Using Viby for Deep Analysis with Thinking Model (Shell) Source: https://github.com/johanli233/viby/blob/main/docs/viby_usage_examples.md This command uses the 'vibe' model in 'think' mode for deep analysis, suitable for complex queries requiring detailed reasoning. It's ideal for tasks like algorithm analysis and optimization. ```Shell yb --think vibe "Analyze the time complexity of this algorithm and possible optimization directions" ``` -------------------------------- ### Processing Piped Input with Viby Source: https://github.com/johanli233/viby/blob/main/docs/viby_使用示例.md Illustrates how Viby can receive and process data from standard input (stdin) via pipes or input redirection. This allows for analyzing command outputs, file contents, or other streamed data. ```sh git diff | yb vibe "这些代码变更的主要内容是什么?" ``` ```sh cat complex_code.py | yb vibe "简化这段代码" ``` ```sh ls -la | yb vibe "哪些文件最近被修改?" ``` ```sh yb vibe "总结这篇文章" < article.txt ``` -------------------------------- ### Processing File Content with Viby Source: https://github.com/johanli233/viby/blob/main/README.md This example demonstrates how Viby can read content from a file using input redirection ('<') and process it to answer questions about the file's content. This is useful for analyzing documents or code. ```Shell yb vibe "What is this project about?" < README.md # -> This project is about... ``` -------------------------------- ### Generating Shell Commands for File Search Source: https://github.com/johanli233/viby/blob/main/docs/viby_使用示例.md Demonstrates Viby's ability to analyze a natural language query and generate a corresponding shell command, such as finding large files. It also shows the interactive prompt for running, editing, or copying the generated command. ```sh yb vibe "找出我的系统中占用空间最大的5个文件" ``` -------------------------------- ### Managing Viby Interaction History Source: https://github.com/johanli233/viby/blob/main/docs/viby_使用示例.md Details Viby's history management features, including listing recent interactions, searching by criteria, exporting history to a file (with optional date ranges), viewing generated shell commands, and clearing all history. This helps users review and manage their past interactions. ```sh yb history list ``` ```sh yb history list --limit 20 ``` ```sh yb history search "Python" ``` ```sh yb history export history.json ``` ```sh yb history export --from "2024-01-01" --to "2024-01-31" jan_history.json ``` ```sh yb history shell ``` ```sh yb history clear ``` -------------------------------- ### Viby Command Line Structure Source: https://github.com/johanli233/viby/blob/main/README.md Outlines the general command-line structure for interacting with Viby, showing how options, commands, and arguments are typically used. This provides a foundational understanding for constructing any Viby command. ```text yb [OPTIONS] [COMMAND] [ARGS]... ``` -------------------------------- ### Common Viby Commands Source: https://github.com/johanli233/viby/blob/main/README.md Lists the primary commands available in Viby for asking questions, managing interaction history, and configuring tools and shortcuts. It highlights the recommended `yb [prompt]` alias for convenient question asking. ```sh yb [prompt] yb vibe "your question" yb --think vibe "complex question" yb --fast vibe "simple question" yb history yb tools yb shortcuts ``` -------------------------------- ### Using Viby Keyboard Shortcuts Source: https://github.com/johanli233/viby/blob/main/README.md Illustrates how to use the Ctrl+Q keyboard shortcut to transform any typed command line content into a Viby prompt. This feature allows for quick and efficient AI interaction directly from your terminal, streamlining your workflow. ```sh help me analyze my readme file # Now press Ctrl+Q # -> This transforms into: yb vibe help me analyze my readme file # -> [AI analyzes and responds to question] ``` -------------------------------- ### Listing Available Viby Tools Source: https://github.com/johanli233/viby/blob/main/README.md This command lists all tools available to Viby, which are discovered and managed through the embedding server. It's recommended to update embeddings before listing. ```Shell yb tools list ``` -------------------------------- ### Using Viby with MCP Tools Source: https://github.com/johanli233/viby/blob/main/README.md Demonstrates how Viby automatically leverages Model Context Protocol (MCP) tools when a prompt requires specific information, such as the current time. The AI identifies the need and executes the appropriate tool to provide the requested data. ```sh yb vibe "What time is it now?" # -> [AI uses time tool to get current time] # -> "datetime": "2025-05-03T00:49:57+08:00" ``` -------------------------------- ### Downloading Viby Embedding Model Source: https://github.com/johanli233/viby/blob/main/README.md This command downloads the necessary embedding model, a prerequisite for using Viby's smart tool discovery and semantic search features. It only needs to be performed once. ```Shell yb tools embed download ``` -------------------------------- ### Integrating `ls` Output into Viby Queries Source: https://github.com/johanli233/viby/blob/main/README.md This snippet demonstrates how Viby can integrate the output of shell commands like 'ls' directly into a query, allowing it to analyze and respond based on the current directory's contents. ```Shell yb vibe "$(ls) What files are in the current directory?" # -> The current directory contains: file1.txt, file2.py, directory1/... ``` -------------------------------- ### Integrating File Content (`cat`) into Viby Queries Source: https://github.com/johanli233/viby/blob/main/README.md This snippet illustrates how Viby can analyze the content of a specific file by piping its content using 'cat' directly into a query, enabling code review and improvement suggestions. ```Shell yb vibe "$(cat main.py) How can I improve this code?" ``` -------------------------------- ### Generating Shell Commands with Viby Source: https://github.com/johanli233/viby/blob/main/README.md This snippet illustrates Viby's ability to generate shell commands based on a natural language query. It provides options to run, edit, copy, chat, or quit the suggested command. ```Shell yb vibe "How many lines of python code did I write?" # -> find . -type f -name "*.py" | xargs wc -l # -> [r]run, [e]edit, [y]copy, [c]chat, [q]quit (default: run): ``` -------------------------------- ### Checking Viby Embedding Server Status Source: https://github.com/johanli233/viby/blob/main/README.md This command allows users to check the current status of the Viby embedding server, confirming if it's running and ready to support tool discovery. ```Shell yb tools embed status ``` -------------------------------- ### Updating Viby Tool Embeddings Source: https://github.com/johanli233/viby/blob/main/README.md This command updates the tool embeddings from configured Model Context Protocol (MCP) servers, ensuring Viby has the latest information for smart tool discovery. ```Shell yb tools embed update ``` -------------------------------- ### Processing Piped Content for Commit Message Generation Source: https://github.com/johanli233/viby/blob/main/README.md This snippet shows how Viby can process output piped from other shell commands, such as 'git diff', to generate relevant responses like a commit message. This highlights Viby's pipeline integration capability. ```Shell git diff | yb vibe "Generate a commit message" # -> Added information to the README ``` -------------------------------- ### Stopping Viby Embedding Server Source: https://github.com/johanli233/viby/blob/main/README.md This command stops the Viby embedding server when it is no longer needed, freeing up resources. It's good practice to stop the server when not actively using embedding features. ```Shell yb tools embed stop ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.