repartee 0.1.0

A modern terminal IRC client built with Ratatui and Tokio
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="repartee — A modern terminal IRC client built with Ratatui, Tokio, and Rust. Scripting, theming, encrypted logging, and more.">
  <meta name="keywords" content="irc, terminal, tui, client, chat, repartee, ratatui, tokio, rust">
  <meta name="author" content="outragedevs">
  <meta property="og:title" content="Getting Started — repartee">
  <meta property="og:description" content="A modern terminal IRC client built with Ratatui, Tokio, and Rust. Inspired by irssi, designed for the future.">
  <meta property="og:type" content="website">
  <meta property="og:url" content="https://outragedevs.github.io/repartee/">
  <meta property="og:image" content="https://outragedevs.github.io/repartee/images/chat.png">
  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:title" content="{{title}} — repartee">
  <meta name="twitter:description" content="A modern terminal IRC client built with Ratatui, Tokio, and Rust.">
  <meta name="twitter:image" content="https://outragedevs.github.io/repartee/images/chat.png">
  <title>{{title}} — repartee</title>
  <link rel="stylesheet" href="css/style.css">
</head>
<body>
  <!-- Mobile hamburger toggle -->
  <button class="hamburger" aria-label="Toggle navigation">
    <span></span>
    <span></span>
    <span></span>
  </button>

  <div class="page-wrapper">
    <!-- Sidebar navigation -->
    <aside class="sidebar">
      <div class="sidebar-header">
        <a href="index.html" class="brand">repartee</a>
        <span class="brand-tagline">Documentation</span>
      </div>
      <nav class="sidebar-nav">
          <ul>
    <li><a href="index.html">Home</a></li>
  </ul>
  <div class="nav-section">
    <span class="nav-section-title">Getting Started</span>
    <ul>
      <li><a href="installation.html">Installation</a></li>
      <li><a href="first-connection.html">First Connection</a></li>
      <li><a href="configuration.html">Configuration</a></li>
    </ul>
  </div>
  <div class="nav-section">
    <span class="nav-section-title">Reference</span>
    <ul>
      <li><a href="commands.html">Commands</a></li>
    </ul>
  </div>
  <div class="nav-section">
    <span class="nav-section-title">Scripting</span>
    <ul>
      <li><a href="scripting-getting-started.html" class="active">Getting Started</a></li>
      <li><a href="scripting-api.html">API Reference</a></li>
      <li><a href="scripting-examples.html">Examples</a></li>
    </ul>
  </div>
  <div class="nav-section">
    <span class="nav-section-title">Customization</span>
    <ul>
      <li><a href="theming.html">Theming</a></li>
      <li><a href="theming-format-strings.html">Format Strings</a></li>
      <li><a href="logging.html">Logging & Search</a></li>
    </ul>
  </div>
  <div class="nav-section">
    <span class="nav-section-title">Project</span>
    <ul>
      <li><a href="architecture.html">Architecture</a></li>
      <li><a href="faq.html">FAQ</a></li>
    </ul>
  </div>

      </nav>
      <div class="sidebar-footer">
        Built with <a href="https://www.rust-lang.org">Rust</a>
        &middot;
        <a href="https://github.com/outragedevs/repartee">GitHub</a>
      </div>
    </aside>

    <!-- Overlay for mobile sidebar -->
    <div class="sidebar-overlay"></div>

    <!-- Main content -->
    <div class="content-wrapper">
      <main class="content">
        <h1>Scripting — Getting Started</h1>
<p>repartee supports Lua 5.4 scripting with a rich API modeled after WeeChat, irssi, and kokoirc.</p>
<h2>Script location</h2>
<p>Scripts live in <code>~/.repartee/scripts/</code> as <code>.lua</code> files.</p>
<h2>Script format</h2>
<p>Every script has two parts: a <code>meta</code> table and a <code>setup</code> function:</p>
<pre><code class="language-lua">meta = {
    name = &quot;hello&quot;,
    version = &quot;1.0&quot;,
    description = &quot;A simple greeting script&quot;
}

