Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: reload #326

Open
canadaduane opened this issue Nov 26, 2024 · 1 comment
Open

feature request: reload #326

canadaduane opened this issue Nov 26, 2024 · 1 comment
Labels
feature New feature or request

Comments

@canadaduane
Copy link

canadaduane commented Nov 26, 2024

I pipe live streaming JSONL files into a temp file (I'd like to pipe directly to fx, but it looks like the stream must be closed before fx begins formatting and offering interactivity).

Example:

deno task dev > /tmp/stream.jsonl

When I run fx /tmp/stream.jsonl to read the file, it works well. However, since the file is growing since the last time fx read it, it becomes out of date. Rather than quitting and running fx again, it would be excellent if there were a reload hot key (e.g. r).

A "nice to have" would also be that my current position and state is preserved--e.g. if the cursor is on the 5th jsonl line, and current node is open, keep it that way after the reload occurs.

@kaifbarrey
Copy link

Instead of fx, you can leverage fzf (interactive selector) and ja (JSON parser):
tail -f /tmp/stream.jsonl | jq -c '.' | fzf --tac
• tail -f keeps reading the file as it grows.
• ja -c ' . ' parses and formats each
JSON line compactly.
• fzf --tac allows you to scroll through results interactively, with the latest entries at the bottom.

@antonmedv antonmedv added the feature New feature or request label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants