Gator is a command-line tool for managing RSS feeds. It provides a simple interface to register users, add and follow feeds, and browse aggregated posts, all backed by a PostgreSQL database.
- Go (version 1.24.4 or newer)
- PostgreSQL (running locally or accessible remotely)
-
Install Go: Download and install Go
-
Install Gator CLI:
go install github.com/frozendolphin/Gator@latest
This will install the
gatorbinary to your$GOPATH/bin(usually~/go/bin). Make sure this directory is in yourPATH.
Follow these steps to set up your PostgreSQL database and run the migrations required by Gator.
sudo apt update
sudo apt install postgresql postgresql-contribbrew install postgresql@15sudo service postgresql startbrew services start postgresql@15sudo passwd postgressudo -u postgres psqlpsql postgresIn the PostgreSQL shell, run:
CREATE DATABASE gator;
\c gator
-- (Linux only) Set the user password:
ALTER USER postgres PASSWORD 'postgres';Install goose:
go install github.com/pressly/goose/v3/cmd/goose@latestNavigate to the schema directory:
cd sql/schemaRun the migrations:
goose postgres "postgres://postgres:password@localhost:5432/gator?sslmode=disable" upNote: Adjust the connection string as needed for your environment (username, password, host, port).
Gator uses a config file located at ~/.gatorconfig.json.
Example config:
{
"db_url": "postgres://postgres:password@localhost:5432/gator?sslmode=disable",
"username": "any"
}db_url: Your PostgreSQL connection string.username: Your Gator username (set automatically when you use theregisterorlogincommand).
Run the CLI with:
gator <command> [arguments]If you installed with go install, you may need to run it as:
~/go/bin/gator <command> [arguments]- Register a user:
gator register <username>
- Login as a user:
This sets your username in the config file.
gator login <username>
- login : Set your username for the session (updates config file).
- register : Create a new user and set as current.
- reset: Delete all users (dangerous, use with caution).
- users: List all users, marking the current one.
- agg : Aggregate (scrape) feeds at the given interval (e.g.,
10m,1h). - addfeed : Add a new feed and follow it.
- feeds: List all feeds in the system.
- follow <feed_url>: Follow a feed by its URL.
- following: List feeds you are currently following.
- unfollow <feed_url>: Unfollow a feed by its URL.
- browse [limit]: Browse posts from feeds you follow (optionally limit the number shown, default is 2).
- Register and login:
gator register alice gator login alice
- Add and follow a feed:
gator addfeed "My Blog" https://example.com/rss - List all feeds:
gator feeds
- Follow another feed:
gator follow https://another.com/rss
- See what you are following:
gator following
- Browse posts:
gator browse 5
- Unfollow a feed:
gator unfollow https://another.com/rss
- Database queries are generated using sqlc. See
sqlc.yamlfor configuration. - To regenerate database code after editing SQL files:
sqlc generate
- Database schema is in
sql/schema/.
This project is open source and available under the MIT License.