title: How to use Agda from the command line / from another language?
body: <p>Most interaction with Agda is done with EMACS, but is there a way to do it programmatically? I.e., is it possible to do everything from the command line, or from some API? The main goal is to build a thin wrapper so we could call Agda from another language, ex:</p>
  
  <pre><code>var Agda = require("agda");
  
  var code = `
      data Bool: Set where
          true: Bool
          false: Bool
  
      not : Bool -&gt; Bool
      not true = false
      not false = true
  
      val : Bool
      val = not true
  `;
  
  console.log(Agda.infer(code, "true")); // prints "Bool"
  console.log(Agda.normalize(code, "val")); // prints "false"
  </code></pre>
  
  <p>I've previously asked how to use Agda <a href="https://stackoverflow.com/questions/49330226/is-it-possible-to-use-agda-as-a-library">as a library</a>, but that obviously only cover Haskell. I've tried looking Agda's VIM extension to see how it does it, and it seems like it is sending commands to Agda, but I'm not sure exactly how. Pointers to the relevant documentation would be highly appreciated!</p>