3 ms·
Hey HN friends! I've taken `fx` back to the drawing board and completely rewritten it from the ground up. Excited to share what's new: 1. *Going Big*: `fx` n
by medv 3y ago
Hey HN friends!
I've taken `fx` back to the drawing board and completely rewritten it from the ground up. Excited to share what's new:
1. *Going Big*: `fx` now gracefully handles even the most massive JSON files.
2. *A New TUI Look*: Dive deep into your data with a revamped terminal interface—now with themes!
3. *Swift Navigation with Dig Fuzzy Search*: Feeling lost in JSON? Just type `.` and navigate with ease.
4. *Powerful Regex Search*: Scan across your entire JSON content with precision.
5. *Elegant Long String Wraps*: No more cut-offs. Your strings wrap beautifully now.
6. *All Things JSON*: Added love for comments, trailing commas, and JSON streams.
Pouring my heart and soul into this rewrite has been a journey to make `fx` faster and more powerful. If you find value in what I've crafted and want to support its future, consider sponsoring on GitHub.
Would love to hear your thoughts and feedback!
- verdverm 3y agoWhat can you do with the JSON in the TUI? Anything besides looking at it? (https://fx.wtf/getting-started#json-processing https://fx.wtf/getting-started#json-processing but from the TUI?) Built something similar, but with love for all things CUE (also works for JSON/Yaml) (https://youtu.be/XNBqBWO4y08 https://youtu.be/XNBqBWO4y08) Yours looks to have a better object navigation, I might have to be inspired by it! How do you like Bubbletea? We went with tcell/tview (fork) for more control of the UI & event handling
- matthewtse 3y agowow nice, I'll give this a try. I've always used jq for viewing json, but it's the wrong tool for my use. I basically want to explore json interactively, not parse it specifically. So the workflow is to keep "jq"ing it, and modifying my jq query until I find what I'm looking for. Your tool looks like it allows interactive exploration.
- nanny 3y agoYou may be interested in an interactive jq tool like jiq or others: https://github.com/fiatjaf/awesome-jq https://github.com/fiatjaf/awesome-jq (do a ctrl-f for "interactive" on this page).
- anonymoushn 3y agoHello, Is there a commonly-used grammar for "json with comments and trailing commas" or does everyone just try to copy the jsonc from vscode?
- verdverm 3y agoIt's basically https://json5.org/ https://json5.org/ CUE will happily take your JSON with comments and extra commas, or no commas too (lists still need them), most keys can be unquoted, and it's just a one-liner to get valid json or yaml from it
- IshKebab 3y agoJsonnet does too I believe. I wanted to like Cue but it only works with Go and it doesn't actually let you link the schemas you write from the "document" files, which means no automatic schema checking and no IDE support. Giving up two huge benefits of having a schema in the first place.
- verdverm 3y agoI'm not sure what you mean about the schema / documents thing. Can you elaborate? I've not had problems "linking" (?) data and schemas. I'd guess the lack of documentation is more to blame here. CUE is most often used as a CLI, so no Go is needed, that's really for advanced cases. Being Go, you can compile to SO or WASM, so can use it from pretty much any language. The lack of LSP is being actively worked on right now, I'm hoping they'll have something before the year is out
- IshKebab 3y agoIn an XML document you can specify the XML schema location with `xsi:schemaLocation`. In a JSON document you can specify the JSON Schema location with `$schema`. In a Cue document how do you specify the location of the Cue schema? As far as I can tell you can't. And yes I am aware that the concept of a "document" and a "schema" are basically merged in Cue, but that doesn't mean I don't want to do this. > CUE is most often used as a CLI, so no Go is needed Only because that's the only way you can use it. > Being Go, you can compile to SO or WASM Compiling to a shared library is awkward because you then need to have the Go toolchain installed. WASM might be an option ... I couldn't find out how Go actually works in WASM though given that it needs a GC and threads, and WASM currently has neither. Do they ship their own WASM GC? Either way, it's of no practical use since nobody has actually done that. Look at the languages supported by Jsonnet for comparison: https://jsonnet.org/ref/bindings.html https://jsonnet.org/ref/bindings.html Python, C, Rust (twice), Go (twice), Lua, Node, PHP, Ruby, Haskell. If I'm loading a config file from Python I don't want to have to mess around with `subprocess.run()` to read it. It's a solvable problem... but today, it's a bit of a turn-off.
- etdr 3y agoI am probably missing something but is interactive mode not a flag? Is it just what happens with a longer JSON automatically?
- albybisy 3y agohow do you use the Built-in Functions? i tried them but it gives me error every time
- tpmx 3y agoSome feedback: - Some indication of how far down you've scrolled would be useful for "situational awareness". Perhaps a percentage number in the status bar (like emacs/vim?) - I miss not having the Home/End keys bound to the goto top/bottom actions - The cursor behavior when pressing PageDn/PageUp throws me off. Emacs when pressing PageDn: Cursor ends up at the top of the window. Vim: Cursor stays at the current position. notepad.exe: Cursor ends up in the middle of the window. Fx: Cursor ends up at the bottom of the window. - The . navigation is very neat with the tab completion. Probably stupid observation: If you remove the alphabet key shortcuts you wouldn't need the (non-discoverable) dot. :)
- medv 3y agoThanks for the feedback. Will try to address it in future releases. Yes pgdown behaviour need to be refactored. Home/end is easy to add. > If you remove the alphabet key shortcuts you wouldn't need the (non-discoverable) dot. :) I did not get this one.
- sigg3 3y agoThis looks really nice, well done! I never could get used to jq's syntax so instead I've just been grepping. But this looks to be for jq what htop is to top, which is great for exploring response data.
- jbverschoor 3y agoWhy not call it Jim? JSON vim