function setup(api)
    api.on(&quot;irc.join&quot;, function(event)
        if event.nick ~= api.our_nick() then
            api.irc.say(event.channel, &quot;Welcome, &quot; .. event.nick .. &quot;!&quot;)
        end
    end)

    api.log(&quot;Hello script loaded!&quot;)

    -- Return a cleanup function (optional)
    return function()
        api.log(&quot;Hello script unloaded&quot;)
    end
end
</code></pre>
<h3><code>meta</code> table</h3>
<table>
<thead>
<tr>
<th>Field</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td><code>name</code></td>
<td>string</td>
<td>Yes</td>
<td>Script name (used for loading/unloading)</td>
</tr>
<tr>
<td><code>version</code></td>
<td>string</td>
<td>No</td>
<td>Version string</td>
</tr>
<tr>
<td><code>description</code></td>
<td>string</td>
<td>No</td>
<td>Short description</td>
</tr>
</tbody></table>
<h3><code>setup(api)</code> function</h3>
<p>Called when the script is loaded. Receives the <code>api</code> object with all scripting capabilities. Can optionally return a cleanup function that runs on unload.</p>
<h2>Loading scripts</h2>
<pre><code>/script load hello
/script unload hello
/script reload hello
/script list
</code></pre>
<h2>Autoloading</h2>
<p>Add script names to your config to load them automatically:</p>
<pre><code class="language-toml">[scripts]
autoload = [&quot;hello&quot;, &quot;urllogger&quot;]
</code></pre>
<h2>Sandboxing</h2>
<p>Scripts run in a sandboxed Lua environment. The following globals are <strong>removed</strong> for security:</p>
<ul>
<li><code>os</code> — no filesystem/process access</li>
<li><code>io</code> — no file I/O</li>
<li><code>loadfile</code>, <code>dofile</code> — no arbitrary file execution</li>
<li><code>package</code> — no module loading</li>
</ul>
<p>Scripts are isolated from each other — each gets its own Lua environment.</p>
<h2>Next steps</h2>
<ul>
<li><a href="scripting-api.html">API Reference</a> — full API documentation</li>
<li><a href="scripting-examples.html">Examples</a> — practical script examples</li>
</ul>


        <!-- Prev / Next navigation -->
        <nav class="page-nav">
          <a href="commands.html" class="page-nav-link prev">
  <span class="page-nav-label">&larr; Previous</span>
  <span class="page-nav-title">Commands</span>
</a>
          <a href="scripting-api.html" class="page-nav-link next">
  <span class="page-nav-label">Next &rarr;</span>
  <span class="page-nav-title">API Reference</span>
</a>
        </nav>

        <footer class="site-footer">
          Built with <a href="https://www.rust-lang.org">Rust</a> &middot;
          <a href="https://github.com/outragedevs/repartee">GitHub</a> &middot;
          MIT License
        </footer>
      </main>
    </div>
  </div>

  <script>
    // Mobile sidebar toggle
    (function() {
      const hamburger = document.querySelector('.hamburger');
      const sidebar = document.querySelector('.sidebar');
      const overlay = document.querySelector('.sidebar-overlay');

      function toggleSidebar() {
        hamburger.classList.toggle('active');
        sidebar.classList.toggle('open');
        overlay.classList.toggle('visible');
        document.body.style.overflow = sidebar.classList.contains('open') ? 'hidden' : '';
      }

      function closeSidebar() {
        hamburger.classList.remove('active');
        sidebar.classList.remove('open');
        overlay.classList.remove('visible');
        document.body.style.overflow = '';
      }

      hamburger.addEventListener('click', toggleSidebar);
      overlay.addEventListener('click', closeSidebar);

      // Close sidebar on Escape key
      document.addEventListener('keydown', function(e) {
        if (e.key === 'Escape' && sidebar.classList.contains('open')) {
          closeSidebar();
        }
      });
    })();
  </script>
</body>
</html>