### Install Erdtree using Scoop Source: https://github.com/solidiquis/erdtree/blob/master/README.md Installs the Erdtree command-line tool using Scoop, a command-line installer for Windows. ```bash scoop install erdtree ``` -------------------------------- ### Install Erdtree using Pkgin (NetBSD) Source: https://github.com/solidiquis/erdtree/blob/master/README.md Installs the Erdtree command-line tool on NetBSD using the pkgin package manager. ```bash pkgin install erdtree ``` -------------------------------- ### Install Erdtree using Homebrew Source: https://github.com/solidiquis/erdtree/blob/master/README.md Installs the Erdtree command-line tool using Homebrew, a package manager for macOS and Linux. ```bash brew install erdtree ``` -------------------------------- ### Erdtree TOML Configuration Example Source: https://github.com/solidiquis/erdtree/blob/master/README.md An example of a TOML configuration file for Erdtree. This file allows users to define custom defaults for various options, including icons, human-readable sizes, disk usage calculation, layout, and filtering. ```toml icons = true human = true # Compute file sizes like `du` # e.g. `erd --config du` [du] disk_usage = "block" icons = true layout = "flat" no-ignore = true no-git = true hidden = true level = 1 # Do as `ls -l` # e.g. `erd --config ls` [ls] icons = true human = true level = 1 suppress-size = true long = true # How many lines of Rust are in this code base? # e.g. `erd --config rs` [rs] disk-usage = "line" level = 1 pattern = "\\.rs$" ``` -------------------------------- ### Install Erdtree using Cargo (Non-Windows) Source: https://github.com/solidiquis/erdtree/blob/master/README.md Installs the Erdtree command-line tool using Cargo, Rust's package manager. This method requires Rust and its toolchain to be installed. ```bash cargo install erdtree ``` -------------------------------- ### Installing Erdtree Source: https://context7.com/solidiquis/erdtree/llms.txt Commands to install erdtree via Cargo or system-specific package managers on various platforms. ```bash # Standard installation (non-Windows) cargo install erdtree # Windows installation (requires nightly toolchain) rustup toolchain install nightly-2023-06-11 cargo +nightly-2023-06-11 install erdtree # Homebrew (macOS) brew install erdtree # Scoop (Windows) scoop install erdtree # NetBSD pkgin install erdtree # From latest master branch cargo install --git https://github.com/solidiquis/erdtree --branch master ``` -------------------------------- ### Install Erdtree using Cargo (Windows - Nightly) Source: https://github.com/solidiquis/erdtree/blob/master/README.md Installs the Erdtree command-line tool on Windows using a nightly Rust toolchain. This is necessary for experimental features like hard-link detection. ```bash rustup toolchain install nightly-2023-06-11 cargo +nightly-2023-06-11 install erdtree ``` -------------------------------- ### Define Erdtree Configuration in TOML Source: https://github.com/solidiquis/erdtree/blob/master/CHANGELOG.md Example of a .erdtree.toml file defining global settings and specific profiles for different use cases like disk usage analysis and file listing. ```toml icons = true human = true # Compute file sizes like `du` [du] disk_usage = "block" icons = true layout = "flat" no-ignore = true no-git = true hidden = true level = 1 # Do as `ls -l` [ls] icons = true human = true level = 1 suppress-size = true long = true no-ignore = true hidden = true # How many lines of Rust are in this code base? [rs] disk-usage = "line" level = 1 pattern = "\\.rs$" ``` -------------------------------- ### Install Erdtree from Git Master Branch Source: https://github.com/solidiquis/erdtree/blob/master/README.md Installs the latest development version of Erdtree directly from its Git repository's master branch. This is useful for accessing the newest features before they are released. ```bash cargo install --git https://github.com/solidiquis/erdtree --branch master ``` -------------------------------- ### Get Quick Directory Overview with erdtree Source: https://context7.com/solidiquis/erdtree/llms.txt Provides a quick overview of directory structure without calculating sizes for faster results. It supports different display formats like a standard tree view or a list-like view. ```bash # Fast overview without size calculation erd --suppress-size --level 2 --icons ``` ```bash # List-like view erd --suppress-size --long --level 1 --icons ``` ```bash erd --config ls ``` -------------------------------- ### Prevent Traversal into Different Filesystems Source: https://github.com/solidiquis/erdtree/blob/master/README.md Restricts directory traversal to only include directories located on the same filesystem as the starting directory. This is useful for avoiding traversal into mount points of other filesystems. ```bash -x, --one-file-system Prevent traversal into directories that are on different filesystems ``` -------------------------------- ### Configuring Output Layouts Source: https://context7.com/solidiquis/erdtree/llms.txt Switching between tree-based and flat output layouts to suit different reporting needs. ```bash # Regular layout (default) erd --layout regular # Inverted layout - root at top erd --layout inverted # Flat layout - paths without tree structure erd --layout flat # Inverted flat layout erd --layout iflat ``` -------------------------------- ### Erdtree Configuration File Usage Source: https://github.com/solidiquis/erdtree/blob/master/README.md Demonstrates how to use a named configuration profile defined in an Erdtree TOML configuration file. This allows for quick application of predefined settings. ```bash erd --config du # equivalent to erd --disk-usage block --icons --layout flat --no-ignore --no-git --hidden --level 1 ``` -------------------------------- ### Displaying Directory Trees Source: https://context7.com/solidiquis/erdtree/llms.txt Basic commands to visualize directory structures and disk usage with human-readable formatting and icons. ```bash # Display current directory tree with default settings erd # Display specific directory erd /path/to/directory # Display with human-readable sizes erd --human # Short form erd -H # Human-readable sizes with icons erd --human --icons # Combined short form erd -HI ``` -------------------------------- ### Manage Configuration Files Source: https://context7.com/solidiquis/erdtree/llms.txt Use a TOML configuration file to persist settings or define named configurations for specific use cases like 'du' or 'ls' style output. ```toml [du] disk_usage = "block" icons = true layout = "flat" level = 1 ``` ```bash erd --config du erd --no-config ``` -------------------------------- ### Configuring Disk Usage Metrics Source: https://context7.com/solidiquis/erdtree/llms.txt Adjusting the calculation method for disk usage, including physical, logical, block, line, or word counts. ```bash # Physical size (default) erd --disk-usage physical # Logical size erd --disk-usage logical erd -d logical # Block count (Unix-only) erd --disk-usage block erd -d block # Line count erd --disk-usage line erd -d line # Word count erd --disk-usage word erd -d word ``` -------------------------------- ### Display Project Structure with erdtree Source: https://context7.com/solidiquis/erdtree/llms.txt Displays the project structure, respecting `.gitignore` rules by default to show a clean view of project files. Options are available to include hidden files and build artifacts. ```bash # Standard project view erd --icons --human --level 3 ``` ```bash # Show everything including build artifacts erd --icons --human --no-ignore --hidden --level 3 ``` -------------------------------- ### Sort and Order Output Source: https://context7.com/solidiquis/erdtree/llms.txt Control the presentation of file system entries using sort criteria like size, name, or time, and define directory positioning. ```bash erd --sort rsize erd --sort mod erd --dir-order first ``` -------------------------------- ### Display Extended Metadata Source: https://context7.com/solidiquis/erdtree/llms.txt Enable long-view mode to display detailed file information such as permissions, ownership, and timestamps, similar to the standard ls -l command. ```bash erd --long --group --ino --nlink --human --icons erd --long --time-format iso ``` -------------------------------- ### Configure Erdtree Output and Filtering Source: https://github.com/solidiquis/erdtree/blob/master/README.md Various command-line flags to control file tree display, including icons, depth limits, pruning, and directory-only modes. ```bash # Display file icons erdtree --icons # Limit maximum depth erdtree --level 3 # Remove empty directories erdtree --prune # Only print directories erdtree --dirs-only ``` -------------------------------- ### Performance and Traversal Options Source: https://context7.com/solidiquis/erdtree/llms.txt Optimize traversal performance by adjusting thread counts, suppressing disk usage calculations, or restricting traversal to a single filesystem. ```bash erd --threads 4 erd --suppress-size erd --one-file-system ``` -------------------------------- ### Display Extended Metadata (Long View) Source: https://github.com/solidiquis/erdtree/blob/master/README.md Enabling the long-view mode to show permissions, owners, and specific timestamps. ```bash # Show extended metadata erdtree --long --group --ino --octal # Use specific timestamp and format erdtree --long --time create --time-format iso ``` -------------------------------- ### Generate Shell Completions Source: https://context7.com/solidiquis/erdtree/llms.txt Generate shell completion scripts to enable command-line auto-completion for supported shells like Bash and Zsh. ```bash erd --completions bash > ~/.local/share/bash-completion/completions/erd erd --completions zsh > ~/.oh-my-zsh/completions/_erd ``` -------------------------------- ### Generate Shell Completions Source: https://github.com/solidiquis/erdtree/blob/master/README.md Generates auto-completions for common shells, enabling command and argument completion via the tab key. The output needs to be redirected to a specific file within the shell's completion directory and the shell configuration sourced. ```bash $ erd --completions zsh > ~/.oh-my-zsh/completions/_erd $ source ~/.zshrc ``` -------------------------------- ### Control Output Colorization Modes Source: https://github.com/solidiquis/erdtree/blob/master/README.md Manages the colorization of the output. By default, colorization is enabled if stdout is a tty. This option allows explicit control over colorization modes: 'none' for plain output, 'auto' for automatic detection, and 'force' to always enable colorization. ```bash -C, --color Mode of coloring output [default: auto] Possible values: - none: Print plainly without ANSI escapes - auto: Attempt to colorize output - force: Turn on colorization always ``` -------------------------------- ### Filter Files and Directories Source: https://context7.com/solidiquis/erdtree/llms.txt Filter the output by file type or glob patterns. Use --file-type to target specific types or --glob to perform pattern matching on filenames. ```bash erd --pattern "config" --file-type dir erd --pattern "*.js" --glob erd --pattern "!*.log" --glob ``` -------------------------------- ### Filtering and Pattern Matching Source: https://context7.com/solidiquis/erdtree/llms.txt Controlling file visibility, depth of traversal, and searching files using regular expressions. ```bash # Limit depth to 2 levels erd -L 2 # Show hidden files erd --hidden # Include files ignored by .gitignore erd --no-ignore # Show only directories erd --dirs-only # Find files using regex erd --pattern "\.rs$" ``` -------------------------------- ### Sort Erdtree Output Source: https://github.com/solidiquis/erdtree/blob/master/README.md Configuring sorting behavior for file entries and directory positioning. ```bash # Sort by size erdtree --sort size # Sort directories first erdtree --dir-order first ``` -------------------------------- ### Filter Files with Regex and Globbing Source: https://github.com/solidiquis/erdtree/blob/master/README.md Using patterns to filter the file tree output, including case-insensitive globbing and file-type restrictions. ```bash # Filter by regex pattern erdtree --pattern "\.rs$" # Filter using case-insensitive globbing erdtree --iglob "*.log" --file-type file ``` -------------------------------- ### Generate Shell Completions for erdtree Source: https://context7.com/solidiquis/erdtree/llms.txt Generates shell completion scripts for various shells (fish, PowerShell, Elvish) to enhance the command-line experience with erdtree. These scripts provide auto-completion for erdtree commands and arguments. ```bash erd --completions fish > ~/.config/fish/completions/erd.fish ``` ```powershell erd --completions powershell > erd.ps1 ``` ```elvish erd --completions elvish > erd.elv ``` -------------------------------- ### Truncate Output to Fit Terminal Source: https://github.com/solidiquis/erdtree/blob/master/README.md Enables truncation of output to fit within the terminal emulator's window dimensions, preventing incoherent rendering of large outputs. This is achieved by using the `--truncate` flag. ```bash --truncate Truncate output to fit terminal emulator window ``` -------------------------------- ### Find Large Files and Directories with erdtree Source: https://context7.com/solidiquis/erdtree/llms.txt Identifies the largest files and directories within a given path. Options include sorting by size, human-readable output, displaying only top-level items, and including hidden files. ```bash # Sort by size (largest at bottom), human-readable erd --sort size --human --icons ``` ```bash # Show only top-level with sizes erd -s size -H -I -L 1 ``` ```bash # Include hidden files in search erd -s size -H -I -. ``` -------------------------------- ### Count Lines of Code with erdtree Source: https://context7.com/solidiquis/erdtree/llms.txt Counts lines of code in specified file types using erdtree. It supports filtering by file pattern and displaying results in a human-readable format. This is useful for analyzing code volume in projects. ```bash # Count lines in all Rust files erd --disk-usage line --pattern "\.rs$" --human ``` ```bash # Count lines in all Python files erd -d line -p "\.py$" -H ``` ```bash # Count lines in JavaScript/TypeScript erd -d line -p "\.(js|ts|jsx|tsx)$" -H ``` -------------------------------- ### Adjust Parallelism Threads Source: https://github.com/solidiquis/erdtree/blob/master/README.md Specifies the number of threads used by erdtree for parallel processing. Increasing the thread count can improve throughput for disk reads and data processing, though performance gains are subject to Amdahl's Law and may diminish after a certain threshold. ```bash -T, --threads Number of threads to use [default: 3] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.