Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. iOS
  3. Linenoise

Linenoise

BSD-2-ClauseSwift

A pure Swift implementation of Linenoise, providing a minimal, zero-config readline replacement for command-line applications.

GitHubGitHub
155 stars14 forks0 contributors

What is Linenoise?

Linenoise-Swift is a pure Swift library that implements the Linenoise functionality, serving as a minimal and dependency-free replacement for readline in command-line applications. It solves the problem of adding advanced line-editing, history, and completion features to terminal-based Swift tools without relying on external C libraries or complex configurations.

Target Audience

Swift developers building command-line tools, REPLs, or interactive terminal applications that require robust user input handling.

Value Proposition

Developers choose Linenoise-Swift for its pure Swift implementation, which eliminates external dependencies and simplifies integration via Swift Package Manager, while providing a modern, Swifty API that mirrors the capabilities of the original Linenoise library.

Overview

A pure Swift replacement for readline

Use Cases

Best For

  • Building Swift-based command-line tools with interactive prompts
  • Creating REPLs (Read-Eval-Print Loops) in Swift
  • Adding line-editing with emacs keybindings to terminal apps
  • Implementing tab-completion for custom command sets
  • Developing CLI applications that require persistent command history
  • Providing contextual hints for user input in terminal interfaces

Not Ideal For

  • Swift projects targeting Windows or other non-Unix platforms, as Linenoise-Swift only supports macOS and Linux.
  • Applications requiring vi-mode keybindings or extensive keybinding customization beyond emacs-style.
  • Teams needing advanced readline features like multi-line editing or syntax highlighting, which are beyond Linenoise's minimalist scope.
  • Developers building GUI or server-side Swift applications where terminal line-editing is irrelevant.

Pros & Cons

Pros

Pure Swift Implementation

Built entirely in Swift with no external dependencies, ensuring seamless integration via Swift Package Manager, as emphasized in the README.

Modern Swifty API

Provides a simple, zero-configuration API that mirrors Swift conventions, making it easy to replace standard readline, as shown in the quick start example.

Comprehensive Line-Editing

Supports essential features like emacs keybindings, history handling, tab-completion, and hints, all detailed in the API section with examples.

Configurable History Management

Allows setting history limits, file persistence, and edit preservation, offering flexible history control as explained in the History section.

Cons

Limited Keybinding Support

Only includes emacs-style keybindings; developers needing vi-mode or custom schemes must look elsewhere, which can be restrictive for diverse user preferences.

Platform Restrictions

Explicitly supports only macOS and Linux, excluding Windows and other platforms, which hinders cross-platform Swift projects.

Minimalist Feature Set

As a port of the minimalist Linenoise library, it lacks advanced readline capabilities like multi-line editing or extensive customization found in GNU readline.

Frequently Asked Questions

Quick Stats

Stars155
Forks14
Contributors0
Open Issues4
Last commit3 years ago
CreatedSince 2017

Tags

#tab-completion#library#pure-swift#history-management#swift-package-manager#readline-replacement#terminal#console#line-editing#command-line#swift#cli-tools#hints

Built With

S
Swift

Included in

iOS51.7kSwift26.0k
Auto-fetched 1 day ago

Related Projects

Swift Argument ParserSwift Argument Parser

Straightforward, type-safe argument parsing for Swift

Stars3,717
Forks382
Last commit4 days ago
CommanderCommander

Compose beautiful command line interfaces in Swift

Stars1,535
Forks85
Last commit4 years ago
SwiftShellSwiftShell

A Swift framework for shell scripting.

Stars1,057
Forks86
Last commit2 months ago
SwiftCLISwiftCLI

A powerful framework for developing CLIs in Swift

Stars880
Forks72
Last commit4 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub