📦HalFrgrd / flyline
← 返回首页
Flyline: a Bash plugin to replace readline for a modern line editing experience: syntax highlighting, agent integration, rich prompts, tooltips, fuzzy history search, and more!
⚖️ GPL-3.0#bash#bash-plugin#line-editor#rust#terminal📅 创建于 2025-10-28🔄 更新于 2026-10-26

📄 仓库 README

在 GitHub 查看 ↗
来自 GitHub 仓库自述文件 · 版权归原作者所有

Flyline

[![CI](https://github.com/HalFrgrd/flyline/actions/workflows/ci.yml/badge.svg)](https://github.com/HalFrgrd/flyline/actions/workflows/ci.yml) [![Latest Release](https://img.shields.io/github/v/release/HalFrgrd/flyline)](https://github.com/HalFrgrd/flyline/releases) [![Built With Ratatui](https://ratatui.rs/built-with-ratatui/badge.svg)](https://ratatui.rs/) **A Bash plugin for modern command line editing.** [![Demo](https://github.com/HalFrgrd/flyline/releases/download/assets/demo_overview.gif)](https://github.com/HalFrgrd/evp)

When Bash prompts you for a command, a library called readline handles your keystrokes. Readline lacks many features users have come to expect. Flyline is a readline replacement that provides an enhanced line editing experience with: - Intellisense style autosuggestions - Change directory using your prompt - Rich prompt customizations, (asynchronous widgets), and animations - Fuzzy history searching - Mouse support (click to move cursor, select text) - Improvements to Bash's tab completion - Synthesize tab completion suggestions with flycomp - Agent assisted command writing - Tooltips - Text selection - Auto close brackets and quotes - Syntax highlighting - Runs in the same process as Bash - Cursor animations and styles

Flyline is similar to ble.sh but is written in Rust and uses ratatui.rs to more easily draw complex user interfaces.

Who is it for?

  1. You want an out-of-the-box great shell experience without the hassle of setting up half a dozen plugins, plugin managers, keyboard shortcuts, and startup scripts (any one of which might phone home).
  2. You're a terminal power user who wants to fine-tune their shell experience by writing in a modern language like Rust. Flyline can be the starting platform for you; contributions welcome!

Installation

[!IMPORTANT] After installing, run flyline run-tutorial and if you don't like the mouse capturing: flyline mouse --mode disabled

Quick install: install.sh

[!TIP] Run this command in bash to download flyline and update your .bashrc to load the latest version. No need for sudo!

source <(curl -sSfL https://github.com/HalFrgrd/flyline/releases/latest/download/install.sh)

On macOS you must first install a version of Bash that supports custom builtins: brew install bash

Homebrew

On macOS and Linux, you can install via Homebrew:

brew install bash # Needed if you only have default macOS bash installed
brew install flyline

Arch Linux

Arch users can install the AUR package:

paru -S flyline

Nix / NixOS

The flake provides a package, a development shell, and a NixOS module. The module installs Flyline through the system closure and loads that exact store path into interactive Bash; it does not modify .bashrc or run an installer.

Add the input to your system flake:

inputs.flyline.url = "github:HalFrgrd/flyline";

Import the module and enable it in the NixOS configuration:

modules = [
  inputs.flyline.nixosModules.default
];

programs.flyline.enable = true;

For local development, use nix develop. Build the package with nix build .#flyline.

Download from releases

Download the latest libflyline.so for your system from the releases page. If you are on Linux, you probably want the gnu variant unless you know you are on a musl based Linux distro (e.g. Alpine, Chimera). Then, in your .bashrc (or in your current Bash session):

enable flyline 2>/dev/null || enable -f /path/to/libflyline.so flyline
flyline run-tutorial

Build from source

Clone the repo and run:

cargo build
enable flyline 2>/dev/null || enable -f /path/to/flyline_checkout/target/debug/libflyline.so flyline
flyline run-tutorial
Installation notes Disable flyline with `enable -d flyline`. #### BASH_LOADABLES_PATH Taken from https://www.gnu.org/software/bash/manual/bash.html: > The -f option means to load the new builtin command name from shared object filename, on systems that support dynamic loading. If filename does not contain a slash, Bash will use the value of the BASH_LOADABLES_PATH variable as a colon-separated list of directories in which to search for filename. The default for BASH_LOADABLES_PATH is system-dependent, and may include "." to force a search of the current directory. Bash 4.4 introduced `BASH_LOADABLES_PATH` Bash 5.2-alpha added a default value for `BASH_LOADABLES_PATH`. Check your Bash version with: `bash --version` So on Bash at least as recent as 5.2, if you install flyline to one of: - /opt/local/lib/bash - /opt/pkg/lib/bash - /usr/lib/bash - /usr/local/lib/bash - /usr/pkg/lib/bash Then you can simply run `enable flyline`.

Configuration

Flyline sets up its own tab completion so you can type flyline <Tab> in your shell to interactively browse and configure settings. Copy the commands into your .bashrc so they persist.

Explore this README and examples for what you can configure.

Rich prompts

Flyline supports dynamic content in PS1, RPS1 / RPROMPT, PS1_FILL, PROMPT_RULER, and PS2.

PS1

The PS1 environment variable sets the left prompt just like normal. See Bash prompt documentation, Arch Linux wiki, or Starship for more information. PS1 demo

PS1='\u@\h:\w$ '
PS1='\u@\h:\w\n$ '
PS1='\e[01;32m\u@\h\e[00m:\e[01;34m\w\e[00m\n$ '

[!TIP] Do git metrics slow down your prompt loading time? See custom widget or example widgets for a solution.

RPS1 / RPROMPT

The RPS1 / RPROMPT variable sets the right prompt similarly to Zsh. RPS1 demo

RPS1='\t'
RPS1='\t\n<'
RPS1='\e[01;33m\t\n<\e[00m'

PS1_FILL

PS1_FILL fills the gap between the PS1 and RPS1 lines. PS1_FILL demo

PS1_FILL='-'
PS1_FILL='🯁🯂🯃🮲🮳' # finger pointing to running man
PS1_FILL='🯁🯂🯃🮲🮳 \D{%.3f}'

PROMPT_RULER

PROMPT_RULER (or PS1_RULER) draws a horizontal separator above the prompt to cleanly separate previous command output from the new prompt. PROMPT_RULER demo

# Draw a full-width line with a box-drawing character
PROMPT_RULER='─'

# Style the ruler with ANSI colours
PROMPT_RULER=$'\e[90m─\e[0m'

# Insert a blank line above the prompt
PROMPT_RULER='empty-line'

PS2

The PS2 environment variable configures the multi-line continuation prompt. FLYLINE_PROMPT_LINE_NUMBER will be replaced by the line number: PS2 demo

# Styled line numbers with ANSI color
PS2='\e[2mFLYLINE_PROMPT_LINE_NUMBER>\e[0m '

# Custom prompt prefix with line numbers
PS2='\e[2mline FLYLINE_PROMPT_LINE_NUMBER:\e[0m '

# If you do want the default '> ' prompt, then you want:
PS2='\e[0m> '

Final (transient) prompts

PS1_FINAL, RPS1_FINAL, PS1_FILL_FINAL, and PROMPT_RULER_FINAL let you configure transient prompts. When a command is submitted, Flyline performs a final redraw using these environment variables instead of their standard counterparts. This keeps your terminal scrollback history clean by replacing complex, multi-line prompts with a minimal version.

Final prompts demo

PS1_FINAL='Ran at \D{%Y-%m-%d %H:%M:%S}> '
RPS1_FINAL=''
PS1_FILL_FINAL=''
PROMPT_RULER_FINAL=''

Dynamic time in prompts

Flyline recognises the standard Bash time escape sequences and re-evaluates them on every prompt draw, so the time shown is always current:

Sequence Output
\t 24-hour time — HH:MM:SS
\T 12-hour time — HH:MM:SS
\@ 12-hour time with am/pm
\A 24-hour time — HH:MM
\D{format} Custom format (see below)

These can be placed in any of the supported prompt variables:

# Right prompt showing 24-hour time in green
RPS1='\e[01;32m\t\e[0m'

# Right prompt showing 12-hour am/pm time
RPS1='\e[01;34m\@\e[0m'

Custom time format with \D{format}

Use \D{format} with any Chrono format string to display the time exactly how you want it. This is similar to \D{format} in the Bash prompt documentation, but the format string is interpreted by Chrono rather than strftime.

# Show date and time
RPS1='\e[01;32m\D{%Y-%m-%d %H:%M:%S}\e[0m'

# Show only hours and minutes
RPS1='\D{%H:%M}'

Custom prompt widgets

Create custom prompt widgets with flyline create-prompt-widget. Flyline will replace strings in the prompt matching the widget name with the widget's output. The available widget types are animation, mouse-mode, copy-buffer, custom, and last-command-duration.

Animations

Create your own animations with flyline create-prompt-widget animation --name [your animation name here] [FRAMES].... Flyline will replace strings in the prompt matching the animation name with the animation:

Custom animation demo

More examples can b

📈 近 7 天 Star 趋势

每日新增 Star(柱)与累计 Star(线)· 数据来自 GitHub

🏆 排名变化趋势

在各榜单中的排名历史(数字越小越靠前)

📋 历史上榜记录

每次快照的详细数据
日期 榜单 排名 周期新增 总 STAR