newsfeed-grok
v0.1.1
Published
CLI tool that generates structured Super Grok prompts for newsfeed-style research updates
Maintainers
Readme
newsfeed-grok
Small tool with two personalities:
- No args in a real terminal → interactive TUI that copies a Super Grok prompt to your clipboard
- CLI subcommands → non-interactive mode for scripts and coding agents
It reads topic definitions from JSON files, builds a structured X/Twitter search prompt, and writes data to stdout.
Quick Start
npm install
npm run dev # interactive TUI
npm run dev -- list # non-interactive listBuild the compiled CLI:
npm run build
npm start -- listRun the package-style integration tests:
npm testRelease helpers are also available:
npm run release:patch # or release:minor / release:major
npm run release:push
npm run release:publishOr link it globally:
npm link
newsfeedCommands
newsfeed
newsfeed list [--json]
newsfeed show <slug>
newsfeed prompt <slug> [--json]
newsfeed create <slug> \
--name "Rust Async" \
--description "Rust async ecosystem" \
--keywords "tokio,async-std,futures" \
--accounts "@tokio_rs,@withoutboats" \
--horizon 7d \
[--extra "Focus on runtime performance"] \
[--dir user|bundled] \
[--force]
newsfeed delete <slug> [--yes]Command behavior
| Command | Behavior |
|---|---|
| newsfeed | Launch the TUI when stdin/stdout are TTYs |
| newsfeed list | Print topic slug<TAB>name pairs |
| newsfeed list --json | Print [{"slug":"...","name":"..."}] |
| newsfeed show <slug> | Print the topic JSON |
| newsfeed prompt <slug> | Print the Grok prompt |
| newsfeed prompt <slug> --json | Print { "prompt": "..." } |
| newsfeed create <slug> ... | Create or overwrite a topic file and echo the resulting topic JSON |
| newsfeed delete <slug> | Delete the currently visible topic file; prompts unless --yes is set |
Notes for scripts
showalready emits JSONcreatealready emits JSON--jsonmatters for the commands that otherwise have a text mode:listandpromptcreate --forceoverwrites the destination file without asking- Broken pipes are treated as normal CLI behavior, so
newsfeed prompt ... | headdoes not dump anEPIPEstack trace like a clown show
Output rules
- stdout is data only
- stderr is for errors
- Exit codes:
0success1runtime failure (missing topic, create collision without--force, aborted delete, invalid topic file)2usage error (bad flags, missing args, trying to launch the TUI without a TTY)
Topics
Topics are loaded from two places:
~/.config/newsfeed/— user topicstopics/— bundled topics shipped with the project
Each topic is a JSON file named <slug>.json.
If the same slug exists in both places, the user topic wins. That is the sane default: local config should override bundled defaults.
See what is available:
newsfeed list
newsfeed list --jsonCreating Topics
From the TUI
Choose “➕ Create new topic” and answer the prompts.
The interactive save picker now puts ~/.config/newsfeed/ first, because defaulting to writing into bundled repo files is backwards.
From the CLI
newsfeed create rust-async \
--name "Rust Async" \
--description "Rust async ecosystem" \
--keywords "tokio,async-std,futures" \
--accounts "@tokio_rs,@withoutboats" \
--horizon 7d \
--extra "Focus on runtime performance"By default, create writes to ~/.config/newsfeed/.
Use --dir bundled to write into topics/ instead.
Use --force to overwrite an existing file at the chosen destination:
newsfeed create rust-async \
--name "Rust Async" \
--description "Rust async ecosystem" \
--keywords "tokio,async-std,futures" \
--accounts "@tokio_rs,@withoutboats" \
--horizon 7d \
--forceTopic schema
{
"name": "Anthropic Third Party Ban",
"description": "Latest progress on Anthropic banning subscription access of third party access",
"keywords": ["Anthropic", "LLM", "Model"],
"xAccounts": ["@steipete", "@badlogicgames"],
"horizon": "24h",
"extraInstructions": "Suggest to me the people I should follow later"
}The filename without .json is the topic slug.
Examples
newsfeed list
newsfeed list --json
newsfeed show anthropic-third-party-ban
newsfeed prompt anthropic-third-party-ban
newsfeed prompt anthropic-third-party-ban --json
newsfeed create rust-async \
--name "Rust Async" \
--description "Rust async ecosystem" \
--keywords "tokio,async-std,futures" \
--accounts "@tokio_rs,@withoutboats" \
--horizon 7d
newsfeed create rust-async \
--name "Rust Async" \
--description "Rust async ecosystem" \
--keywords "tokio,async-std,futures" \
--accounts "@tokio_rs,@withoutboats" \
--horizon 7d \
--force
newsfeed delete rust-async --yesTesting
The package now has a real npm test path using Node's built-in test runner.
A GitHub Actions workflow runs that same test command on every push and pull request.
What it covers:
create,list,show, andprompt- overwrite behavior with
create --force - user-topic precedence over bundled topics
- non-TTY error handling for
deleteand no-arg invocation - invalid topic file errors
- prompt output surviving a broken pipe
Tests run against the compiled CLI in dist/ and isolate HOME in a temp directory so they do not depend on or mutate your real ~/.config/newsfeed/.
Releasing
Recommended flow:
npm test
npm run release:patch # or release:minor / release:major
npm run release:push
npm run release:publishrelease:patch|minor|major bumps the version, creates the git commit, and creates the tag.
release:push pushes the release commit and tag.
release:publish publishes to npm, and prepublishOnly rebuilds first.
Requirements
- Node.js ≥ 18
- Clipboard support for TUI prompt copy:
pbcopyon macOSxclipon Linuxclipon Windows
