Using curl to log in setting the cookie and extracting the CSRF token:
curl http://localhost:3000/users/sign_in --cookie-jar cookie | grep csrf
curl http://localhost:3000/users/sign_in -L --data "user[email]=user@users.com&user[password]=my_password&authenticity_token=oy4J2HVPezOc5JrTXMyaSjeCDHhN%2Bv5yVzlvShm%2FjFc%3D" --cookie cookie