- PostgreSQL: Ensure you have a running PostgreSQL instance.
- Go: Install Go from https://golang.org/dl/.
To install the gator CLI, run:
go install github.com/codrinursachi/gatorThis will place the gator binary in your $GOPATH/bin directory.
- Create a global configuration file at
~/.gatorconfig.json. - Specify your database connection and other required settings.
Example (
~/.gatorconfig.json):{ "db_url": "postgres://postgres:postgres@localhost:5432/gator?sslmode=disable", "current_user_name": "kahya" }
- Ensure your PostgreSQL server is running and accessible.
- Run the program using:
go run main.go <command> [args...]
login: Log in as a user.register: Register a new user.reset: Reset user password or state.users: List all users.agg: Run aggregation queries.addfeed: Add a new feed (requires login).feeds: List available feeds.follow: Follow a feed (requires login).following: List feeds you are following (requires login).unfollow: Unfollow a feed (requires login).