<html py:extends="master.xhtml" py:strip="True">
  <py:block name="title">
    CLI Setup
  </py:block>
  <body py:block="body" py:strip="True">
    <div class="container">
      <h1>Command Line Interface (Beta)</h1>

      <p>
        AlgoBOWL has a command-line interface for power-users to interact with
        the site from the command-line or from scripts.  The CLI is currently in
        beta, and commands may be subject to change in the future.  Not all
        functionality that's currently available on the site is also implemented
        in the CLI.
      </p>

      <a href="https://github.com/jackrosenthal/algobowl/blob/main/docs/cli.md"
         target="_blank"
         class="btn btn-large btn-primary">
       <i class="fas fa-book fa-fw"></i> Documentation
      </a>

      <h2 class="mt-3">Logged-in Clients</h2>

      <p>
        Your currently logged-in clients are listed below.
      </p>

      <table class="table">
        <tr>
          <th>Client Name</th>
          <th>Date Added</th>
          <th>Options</th>
        </tr>
        <tr py:for="token in auth_tokens">
          <td>${token["client_name"]}</td>
          <td>${token["date_added"]}</td>
          <td>
            <a href="${tg.url('/pref/revoke_auth_token?token_id=' + str(token['id']))}"
               class="btn btn-danger">
              Revoke
            </a>
          </td>
        </tr>
      </table>
    </div>
  </body>
</html>
