Add a user “Eddie” to a local membership group
dseditgroup -o edit -a Eddie -t user developers
To check membership:
dseditgroup -o checkmember -m Eddie developers
Or:
dsmemberutil checkmembership -U Eddie -G developers
To remove a user from a group:
dseditgroup -o edit -d Eddie -t user developers
Link:
https://apple.stackexchange.com/questions/13132/how-to-add-user-to-a-group-on-command-line