Add flat output option to docs command#1411
Merged
david-crespo merged 2 commits intomainfrom Apr 10, 2026
Merged
Conversation
ahl
reviewed
Apr 8, 2026
| #[derive(ValueEnum, Debug, Clone)] | ||
| enum DocsFormat { | ||
| /// One line per command: full path and description | ||
| Flat, |
Collaborator
There was a problem hiding this comment.
What do you think about "text" as the alternative? I'd also suggest we not document one-per-line because I could imagine writing richer docs possibly with more info such as parameters.
Contributor
Author
There was a problem hiding this comment.
I considered text, I'm happy with that — only concern would be what if we had a compact text format like this for LLMs and fzf use, and then a more verbose version with the full docs. In that case I might prefer to call this compact.
jmcarp
approved these changes
Apr 9, 2026
jmcarp
left a comment
There was a problem hiding this comment.
- I think
flatandtextare both defensible format names, since the thing we're doing is flattening a nested json document into a text document. Maybe a slight preference fortext, since my main reaction to the previous default of the big json blob was "I want text instead of json". - I was curious about this in the first place because cc can have a hard time discovering cli commands, so I tried it out. It doesn't seem to occur to claude to look at the
docscommand at all without prompting—even opus seems to guess commands at random, then tryoxide --help. Telling it to checkoxide docsgives better results. I think it would be fine to write a global "memory" about this, although it would be nice if some convention existed for llm-friendly docs from clis. - For completeness, cc also managed to find the right commands with
oxide docs --format json, but it decided to write a python script to search the output rather than ingesting it directly. That would probably mostly work, especially as claude includes more oxide content in its training materials, but I think giving it the flat/text format will be more robust. Also, it would be nice for this to work well with dumb models!
8610f5d to
be256e7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #1278 (comment). This does two things:
--formatflag tooxide docswith two options:jsonandflatjsonformat to generate the schema used by the docs site, and that's versioned indocs/cli.json, so we never actually have to pass the flagI think this is useful for both people and agents.
It's not quite @taspelund's idea of built-in command search, but you can pipe it to fzf just fine:
2026-04-08-cli-docs-fzf.mp4
I also improved the help output for the command to say "List all CLI commands" so that you can find this command more easily from
oxide -h.