Skip to main content

nibs

PyPI Python Test

Read a web page by its headings: list them, then print only the section you need.

An AI agent that reads a whole documentation page to answer one question puts tens of thousands of characters into its context, most of which it never uses. nibs lets it look at the page's headings first and then take just one section, in the page's own words.

$ nibs toc https://www.postgresql.org/docs/current/sql-select.html
63,204 chars, 37 headings
  1.   SELECT  (69)
  2.   Synopsis  (2,525)
  3.   Description  (3,137)
  4.   Parameters  (46,642)
  5.     WITH Clause  (5,818)
  ...
 19.     The Locking Clause  (4,105)
  ...
$ nibs find https://www.postgresql.org/docs/current/sql-select.html NOWAIT --limit 2
## Synopsis
  [ FOR { UPDATE | NO KEY UPDATE | SHARE | KEY SHARE } [ OF from_reference [, ...] ] [ NOWAIT | SKIP LOCKED ] [...] ]
## The Locking Clause
  FOR lock_strength [ OF from_reference [, ...] ] [ NOWAIT | SKIP LOCKED ]
[nibs: stopped at 2 matches; pass --limit]
$ nibs section https://www.postgresql.org/docs/current/sql-select.html 19
### The Locking Clause

FOR UPDATE, FOR NO KEY UPDATE, FOR SHARE and FOR KEY SHARE are locking clauses; they affect how SELECT locks rows as they are obtained from the table.
...

Install

pipx install nibs      # or: uv tool install nibs

Python 3.11 or later. No other dependencies.

Commands

nibs toc <url>                  # headings, numbered, with each section's size in characters
nibs section <url> <n|heading>  # one section, by its number in toc or by heading text
nibs find <url> <regex>         # matching lines, each under the heading it belongs to
nibs stats                      # characters printed so far, against reading each page whole
  • section prints at most 8,000 characters; --max changes that. A heading given as text matches exactly first, then as a case-insensitive substring.
  • find prints at most 30 lines; --limit changes that.

How a page is read

  • Only http and https URLs are read, also when a page redirects.
  • For an HTML page, nibs uses the Markdown that the site serves at the URL with .md added to its path, if there is one.
  • Otherwise nibs turns the HTML into headings, text and code blocks (from <pre>), leaving out scripts, styles, navigation, sidebars, and the page's own header and footer.
  • A very long page is read only up to a limit; when a page goes past it, toc, section and find say so.
  • nibs does not run JavaScript. A page that builds its content in the browser comes back with little or no text; when no headings are found, nibs says so.
  • A fetched page is used for 15 minutes from ~/.cache/nibs (or $XDG_CACHE_HOME/nibs), so toc, section and find on the same page fetch it once. A later run that fetches a page removes what is older than that.

The details, including where the HTML rules let text through, are in docs/reading.md.

Using it from an agent

In Claude Code, install the nibs plugin. It gives the agent a skill that tells it how to read a page with nibs.

claude plugin install nibs --marketplace nhinata/nibs   # Claude Code 2.1.292 or later
claude plugin update nibs@nibs                          # to update it

Claude Code updates the plugin on its own only when auto-update is turned on for the nibs marketplace in /plugin.

For another agent, put the skill where the agent looks for skills, or copy its text into the agent's instructions, for example in AGENTS.md.

What nibs prints is the page's own text, including text the page hides from a person reading it. Have the agent read it as data, not as instructions.

The skill does not let nibs run without asking. nibs fetches any URL it is given, so if you let it run without asking, text on a page could lead the agent to put data into a URL and send it to another site.

The usage record

Each run adds one line to ~/.local/state/nibs/usage.jsonl (or $XDG_STATE_HOME/nibs/usage.jsonl) with:

  • the time and the command
  • the URL's scheme, host, port and path (not the user name and password, the query string or the fragment, which can carry a credential)
  • the page's size, how many characters were printed, and how many headings the page has
  • how the page was read: md for the URL with .md added to its path, html for HTML turned into text, text for any other answer, used as it came

nibs stats reads it. Set NIBS_LOG to another path to keep the record there. Nothing is sent anywhere.

License

MIT

Metadata

Release files for nibs 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nibs 0.3.4
File Size Uploaded Provenance Actions
nibs-0.3.4.tar.gz 40.2 kB With provenance Details for nibs-0.3.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nibs 0.3.4
File Interpreter ABI Platform Actions
nibs-0.3.4-py3-none-any.whl Python 3 none any Details for nibs-0.3.4-py3-none-any.whl

Total release size: 54.9 kB

Release files / nibs-0.3.4.tar.gz

Download URL nibs-0.3.4.tar.gz
Size 40.2 kB
Tags Source
SHA-256 checksum
How to use checksums
111a2a48a6d4a368d54add719aab4e30d57ba7f159f1845577067081a09f3834
BLAKE2b-256 checksum
How to use checksums
acba2aae6e7879c9fabce40123276f7bb6ef6f083ee3f9ce0c893e529fbbc341
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / nibs-0.3.4-py3-none-any.whl

Download URL nibs-0.3.4-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e364c3107b91075a6b4709f429f1bcc3416a0ad218ca57a3aa0517c751591e7
BLAKE2b-256 checksum
How to use checksums
2bebd3f85020507a00906155800282f46007fb5608a7b23a3fa181d68a0a1dfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for nibs 0.3.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nibs-0.3.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page