hermes-offline-info
A Hermes Agent plugin that lets the agent search and
read the GNU Info manuals on your own machine, without internet access. Info is the compiled
form of Texinfo documentation: the full manuals of coreutils, grep, sed, findutils, diffutils, bash,
make, gawk, tar, Emacs, Elisp, Org, Gnus and most other GNU software, installed in
/usr/share/info on most Linux systems. They are usually far more complete than the man pages.
Useful when the agent needs an exact answer about a GNU tool (an option, a function, a variable)
from the documentation of the version you have installed, also when it has no network.
This plugin is not affiliated with the GNU Project. It reads the Info format with Python's standard
library only, following the
Info Format Specification
in the Texinfo manual. Where the specification leaves room ("practice wins"), it does what the
standalone info reader does.
Tools
| Tool | What it does |
|---|---|
info_list | Lists the configured manuals: id, title, short description (from the manual's own directory entry), number of nodes and of index entries. |
info_search | scope: index (default) looks up the manuals' own index entries and node names, like the info reader's i command. Every word of the query must appear, in the entry or in the node it points to, so sort -k finds the -k entry of sort invocation. Exact entries come first, then entries starting with the query. scope: text searches the full text of every node and returns a snippet. Case and accents are ignored. |
info_read | Returns a node as plain text, with its up, next and prev nodes, its menu and its cross-references, each with the manual and node to read next. node may be an anchor or (manual)Node, as cross-references give it. With the line of an index result, the text starts where the entry is documented. Long nodes come back in parts (next_offset). |
The tools are offered to the model only while at least one path is configured.
Install
hermes plugins install offline-info --enable
No dependencies: the plugin uses only the Python standard library (gzip, bz2, lzma, and
compression.zstd on Python 3.14 for .zst manuals).
Configure
plugins:
entries:
offline-info:
settings:
paths: # Info files and/or folders holding them
- /usr/share/info
max_chars: 12000 # optional; characters per info_read call (1000-100000)
A path can be a manual's file (coreutils.info, coreutils.info.gz, ... or any subfile of a split
manual, such as make.info-2.gz), or a folder, which is scanned together with its direct subfolders
(Debian keeps the Emacs manuals in /usr/share/info/emacs). The dir file is not a manual and is
skipped. Each manual's id is its file name without .info and the compression suffix, for example
coreutils. If two manuals share a name, the first one wins and the second is reported under
problems. Missing paths, missing subfiles and unreadable files are reported the same way and do
not hide the others.
Some distributions ship part of the manuals in separate documentation packages; Debian, for
example, ships the Emacs manuals in emacs-common-non-dfsg.
How the format is read
- Files. A manual is one file or a main file with an indirect table naming its subfiles
(name.info-1,name.info-2, ...). Each may be uncompressed or.gz,.bz2,.xz,.lzma, or
.zst(Python 3.14 or later). - Nodes are found by scanning for node separators, not by trusting the tag table's byte
positions, which the specification says may be off. Header fields (File,Node,Next,
Prev/Previous,Up) are read case-insensitively, with DEL-quoted names. - Anchors are found in the tag table. As
infodoes, an anchor belongs to the node whose tag
comes before it in the table, at the anchor's distance from that tag, so an offset error both
positions share cancels out. - Index entries follow the reader's rules: the term runs to the last colon on the line, outside
DEL-quoted node names, so terms may contain colons. The(line N)part may be on the next line.
Lines count from 1 at the node's header line, asinfocounts them (info/session-cmd.c). - Menus and cross-references. Menus count from the
* Menu:line on. Cross-references are
*Note/*notefollowed by white space, in the short (node::), labelled (label: node.) and
other-manual ((manual)node) forms, possibly across a line break. - Encoding comes from the manual's
coding:local variable. Without one, UTF-8 is tried, then
Latin-1. - Info directives (
\0\b[index\0\b],\0\b[image ...\0\b]) are removed from the text. An image
becomes its text version or[image: alt text].
What it does on your machine (disclosure)
- Reads only the manuals you configure. For each one it opens its main file and the subfiles
its indirect table names. A subfile name with a path separator or a leading dot is refused, so a
manual cannot make the plugin read outside its own folder. Folders are listed only to find
*.infofiles. - No network. Search and reading are local. The test suite checks this by refusing to open any
socket while all three tools run. - Writes nothing. Files are read for each call; nothing is kept between calls. The tests check
that no file in the configured folders changes. - No credentials, no shell commands, no background work.
- Bounded reading. A manual larger than 128 MB unpacked (all its files together) is refused
rather than loaded. A search stops after 60 seconds and says so (stopped_early). - Content is third-party text. Node text is returned to the model as the manual's authors wrote
it.
Limits
- Nothing is indexed or cached: every call reads the manuals it needs again. Measured on an Apple
M4 with Python 3.14 over 71 manuals (22 MB unpacked: the seven Debian manuals and the 64 Emacs
manuals listed below): an index search takes about 0.5 s, a full-text search about 0.9 s, and
reading a node of the 5 MB Elisp manual about 0.06 s. Passmanualto search one only. - Man pages are not read; only Info manuals.
- A reference whose node name contains a colon but is not DEL-quoted (older makeinfo output) is
ambiguous and may not resolve;infohas the same limit. - Images are not returned, only their text or alt text.
Tested with
- Debian packages: coreutils 9.12, diffutils 3.12, findutils 4.11 (
find,find-maint),
grep 3.12, sed 4.9 andinfo-stndfrom texinfo 7.3. - The 64 Emacs 30.2 manuals from Debian's
emacs-common-non-dfsg(Elisp, Emacs, Org, Gnus,
Calc, Tramp, ...). - Texinfo 7.3's own test files: the standalone reader's test manuals (
info/t/infodir: split,
anchors, quoting, index edge cases, malformed split) and makeinfo's expected outputs
(tta/perl/t/results: split manuals, Latin-1, Latin-2, Shift_JIS and EUC-CN encodings, colons in
index entries and node names). These files are GPL and are not copied into this repository.
Results:
- Every node is read without error: all nodes of the Debian and Emacs manuals, and the 282 nodes of
the 76 texinfo test files that have nodes. The six that have none (empty outputs, a split manual
whose subfiles are absent) are reported underproblems. - The Shift_JIS, EUC-CN and Latin-2 outputs decode by their
coding:with no replacement
characters. - Every menu entry, cross-reference and index entry pointing inside its own manual resolves to a
node or anchor (6,828 links in the texinfo and Debian set). The exceptions are links the reference
reader cannot resolve either: anchors outside any node in makeinfo'sindex_special_region
outputs, the deliberately broken test menus, and the unquoted colon case above. - Sampled index entries of every Debian and Emacs manual are found by
info_search(the
real_worldtest below).
Development
python -m pip install pytest
python -m pytest -c tests/pytest.ini tests
OFFLINE_INFO_REAL=/usr/share/info python -m pytest -c tests/pytest.ini tests -k real_world
hermes plugins validate .
The tests write manuals in the layout makeinfo produces: a preamble with directory entries, header
lines with DEL-quoted names, menus, cross-references in every form, an index node with colons in
terms and (line N) on the next line, an image directive, a tag table pointing at each node's
separator with anchors (one on a one-character line), a coding: of ISO-8859-2, and a split manual
with gzip-compressed subfiles. Manuals are compressed with gzip, bzip2, xz and, on Python 3.14,
zstd. Broken inputs: missing subfiles, a subfile name leading outside the folder, a file with no
nodes, and a manual over the size limit.
OFFLINE_INFO_REAL (one or more paths, separated like PATH) adds a test against real manuals: it
reads every node of every manual, checks that every link inside a manual resolves, and searches
for a sample of each manual's index entries.
License
MIT
README from the reviewed commit d86ee63; it updates when the author re-pins.

nftpoetrist