A blog aggregator CLI built as part of the boot.dev course. Follow RSS feeds and browse their latest posts right from your terminal.
Before you can run gator you'll need to have the following installed:
- Go (1.26 or newer)
- PostgreSQL (a running server, local or remote)
Install the gator CLI with go install:
go install github.com/StevanFreeborn/gator@latestThe binary is placed in $(go env GOPATH)/bin. Make sure that directory is on your PATH:
export PATH="$(go env GOPATH)/bin:$PATH"Create a database for gator in your Postgres server:
createdb gatorThe schema is managed with goose migrations in sql/schema. Install goose and apply the migrations:
go install github.com/pressly/goose/v3/cmd/goose@latest
goose -dir sql/schema postgres "postgres://<user>:<password>@localhost:5432/gator?sslmode=disable" upgator reads its configuration from ~/.gatorconfig.json. Create that file with the connection string for your database:
{
"db_url": "postgres://<user>:<password>@localhost:5432/gator?sslmode=disable",
"current_user_name": ""
}Run gator with gator <command> <args>. Start by registering a user, then log in:
gator register myusername
gator login myusernameA few commands you can run:
| Command | Description |
|---|---|
gator register <name> |
Register a new user and log in as them |
gator login <name> |
Log in as an existing user |
gator users |
List all registered users |
gator addfeed <name> <url> |
Add an RSS feed and follow it |
gator feeds |
List all feeds |
gator follow <name-or-url> |
Follow a feed by name or url |
gator following |
List the feeds you're following |
gator unfollow <name-or-url> |
Unfollow a feed by name or url |
gator browse [limit] |
Browse posts from your followed feeds |
gator agg <duration> |
Continuously fetch posts every <duration> (e.g. 60s); press q or Ctrl-C to stop |
gator reset |
Delete all users and their data |