{"id":13485515,"url":"https://github.com/jline/jline3","last_synced_at":"2026-03-11T09:10:25.932Z","repository":{"id":37432395,"uuid":"60111626","full_name":"jline/jline3","owner":"jline","description":"JLine is a Java library for handling console input.","archived":false,"fork":false,"pushed_at":"2025-05-06T07:31:34.000Z","size":9290,"stargazers_count":1573,"open_issues_count":36,"forks_count":226,"subscribers_count":40,"default_branch":"master","last_synced_at":"2025-05-06T16:14:43.727Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jline.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-05-31T18:00:01.000Z","updated_at":"2025-05-06T07:31:39.000Z","dependencies_parsed_at":"2023-10-12T15:23:54.892Z","dependency_job_id":"98d0a4d0-b3b6-4d94-8564-bf21a5a6d1c5","html_url":"https://github.com/jline/jline3","commit_stats":{"total_commits":2585,"total_committers":116,"mean_commits":22.28448275862069,"dds":0.6038684719535783,"last_synced_commit":"3c634784c4c5cc8ea38a61e8585c18bad8fc6443"},"previous_names":[],"tags_count":60,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jline%2Fjline3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jline%2Fjline3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jline%2Fjline3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jline%2Fjline3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jline","download_url":"https://codeload.github.com/jline/jline3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253990456,"owners_count":21995773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T18:00:24.800Z","updated_at":"2026-03-11T09:10:25.926Z","avatar_url":"https://github.com/jline.png","language":"Java","readme":"# JLine - Java Console Library\n\n[![Maven Central](https://img.shields.io/maven-central/v/org.jline/jline.svg)](https://search.maven.org/search?q=g:org.jline)\n[![Build Status](https://github.com/jline/jline3/actions/workflows/master-build.yml/badge.svg)](https://github.com/jline/jline3/actions)\n[![License](https://img.shields.io/badge/License-BSD-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n\nJLine is a Java library for handling console input. It's similar to [GNU Readline](https://tiswww.case.edu/php/chet/readline/rltop.html) but with a focus on portability, flexibility, and integration with Java applications. See https://jline.org for its documentation.\n\n## Requirements\n\n- **Java 11 or higher**: JLine 4.x requires Java 11 as the minimum runtime version\n- **Maven 4.0 or higher**: JLine 4.x requires Maven 4.0+ for building from source\n- **Note**: JLine 3.x supports Java 8+ and Maven 3.x+, but JLine 4.x requires Java 11+ and Maven 4.0+\n\n## Features\n\n- **Cross-platform support**: Works on Windows, macOS, Linux, and other Unix-like systems\n- **Line editing**: Emacs and Vi editing modes with customizable key bindings\n- **History management**: Persistent command history with search capabilities\n- **Tab completion**: Customizable completion for commands, arguments, and file paths\n- **Syntax highlighting**: Colorize input based on custom rules\n- **Password masking**: Secure input for sensitive information\n- **ANSI terminal support**: Full support for ANSI escape sequences and colors\n- **Unicode support**: Proper handling of wide characters and combining marks\n- **ConsoleUI components**: Interactive UI elements like menus, checkboxes, and prompts\n\n## Installation\n\n### Maven\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.jline\u003c/groupId\u003e\n    \u003cartifactId\u003ejline\u003c/artifactId\u003e\n    \u003cversion\u003e4.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle\n\n```groovy\nimplementation 'org.jline:jline:4.0.0'\n```\n\n### Java 11-21 Compatibility (JDK11 Classifier)\n\nIf you're using Java 11-21 and need to avoid Java 22+ class files, use the `jdk11` classifier. This variant excludes the FFM (Foreign Function \u0026 Memory) terminal provider which requires Java 22+:\n\n**Maven:**\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.jline\u003c/groupId\u003e\n    \u003cartifactId\u003ejline\u003c/artifactId\u003e\n    \u003cversion\u003e4.0.0\u003c/version\u003e\n    \u003cclassifier\u003ejdk11\u003c/classifier\u003e\n\u003c/dependency\u003e\n```\n\n**Gradle:**\n\n```groovy\nimplementation 'org.jline:jline:4.0.0:jdk11'\n```\n\nThe `jdk11` classifier artifact:\n\n- Contains all JLine functionality\n- Excludes the FFM terminal provider (`org.jline.terminal.impl.ffm.*` classes compiled with Java 22)\n- Uses JNI or Exec providers for native terminal access instead\n- Compatible with Java 11-21\n\n**Note:** For JLine 3.x, use the `jdk8` classifier instead, which is compatible with Java 8-21.\n\n## Quick Start\n\nHere's a simple example to get you started:\n\n```java\nimport org.jline.reader.*;\nimport org.jline.reader.impl.*;\nimport org.jline.terminal.*;\nimport org.jline.terminal.impl.*;\n\npublic class HelloJLine {\n    public static void main(String[] args) {\n        try {\n            // Create a terminal\n            Terminal terminal = TerminalBuilder.builder()\n                    .system(true)\n                    .build();\n\n            // Create line reader\n            LineReader reader = LineReaderBuilder.builder()\n                    .terminal(terminal)\n                    .build();\n\n            // Prompt and read input\n            String line = reader.readLine(\"JLine \u003e \");\n\n            // Print the result\n            System.out.println(\"You entered: \" + line);\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n    }\n}\n```\n\n## Modules\n\nJLine is organized into several modules:\n\n- **jline-terminal**: Core terminal functionality\n- **jline-reader**: Line editing and reading\n- **jline-console**: Higher-level console abstractions\n- **jline-console-ui**: Interactive UI components (checkboxes, lists, etc.) - **Deprecated**\n- **jline-prompt**: Modern prompt API for interactive console applications\n- **jline-style**: Styling and coloring support\n- **jline-builtins**: Built-in commands and utilities\n- **jline-remote-ssh**: SSH server support\n- **jline-remote-telnet**: Telnet server support\n\n## JPMS (Java Platform Module System) Support\n\nJLine provides full support for JPMS starting with version 4.0. The following modules are proper JPMS modules with `module-info.java`:\n\n### ✅ JPMS Modules (with module-info.java)\n\n| Module | Artifact ID | Module Name | Description |\n|--------|-------------|-------------|-------------|\n| **Core Modules** | | | |\n| Native | `jline-native` | `org.jline.nativ` | Native library loading |\n| Terminal | `jline-terminal` | `org.jline.terminal` | Core terminal functionality |\n| Terminal FFM | `jline-terminal-ffm` | `org.jline.terminal.ffm` | FFM-based terminal (JDK 22+) |\n| Reader | `jline-reader` | `org.jline.reader` | Line editing and reading |\n| Style | `jline-style` | `org.jline.style` | Styling and coloring |\n| **Extended Modules** | | | |\n| Builtins | `jline-builtins` | `org.jline.builtins` | Built-in commands |\n| Console UI | `jline-console-ui` | `org.jline.console.ui` | Interactive UI components (deprecated) |\n| Prompt | `jline-prompt` | `org.jline.prompt` | Modern prompt API for interactive applications |\n| Console | `jline-console` | `org.jline.console` | Console framework |\n| Jansi Core | `jline-jansi-core` | `org.jline.jansi.core` | ANSI support |\n\n### ❌ Non-JPMS Modules (automatic modules)\n\nThese modules remain as automatic modules for compatibility:\n\n| Module | Artifact ID | Reason |\n|--------|-------------|---------|\n| Terminal Jansi | `jline-terminal-jansi` | Legacy compatibility |\n| Groovy | `jline-groovy` | Groovy integration |\n| Remote SSH | `jline-remote-ssh` | SSH server support |\n| Remote Telnet | `jline-remote-telnet` | Telnet server support |\n| Demo | `jline-demo` | Example applications |\n| Graal | `jline-graal` | GraalVM native image support |\n\n### 🎯 Usage with JPMS\n\nWhen using JLine in a modular application, add the required modules to your `module-info.java`:\n\n```java\nmodule your.application {\n    requires org.jline.terminal;\n    requires org.jline.reader;\n    requires org.jline.style;        // Optional: for styling\n    requires org.jline.builtins;     // Optional: for built-in commands\n    requires org.jline.console;      // Optional: for console framework\n    requires org.jline.prompt;       // Optional: for modern prompt API\n    requires org.jline.console.ui;   // Optional: for legacy UI components (deprecated)\n}\n```\n\n**Note**: The FFM terminal provider (`jline-terminal-ffm`) requires JDK 22+ and native access permissions:\n```bash\njava --enable-native-access=org.jline.terminal.ffm your.application\n```\n\n## Documentation\n\n- [Website](https://jline.org)\n- [Wiki](https://github.com/jline/jline3/wiki)\n- [Javadoc](https://www.javadoc.io/doc/org.jline/jline/latest/index.html)\n\n## License\n\nJLine is licensed under the [BSD License](https://opensource.org/licenses/BSD-3-Clause).\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","funding_links":[],"categories":["Projects","Java","Java ☕","[Java](https://dev.java/)","项目","二、核心功能库（解决具体开发问题）"],"sub_categories":["CLI","Useful awesome list for Go cli","7. 命令行工具"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjline%2Fjline3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjline%2Fjline3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjline%2Fjline3/lists"}