A TypeScript CLI RSS aggregator backed by PostgreSQL.
gator-ts lets you:
- register/login users,
- add RSS feeds,
- follow/unfollow feeds,
- aggregate feed items into a local database,
- browse recent posts from followed feeds.
Before running the CLI, make sure you have:
- Node.js 18+ (Node 20+ recommended)
- npm
- PostgreSQL (running locally or remotely)
npm installThe CLI reads config from:
~/.gatorconfig.json
Create this file before running commands.
Example:
{
"db_url": "postgres://postgres:postgres@localhost:5432/gator_ts",
"current_user_name": "placeholder"
}db_url: PostgreSQL connection string used by both the app and Drizzle migrations.current_user_name: active user in the CLI context.- You can set any placeholder initially.
- It will be updated automatically by
registerandlogincommands.
- Create the database in PostgreSQL (example name:
gator_ts). - Run migrations:
npm run migrateIf you change schema later, generate a migration with:
npm run generateUse:
npm run start -- <command> [args...]If no command is provided, the CLI shows:
usage: cli <command> [args...]
A practical first-time flow:
# Register and set current user
npm run start -- register alice
# Add a feed (also auto-follows it)
npm run start -- addfeed "Hacker News" "https://hnrss.org/frontpage"
# See available feeds
npm run start -- feeds
# Start aggregator loop (Ctrl+C to stop)
npm run start -- agg 30s
# Browse latest posts from followed feeds
npm run start -- browse 10register <name>: create user and set as current user.login <name>: switch current user.users: list users ((current)is marked).reset: delete all users (and related rows via cascade).
addfeed <feed_name> <url>: create a feed owned by current user and auto-follow it.feeds: list all feeds.follow <feed_url>: follow an existing feed.following: list feeds followed by current user.unfollow <feed_url>: unfollow a feed.
agg <time_between_reqs>: continuously fetch next feed and store posts.- Duration format:
<number><unit> - Units:
ms,s,m,h - Examples:
500ms,10s,2m,1h
- Duration format:
browse [limit]: show latest posts for current user (default:2).
- Commands that require authentication (
addfeed,follow,following,unfollow,browse) depend oncurrent_user_namebeing valid. - Aggregation is a long-running loop; stop with
Ctrl+C. - Post URLs are deduplicated in the database (
on conflict do nothing).
db_url is required in config file- Check
~/.gatorconfig.jsonexists and includes a validdb_urlstring.
- Check
current_user_name is required in config file- Add
current_user_nameto config (any initial value is fine).
- Add
User <name> not found- Run
npm run start -- register <name>(orloginwith an existing user).
- Run
- Migration/connection errors
- Verify PostgreSQL is running and
db_urlpoints to a reachable database.
- Verify PostgreSQL is running and