Recently GitHub CLI released.
So you can now use it instead.
Just install it to your system (https://github.com/cli/cli#installation)
The authenticate (it’s pretty simple)
gh auth login
After you logged in you can simply create a new gist by:
gh gist create -d "my test gist" -f some_local_file.txt test_gist
For more details you can use help:
gh <command> <subcommand> --help