ARIF(7) ARIF User Manual ARIF(7)

arif - Another Readline Input Framework

ARIF (Another Readline Input Framework) is an input method framework for GNU Readline.

The ARIF library API is separated into three parts: the base, frontend and engine API.

The base API manages input contexts and candidate pages, and acts as a bridge between the frontend and the engine. See the manual pages arif_ctx_create(3), arif_ctx_destroy(3), arif_set_engine(3), arif_query(3), arif_fetch(3) and arif_select_page(3) for details.

See below for the frontend and engine API.

An ARIF frontend determines how to fetch and interpret user input, and how to present candidates to the user.

Currently, the only supported frontend is based on the completion API of GNU Readline. See the manual pages arif_rl_enable(3), arif_rl_disable(3), arif_rl_complete(3) and arif_rl_display(3) for details.

ARIF is designed to (hopefully) cope with any line editor, not Readline in particular. You can implement your own frontend if Readline is not your cup of tea.

More frontends (e.g., tecla, ZLE) may be supported in the future.

An ARIF engine generates candidates from a given input text, presumably by communicating with an actual input method engine. The manual page for arif_set_engine(3) contains a detailed description on how to implement an ARIF engine.

An example engine implementation, powered by the Rime IME core library, is provided as a reference. See the manual page arif_rime(3) for details.

Also see arif_pinyin(3) for another engine, powered by libpinyin.

The arify(1) command-line tool, implemented on top of the ARIF library, can be used to make ARIF features available to existing programs, without the need to modify, rebuild or write plugins for those programs.

There's also rlexec(1), which reads user input using Readline, and executes another program for each line of input. This program is meant to be used with arify(1), but could also be useful in other scenarios.

ARIF is not meant to be an alternative of modern input method frameworks like IBus and Fcitx, which are more feature-rich, and more suitable for general users.

Instead, ARIF aims to provide a lightweight, portable and minimalist solution that can serve as a last resort. Particularly, ARIF does not depend on GUI toolkits like GTK or Qt (whereas most input method frameworks choose so), but instead focuses on line editors like GNU Readline, which has stable API and good portability.

Let us suppose that you're SSH-ing to your PC from a friend's to get some urgent work done, but unfortunately there isn't any IME that you're familiar with installed on their PC. In situations like that, ARIF may appear to be useful.

Also, if you prefer a "uniform user experience" when using Readline programs, you may choose ARIF over GUI-based input method frameworks (just like why Emacs users may choose pyim).

Copyright (C) 2025 CismonX <admin@cismon.net>

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.

You should have received a copy of the license along with this document. If not, see https://www.gnu.org/licenses/fdl-1.3.html.

arify(1), rlexec(1), arif_ctx_create(3), arif_ctx_destroy(3), arif_fetch(3), arif_rime(3), arif_rl_complete(3), arif_rl_disable(3), arif_rl_display(3), arif_rl_enable(3), arif_pinyin(3), arif_query(3), arif_set_engine(3), arif_select_page(3), readline(3)

ARIF project homepage: https://www.nongnu.org/arif/.

0.1.0 July 26, 2025 ARIF(7)