### Install Bito CLI (Windows - Recommended) Source: https://docs.bito.ai/other-bito-ai-tools/bito-cli/install-or-uninstall Installs Bito CLI on Windows by downloading the MSI installer from the GitHub repository and running it. ```shell Download Bito CLI.exe from the latest version folder on GitHub. Run the installer and follow prompts. On Windows 11, you may need to click 'Show more' or 'More info' and then 'Run anyway' if a publisher verification warning appears. ``` -------------------------------- ### Install Bito CLI (Mac/Linux - Manual Binary) Source: https://docs.bito.ai/other-bito-ai-tools/bito-cli/install-or-uninstall Manually installs Bito CLI on Mac and Linux by downloading the binary, making it executable, and placing it in the PATH. ```shell 1. Download the Bito CLI binary specific to your OS platform from the GitHub repo. 2. Move the downloaded file to a desired location and rename it to 'bito': mv bito-- bito 3. Make the file executable: chmod +x ./bito 4. Copy the binary to /usr/local/bin: sudo cp ./bito /usr/local/bin 5. Ensure /usr/local/bin is in your PATH, or add it: PATH=$PATH:/usr/local/bin 6. Run Bito CLI with the 'bito' command. ``` -------------------------------- ### Install Bito CLI (Windows - Manual Binary) Source: https://docs.bito.ai/other-bito-ai-tools/bito-cli/install-or-uninstall Manually installs Bito CLI on Windows by downloading the binary and configuring the system's PATH environment variable. ```shell 1. Download the 'bito.exe' binary for Windows from the GitHub repo. 2. Move the downloaded file to a directory of your choice. 3. Add the directory containing 'bito.exe' to your system's PATH environment variable. Follow instructions at: https://share.bito.co/static/share?aid=02f4506f-1208-4d97-bb1d-96f3b4a1a017 ``` -------------------------------- ### Install Bito CLI (Mac/Linux - Recommended) Source: https://docs.bito.ai/other-bito-ai-tools/bito-cli/install-or-uninstall Installs the Bito CLI using a curl script for Mac and Linux. This method always fetches the latest version and requires sudo privileges. ```shell sudo curl https://alpha.bito.ai/downloads/cli/install.sh -fsSL | bash ``` -------------------------------- ### Bito AI Code Review Agent Setup for GitHub (Self-Managed) Source: https://docs.bito.ai/ai-code-review-agent/install-run-using-bito-cloud/guide-for-github-self-managed Steps to configure the AI Code Review Agent for a self-managed GitHub Enterprise server using Bito Cloud. This involves logging into Bito, navigating to the Code Review Agents section, and selecting 'GitHub (Self-Managed)' as the Git provider. ```APIDOC Bito Cloud Configuration Steps: 1. Log in to Bito Cloud: https://alpha.bito.ai/ 2. Navigate to Code Review section -> Repositories: https://alpha.bito.ai/home/ai-agents/code-review-agent 3. Select Git Provider: - Choose 'GitHub (Self-Managed)' for self-hosted GitHub Enterprise. - Supported GitHub Enterprise Server versions: 3.0 and above. ``` -------------------------------- ### Setup Bito Extension with WSL Source: https://docs.bito.ai/other-bito-ai-tools/ide-extension/installation-guide/installing-on-visual-studio-code Instructions for setting up the Bito extension when running Visual Studio Code through the Windows Subsystem for Linux (WSL). This allows seamless use of Bito within a Linux environment on Windows. ```WSL Setup Ensure VS Code is running on WSL for Linux command-line tool access and a consistent development environment. ``` -------------------------------- ### Install Bito CLI (Archlinux via AUR) Source: https://docs.bito.ai/other-bito-ai-tools/bito-cli/install-or-uninstall Installs Bito CLI on Arch Linux and Arch-based distributions using the AUR helper 'yay' or 'paru'. ```shell yay -S bito-cli ``` ```shell paru -S bito-cli ``` -------------------------------- ### Git Rebase Command Syntax Source: https://docs.bito.ai/other-bito-ai-tools/ide-extension/ai-chat-in-bito/use-cases-and-examples Provides a step-by-step guide for rebasing a Git branch. It covers checking out the target branch, performing the rebase operation, resolving conflicts, verifying status, and force-pushing the rebased branch. ```bash 1. Checkout the branch you want to rebase: $ git checkout 1. Rebase your branch against the upstream branch: $ git rebase upstream/main 1. Resolve any conflicts that arise. 1. Once all conflicts are resolved, do a git status to verify that all files have been updated correctly. 1. Finally, push the rebased branch to the remote repository: $ git push origin --force ``` -------------------------------- ### Install Bito CLI via Homebrew Source: https://docs.bito.ai/other-bito-ai-tools/bito-cli/faqs Steps to install the Bito CLI using Homebrew. This involves tapping the official Bito CLI repository and then installing the package. ```bash brew tap gitbito/bitocli brew install bito-cli ``` -------------------------------- ### Install Bito Extension on VS Code Source: https://docs.bito.ai/other-bito-ai-tools/ide-extension/installation-guide/installing-on-visual-studio-code Instructions for installing the Bito AI extension directly from the Visual Studio Code Marketplace. This enables AI-driven coding assistance within the IDE. ```VSCode Marketplace https://marketplace.visualstudio.com/items?itemName=Bito.bito ``` -------------------------------- ### Setup Bito Extension with SSH Source: https://docs.bito.ai/other-bito-ai-tools/ide-extension/installation-guide/installing-on-visual-studio-code Guidance on configuring the Bito extension when using Visual Studio Code remotely via SSH. This ensures Bito's AI capabilities are available on remote development machines. ```External Guide https://code.visualstudio.com/docs/remote/ssh ``` ```External Guide https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse ``` -------------------------------- ### Run Bito CRA Agent (Windows) Source: https://docs.bito.ai/ai-code-review-agent/install-run-as-a-self-hosted-service/install-run-via-webhooks-service Starts the Bito AI Code Review Agent as a service on Windows using PowerShell. Requires OpenSSL to be installed and uses the PowerShell script with the properties file, outputting an encrypted Git Webhook secret. ```powershell ./bito-cra.ps1 service start bito-cra.properties ``` -------------------------------- ### Go Regex Autocomplete Example Source: https://docs.bito.ai/other-bito-ai-tools/ide-extension/ai-code-completions/use-cases-and-examples Shows an example of using AI to autocomplete regular expressions in Go. The context suggests generating regex patterns for tasks like email validation. ```go ``` -------------------------------- ### Python B+ Tree Example Source: https://docs.bito.ai/other-bito-ai-tools/ide-extension/ai-chat-in-bito/use-cases-and-examples Explains the concept of a B+ tree and provides a basic Python implementation. It includes classes for nodes and the tree itself, outlining methods for insertion, deletion, and searching. ```python class Node: def __init__(self, order): self.order = order self.keys = [] self.children = [None] * (order + 1) class BPlusTree: def __init__(self, order): self.root = Node(order) def insert(self, key): if not self.root.keys: self.root.keys.append(key) else: pass # traverse the tree and insert the key def delete(self, key): pass # traverse the tree and delete the key def search(self, key): pass # traverse the tree and search for the key # Create a B+ tree of order 5 bplus_tree = BPlusTree(5) # Insert a key bplus_tree.insert(10) # Delete a key bplus_tree.delete(10) # Search for a key bplus_tree.search(10) ``` -------------------------------- ### Install Docker Source: https://docs.bito.ai/ai-code-review-agent/install-run-as-a-self-hosted-service/prerequisites Installs Docker version 20.x or higher on Linux, macOS, or Windows. Docker is required to deploy and run the AI Code Review Agent. ```text Refer to the official Docker installation guide: https://docs.docker.com/engine/install/ ``` -------------------------------- ### .bitoignore: Negation Example with Directory Exclusion Source: https://docs.bito.ai/other-bito-ai-tools/ide-extension/ai-that-understands-your-code/managing-index-size Provides a practical example of using negation to include specific subdirectories within a broadly excluded parent directory. This pattern overrides the general exclusion rule. ```ignore-config Engine/** !Engine/Build/BatchFiles/** ``` -------------------------------- ### Execute Bito CLI Commands Source: https://docs.bito.ai/other-bito-ai-tools/bito-cli/how-to-use Learn how to start and interact with the Bito CLI. This includes executing the main command, handling multiline prompts, and exiting or terminating the session. ```cli bito # Ask your question, e.g., 'awk command to print first and last column' # Press Enter/Return for new lines # Press Ctrl+D to submit multiline prompt ``` ```cli quit # Press Ctrl+D to exit Bito CLI ``` ```cli # Press Ctrl+C to terminate Bito CLI ``` -------------------------------- ### PHP Autocomplete Repetitive Code Example Source: https://docs.bito.ai/other-bito-ai-tools/ide-extension/ai-code-completions/use-cases-and-examples Demonstrates how AI code completion can assist in autocompleting repetitive code snippets in PHP, specifically for form field checks. The example shows a comment guiding the AI to implement the logic. ```php // check if all form fields are entered by user ``` -------------------------------- ### VS Code SSH/WSL Setup for Bito Extension Source: https://docs.bito.ai/help/support-and-questions/troubleshooting Provides guidance on setting up the Bito extension in VS Code when running through SSH or WSL. It directs users to specific documentation for detailed instructions. ```Markdown Link For SSH setup, please refer to [this documentation](../../../other-bito-ai-tools/ide-extension/installation-guide/installing-on-visual-studio-code#setup-bito-extension-in-vs-code-running-through-ssh). For WSL setup, please refer to [this documentation](../../../other-bito-ai-tools/ide-extension/installation-guide/installing-on-visual-studio-code#setup-bito-extension-in-vs-code-running-through-wsl). ``` -------------------------------- ### Exclude Folder and Subfolders (Glob) Source: https://docs.bito.ai/ai-code-review-agent/excluding-files-folders-or-branches-with-filters This pattern excludes an entire folder, including all its contents and subfolders, starting with a specific name. For example, excluding the 'resources/' directory. ```glob resources/ ``` -------------------------------- ### Uninstall Bito CLI (Windows) Source: https://docs.bito.ai/other-bito-ai-tools/bito-cli/install-or-uninstall Uninstalls Bito CLI on Windows through the standard Windows 'Uninstall a program' control panel feature. ```shell 1. Open Control Panel. 2. Go to 'Programs' > 'Uninstall a program'. 3. Find 'Bito CLI' in the list. 4. Click 'Uninstall' and follow the wizard. ``` -------------------------------- ### Generate Sample Data in PHP Source: https://docs.bito.ai/other-bito-ai-tools/ide-extension/ai-code-completions/use-cases-and-examples Populate arrays, variables, and objects with dummy data to facilitate thorough testing scenarios. This example demonstrates creating an array of arrays containing blog post information. ```php // create an array of arrays that contains blog posts info, such as: title, post_slug, excerpt, author name ``` -------------------------------- ### Uninstall Bito CLI (Mac/Linux) Source: https://docs.bito.ai/other-bito-ai-tools/bito-cli/install-or-uninstall Uninstalls Bito CLI and all its components from Mac and Linux systems using a provided uninstall script. ```shell sudo curl https://alpha.bito.ai/downloads/cli/uninstall.sh -fsSL | bash ``` -------------------------------- ### GitHub Actions Workflow Directory Setup Source: https://docs.bito.ai/ai-code-review-agent/install-run-as-a-self-hosted-service/install-run-via-github-actions Instructions for creating the necessary directory structure for GitHub Actions workflows within a repository. This is a prerequisite for adding workflow files. ```yaml .github/workflows ``` -------------------------------- ### Bito CLI Sample Configuration Source: https://docs.bito.ai/other-bito-ai-tools/bito-cli/configuration An example of the Bito CLI configuration file structure. This YAML file defines settings such as access keys, preferred AI models, and other operational parameters. ```yaml bito: access_key: "" email: first.last@mycompany.com preferred_ai_model: ADVANCED settings: auto_update: true max_context_entries: 20 ``` -------------------------------- ### PHP Regex for Password Strength Source: https://docs.bito.ai/other-bito-ai-tools/ide-extension/ai-code-completions/use-cases-and-examples Provides an example of generating a PHP function to check password strength using regular expressions based on specific criteria (length, uppercase, special characters, numbers, lowercase). The AI is guided by a detailed comment. ```php /* write a function checkPasswordStrength($password) it checks the strength of password based on below criteria: - Minimum password length must be 12 characters - 2 letters in Upper Case - 1 Special Character (!@#$&*) - 2 numerals (0-9) - 3 letters in Lower Case return true if the password meets the above criteria otherwise return false use regex for comparison */ ``` -------------------------------- ### Ask Bito to Explain Code Source: https://docs.bito.ai/other-bito-ai-tools/ide-extension/ai-that-understands-your-code/using-in-jetbrains-ides Demonstrates how to prompt Bito AI to analyze and explain a codebase. This involves using the 'my code' keyword followed by a specific request, such as explaining a file's purpose and gameplay mechanics. ```text Example: **in my code explain the file apiUser.js** Additional keywords for various languages are listed on the [**Available Keywords**](available-keywords) page. Also, here are some [**Example Questions**](example-questions). ``` -------------------------------- ### Bito AI GitHub Variables Configuration Source: https://docs.bito.ai/ai-code-review-agent/install-run-as-a-self-hosted-service/install-run-via-github-actions Configuration of environment variables within GitHub repository settings for Bito AI integration. This includes static analysis tools, domain, and exclusion patterns. ```configuration Navigate to Repository Settings -> Secrets and variables -> Actions -> Variables. Add Variable: Name: STATIC_ANALYSIS_TOOL Value: fb_infer,astral_ruff,mypy Add Variable: Name: GIT_DOMAIN Value: Your GitHub Enterprise or self-hosted domain (e.g., https://your.company.git.com) or leave blank. Add Variable: Name: EXCLUDE_BRANCHES Value: Specify branches to exclude (e.g., 'main', 'develop', '*.test'). Add Variable: Name: EXCLUDE_FILES Value: Specify files/folders to exclude (e.g., '*.md', 'docs/'). Add Variable: Name: EXCLUDE_DRAFT_PR Value: Set to 'true' or 'false' to control draft PR reviews. ``` -------------------------------- ### Include branches starting with release, hotfix, or development but not Bito or feature Source: https://docs.bito.ai/ai-code-review-agent/excluding-files-folders-or-branches-with-filters This pattern includes Git branches that start with 'release', 'hotfix', or 'development', but excludes those that also start with 'Bito' or 'feature'. It uses multiple negative lookaheads and an OR group. It matches `release-v1.0`, `hotfix-123`, `development-xyz`. ```Regex ^(?!Bito|feature)(release|hotfix|development).*$ ``` -------------------------------- ### Run Bito AI Code Review Agent Source: https://docs.bito.ai/ai-code-review-agent/install-run-as-a-self-hosted-service/install-run-via-cli Execute the Bito AI Code Review Agent using the provided shell scripts. The script takes the properties file as an argument to configure and run the code review process. ```bash ./bito-cra.sh bito-cra.properties ``` ```powershell ./bito-cra.ps1 bito-cra.properties ``` -------------------------------- ### Install Bash on macOS Source: https://docs.bito.ai/ai-code-review-agent/install-run-as-a-self-hosted-service/install-run-via-webhooks-service Installs Bash version 4.x or higher on macOS using the Homebrew package manager. ```bash brew install bash ``` -------------------------------- ### VS Code Version Compatibility Source: https://docs.bito.ai/other-bito-ai-tools/ide-extension/installation-guide/installing-on-visual-studio-code Details on the required Visual Studio Code versions for Bito extension functionality. Specific features like AI Code Completions have higher version requirements. ```VSCode Requirements Bito extension requires VS Code version 1.72 and higher. AI Code Completions feature requires VS Code version 1.80 and higher. ``` -------------------------------- ### Python Add Function Example Source: https://docs.bito.ai/help/bitos-ai-stack/embeddings A simple Python function that adds two numbers. This serves as a basic example for demonstrating code embedding principles. ```python def add(x, y): return x + y ```