title: How to create a gist on command line
body: <p>I am trying to create a gist from bash, and I have tried many versions scripts I could get, but none are working.</p>
  
  <p>This seems like a correct one, but it does not work also. </p>
  
  <pre><code>curl -X POST -d '{"public":true,"files":{"test.txt":{"content":"String file contents"}}}' https://api.github.com/gists
  </code></pre>
  
  <p>I have a <code>test.txt</code> file with content I would like to create the gist, but it won't work.  It says, <code>invalid email</code>, if I try to add <code>-u USER</code> or <code>-u USER:PASS</code> it still won't work saying <code>"message": "Problems parsing JSON",</code> .. </p>
  
  <p>I don't know what is wrong. the <a href="https://developer.github.com/v3/gists/#create-a-gist" rel="noreferrer">documentation</a> does not provide much except for this line: </p>
  
  <blockquote>
    <p><code>POST /gists</code> 
    as you can see, I am passing the test.txt file. </p>
  </blockquote>