Discussion summary

Docx-CLI is a tool that allows agents to read and edit Word documents more efficiently, using half the time and tokens. It supports image extraction and replacement, and is aimed at automating larger document workflows.

What the discussion says

  • Users appreciate its efficiency and CLI-first approach.
  • Some discuss handling embedded images and XML parsing.
  • Suggestions include integrating with DSL tools for easier command generation.
CLI-first for document tooling is underrated.
danielsmori
The library is designed for longer workloads.
kirillklimuk

Comments

Hacker News

I like it

by MoAz06

Nice — CLI-first for document tooling is underrated. How are you handling embedded images in the XML? That was a pain point when I was parsing OOXML in a different context.

by danielsmori

If the reader needs the images, there's an explicit extract command that gets them into a folder. If the writer needs to update them, there's and explicit replace command and insert commands for that purpose. It all has to go into the relationship files of course.

by kirillklimuk

I haven’t looked under the hood here but to make simple text replacement via command line is an LLM even required? A human driven command line tool to do basic substitution on batches of files reliably would be amazing.

by rubyfan

you've never dealt with ooxml.

by cyanydeez

Not really - if you wanna do a text replacement you can extract it yourself and do some work (or just use this CLI). The library is designed for longer workloads.

by kirillklimuk

sed, awk. docx is just zipped xml.

by asdff

there is a python library for docx handling. my thinking was the use case for this was for larger scale automations / document processing.

by BorisMelnik

this is awesome - I wonder how this would combine with DSL tools like https://slangify.org

by librasteve

honestly, worth a try! might be easier for the LLMs than authoring CLI commands.

by kirillklimuk

nice to see others try to solve a problem we also experienced.

I'm also working on letting agents read/edit word docs but exposing it as a simple MCP

www.vespper.com

by topaztee

That's pretty cool!

by kirillklimuk

Very cool. So much of the 'capability overhang' of AI can be addressed with tools like this--data manipulation etc without LLMs having to galaxy brain everything in token space

by firasd

Yeah, I agree. Working on something like this for PDFs.

by kirillklimuk

For A while I was expecting that MCP will dominate, but we seem to be going in the direction of CLI being more prevalent. Can’t wrap my mind around it.

by DenisM

Same - but when I did a lot of work with these tools, it became clear to me they're a lot more trained on working with CLIs. There's just much more data available for them to train on.

by kirillklimuk

I know that the office suite format is a relic which is hard to get rid of. But I can't help feeling that in these new AI era, that we should focus on leaving that proprietary format behind.

It is one of the biggest facilitator of vendor lock in in the history of computing.

by felooboolooomba

Realistically... everyone's using it from students, to lawyers, to academics, and so on and so forth.

And given that LibreOffice and Google Docs are pretty good nowadays and OOXML is an open standard now post the monopoly rulings of the 90s, it's not quite as bad as it used to be.

by kirillklimuk

I've done many custom low token output CLIs like this for my day job and it's something I expect to see much more of.

by simlevesque

How would you compare that approach to spawning sub agents to operate high-token tools?

by DenisM

This is great - and another example of how much more efficient CLI tool use ends up being in actual day-to-day use. Claude Code and Hermes took it in and it runs great in my initial tries at it. Thanks for making and sharing it!

by rnxrx

fair point! i've got some stats in the body of the github, and a skill that has the eval that i've built for it.

by kirillklimuk

I originally started this project just to build a TA agent for a professor who didn't have any TAs (my wife). So as you can imagine, it was critical that it could properly write comments and only edit with track edits mode on... and do all of this without accidentally breaking the structure of the doc that couldn't be read.

It's since then expanded to cover everything from editing tables, hyperlinks, footnotes, and a lot more. Now it's a pretty powerful tool that can trivially fill out a MNDA form, mark up a contract, author a poetry booklet, and fill out an invoice, which is now the eval suite where the numbers in the title come from.

You might be asking, "why did you do all of this?" Well, I'm building an agent harness for normies that are not gonna know what a token even is but just want their stuff not to take an epoch and a half to run. So I've got to make the tools be MUCH more optimal than they've even been.

I figure putting them out to the community and inviting all of you to help me might be a way to do that =).

by kirillklimuk

Join the discussion

