Skip to main content

Finding just the snippets in man page you and your model care about

Project description

logo_750

When LLMs use the Internet instead of the local documentation on the computer its running on, they make all kinds of mistakes: compatibility and deprecated usage, missing obvious things.

context7 fixes this only for things in context7. What about everything else?

Get your models to use the right documentation, locally, for the software you actually have, effeciently.

Mansnip, part of the DAY50 suite of open-source tools for AI workflows, solves the problem of irrelevant documentation going to the context window.

You can intelligently put only the parts of manpages you care about into your context window:

$ uvx mansnip --llm bash bind

And your terminal window:

$ uvx mansnip bash bind

Compare the token cost of various approaches for finding the documentation for bash's complete command:

$ man bash | token-count                            # whole page
73392
$ man bash | grep -C 3 complete | token-count       # naive approach with a bunch of garbage input
8833
$ mansnip bash complete | token-count               # mansnip without llm feature
2908
$ mansnip --llm bash complete | token-count         # with llm compaction!
1624

That's a 98% reduction! Sweet.

There's also a ready-to-go MCP server for it in mcp-server.py.

Just pip/pipx/uv tool install mansnip

My classic 2020 pitch below!

https://github.com/user-attachments/assets/1fb76ac3-54e7-48dd-b349-4c7fa89016c6

"As seen on YouTube!"


Don't you hate wasting time navigating through manpages with the leading pager's clunky search tools?

Ever try to find things like the "declare" built-in in bash(1) only to slodge through the results using the 'n' key going 'nope, nope, nope'?

the old way

Stop wasting time with the old way of manually stumbling through manuals. Say goodbye to these problems once and for all!

Finally there's a better way!

Introducting Mansnip!

Mansnip is a revolutionary way to navigate through manpages, a tool that no terminal should be without!

It intelligently searches through manpages and outputs the snippets relevant to your query as self-contained browsable sections. Simply use it the way you use man, at the command line, followed by your search term(s).

Watch how mansnip can immediately find bash(1)'s declare without any extra effort:

mansnip is amazing

Mansnip works on any manpage.

With mansnip you'll just zip through documentation, saving precious time so you can write GitHub readmes like you're trying to sell Ginsu steak knives.

See how mansnip obediently shows everything with a "-z" option in the 25,888 lines of the zshall manpage on a single screen, all at once, in an easy-to-read manner.

zshall for all

But wait, there's more! You'll also get the line number and hierarchical context totally free!

We're still not finished yet!

You'll also get to install it easily through pypi.

Here's how do it

$ pip3 install mansnip

Act now, servers are standing by.

mansnip

FADE TO BLACK

END SCENE


Want more? Here's some background

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mansnip-0.6.5.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mansnip-0.6.5-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file mansnip-0.6.5.tar.gz.

File metadata

  • Download URL: mansnip-0.6.5.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for mansnip-0.6.5.tar.gz
Algorithm Hash digest
SHA256 c9a6287d9f5c9c604878bf40ce5eabbc964806ac437c598c8e329e3e5ff2d1fc
MD5 13132cc6526433704e8e7c015e95d6b1
BLAKE2b-256 a0f04c45f1c444128add61fc957a59805816c7bd42ab04fa66ea388fa23e120d

See more details on using hashes here.

File details

Details for the file mansnip-0.6.5-py3-none-any.whl.

File metadata

  • Download URL: mansnip-0.6.5-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for mansnip-0.6.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f66276b1f622dce5d71a55c7135fc6007663bd68ba5fe6dbe4fb30065b2b4beb
MD5 3280d38fcec0be0b695b90e441346e83
BLAKE2b-256 17a762422e1ca81f95ebce7712e5b578fdac0ff5a9eb0d657ea68cba0f489f45

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page