Live data from Hacker News

Show HN: Docx-CLI: agents read/edit Word docs using 1/2 the time and tokens

github.com

31–37 of 37 posts

Re: Show HN: Docx-CLI: agents read/edit Word docs using 1/2 the time and tokens

#34

Is there a generalizable approach that you have found for finding ways to be more efficient with the models, or is it case-by-case?

Still working it out as I build more of these CLIs.

That being said:

- every single command you write MUST have a help text. that help text should also tell agents what the easiest path forward it. for example, the locator system in this CLI relies on the positions on paragraphs. these can change after an edit. so I prompt in the help text to use batch edits.

- errors must be clearly marked. for example, if an agent is doing a replace, but the replace comes back with "0 edits made", that's an error. otherwise the agents carry on going on obliviously.

- a lot of the CLI tools decide to use JSON as the default output. I started out that way as well. for agents, that immediately means having to invoke jq or a similar other tool to get it to be understood. the weaker the model, the worse they do on that. I found that providing markdown with annotations beats JSON on most tasks.

- use image reading as a last resort. if it's possible to give the model the information it needs as text, it will do a better job working with it than it will thinking through an image. thus, for this CLI, i do have a render command, but explicitly prompt in the help texts to use it for things that are not obvious from the markdown like layout.

Re: Show HN: Docx-CLI: agents read/edit Word docs using 1/2 the time and tokens

#35
post #31

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.

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.

Re: Show HN: Docx-CLI: agents read/edit Word docs using 1/2 the time and tokens

#36

Is there a generalizable approach that you have found for finding ways to be more efficient with the models, or is it case-by-case?

also, batched commands do wonders. if the agent wants to make multiple changes at once, give it the facility to do so. this is done via --batch in the CLI and is especially important since the underlying positional markers shift.

Re: Show HN: Docx-CLI: agents read/edit Word docs using 1/2 the time and tokens

#37
post #29

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.

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

If your goal is to use less overall tokens to solving a task, then spawning subagents is not the best idea.

Generally, they will have to use more tokens to reach the same outcome, per some research: https://arxiv.org/abs/2604.02460

Post reply on HN