Write your take first — we'll ask for email only when you're ready to publish.

  • Hacker News
  • I like it
    by MoAz06
  • Nice — CLI-first for document tooling is underrated. How are you handling embedded images in the XML? That was a pain point when I was parsing OOXML in a different context.
    by danielsmori
  • If the reader needs the images, there's an explicit extract command that gets them into a folder. If the writer needs to update them, there's and explicit replace command and insert commands for that purpose. It all has to go into the relationship files of course.
    by kirillklimuk
  • I haven’t looked under the hood here but to make simple text replacement via command line is an LLM even required? A human driven command line tool to do basic substitution on batches of files reliably would be amazing.
    by rubyfan
  • you've never dealt with ooxml.
    by cyanydeez
  • Not really - if you wanna do a text replacement you can extract it yourself and do some work (or just use this CLI). The library is designed for longer workloads.
    by kirillklimuk
  • sed, awk. docx is just zipped xml.
    by asdff
  • there is a python library for docx handling. my thinking was the use case for this was for larger scale automations / document processing.
    by BorisMelnik
  • this is awesome - I wonder how this would combine with DSL tools like https://slangify.org
    by librasteve
  • honestly, worth a try! might be easier for the LLMs than authoring CLI commands.
    by kirillklimuk
  • nice to see others try to solve a problem we also experienced.

    I'm also working on letting agents read/edit word docs but exposing it as a simple MCP

    www.vespper.com

    by topaztee
  • That's pretty cool!
    by kirillklimuk
  • Very cool. So much of the 'capability overhang' of AI can be addressed with tools like this--data manipulation etc without LLMs having to galaxy brain everything in token space
    by firasd
  • Yeah, I agree. Working on something like this for PDFs.
    by kirillklimuk
  • For A while I was expecting that MCP will dominate, but we seem to be going in the direction of CLI being more prevalent. Can’t wrap my mind around it.
    by DenisM
  • Same - but when I did a lot of work with these tools, it became clear to me they're a lot more trained on working with CLIs. There's just much more data available for them to train on.
    by kirillklimuk
  • I know that the office suite format is a relic which is hard to get rid of. But I can't help feeling that in these new AI era, that we should focus on leaving that proprietary format behind.

    It is one of the biggest facilitator of vendor lock in in the history of computing.

    by felooboolooomba
  • Realistically... everyone's using it from students, to lawyers, to academics, and so on and so forth.

    And given that LibreOffice and Google Docs are pretty good nowadays and OOXML is an open standard now post the monopoly rulings of the 90s, it's not quite as bad as it used to be.

    by kirillklimuk
  • Hey, I'm building something a bit like that - please checkout https://smalldocs.org if you have time.

    I say it’s as if “Claude Code & Microsoft Office had a baby...”

    Code available: https://github.com/espressoplease/smalldocs

    Discord: https://discord.gg/txjATTsDaq

    Sample document: https://smalldocs.org/blogs/what-is-a-smalldoc

    Invoked via Claude Code by saying stuff like: “sdoc me the plan for this feature”, or “dig into our logs and sdoc me a report on our latency"

    by FailMore
  • I've done many custom low token output CLIs like this for my day job and it's something I expect to see much more of.
    by simlevesque
  • How would you compare that approach to spawning sub agents to operate high-token tools?
    by DenisM
  • This is great - and another example of how much more efficient CLI tool use ends up being in actual day-to-day use. Claude Code and Hermes took it in and it runs great in my initial tries at it. Thanks for making and sharing it!
    by rnxrx
  • There have been a few similar posts on HN recently for working with MS Office docs:

    https://github.com/iOfficeAI/OfficeCLI

    https://github.com/rcarmo/python-office-mcp-server

    https://github.com/espressoplease/smalldocs

    It would be great to see some benchmarks for token use, correctness, features etc.

    by dbcooper
  • fair point! i've got some stats in the body of the github, and a skill that has the eval that i've built for it.
    by kirillklimuk
  • I originally started this project just to build a TA agent for a professor who didn't have any TAs (my wife). So as you can imagine, it was critical that it could properly write comments and only edit with track edits mode on... and do all of this without accidentally breaking the structure of the doc that couldn't be read.

    It's since then expanded to cover everything from editing tables, hyperlinks, footnotes, and a lot more. Now it's a pretty powerful tool that can trivially fill out a MNDA form, mark up a contract, author a poetry booklet, and fill out an invoice, which is now the eval suite where the numbers in the title come from.

    You might be asking, "why did you do all of this?" Well, I'm building an agent harness for normies that are not gonna know what a token even is but just want their stuff not to take an epoch and a half to run. So I've got to make the tools be MUCH more optimal than they've even been.

    I figure putting them out to the community and inviting all of you to help me might be a way to do that =).

    by kirillklimuk

Related stories