---
---

<div class="install-tabs">
  <!-- Radio inputs at the top level so ~ sibling selector reaches panels -->
  <input type="radio" name="platform" id="tab-macos" class="tab-radio" checked>
  <input type="radio" name="platform" id="tab-linux" class="tab-radio">
  <input type="radio" name="platform" id="tab-windows" class="tab-radio">
  <input type="radio" name="platform" id="tab-wsl" class="tab-radio">

  <div class="tab-bar">
    <label for="tab-macos">
      <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.8-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"/></svg>
      macOS
    </label>
    <label for="tab-linux">
      <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M12.5 2C10.8 2 9.4 3.3 9.2 5c-.6.2-1.2.5-1.7.9-.3-.1-.6-.2-.9-.2-1.1 0-2 .9-2 2 0 .3.1.6.2.9C4.3 9.2 4 10.1 4 11c0 3.3 2.7 6 6 6h1c3.3 0 6-2.7 6-6 0-.9-.2-1.8-.7-2.4.1-.3.2-.6.2-.9 0-1.1-.9-2-2-2-.3 0-.6.1-.9.2-.5-.4-1.1-.7-1.7-.9-.2-1.7-1.6-3-3.4-3zm-.5 2c.8 0 1.5.7 1.5 1.5v.5h-3v-.5c0-.8.7-1.5 1.5-1.5zM8 8.5c.6 0 1 .4 1 1s-.4 1-1 1-1-.4-1-1 .4-1 1-1zm5 0c.6 0 1 .4 1 1s-.4 1-1 1-1-.4-1-1 .4-1 1-1zm-4.5 4h4l-2 3-2-3zM8 17v2.5c0 .8.7 1.5 1.5 1.5s1.5-.7 1.5-1.5V17H8zm4 0v2.5c0 .8.7 1.5 1.5 1.5s1.5-.7 1.5-1.5V17h-3z"/></svg>
      Linux
    </label>
    <label for="tab-windows">
      <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M3 5.1 10.4 4v7.5H3zM10.4 12.5V20L3 18.9v-6.4zM11.3 3.9 21 2.5v9h-9.7zM21 12.5v9l-9.7-1.4v-7.6z"/></svg>
      Windows
    </label>
    <label for="tab-wsl">
      <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M0 3.449L9.75 2.1v9.451H0m10.949-9.602L24 0v11.4H10.949M0 12.6h9.75v9.451L0 20.699M10.949 12.6H24V24l-12.9-1.801"/></svg>
      WSL 2
    </label>
  </div>

  <!-- macOS Panel -->
  <div class="tab-panel" id="panel-macos">
    <h3>Prerequisites</h3>
    <p>Python 3.10 or newer. macOS 13+ ships with a compatible version, or install via Homebrew:</p>
    <div class="code-block">
      <button class="copy-btn" data-code="brew install python@3.10">Copy</button>
      <code><span class="cmd">brew install python@3.10</span></code>
    </div>

    <h3>Install Kiln</h3>
    <p>The recommended install uses <code>pipx</code> for an isolated environment:</p>
    <div class="code-block">
      <button class="copy-btn" data-code="brew install pipx && pipx ensurepath&#10;pipx install kiln3d">Copy</button>
      <code><span class="cmd">brew install pipx && pipx ensurepath</span>
<span class="cmd">pipx install kiln3d</span></code>
    </div>

    <p>Or use pip directly:</p>
    <div class="code-block">
      <button class="copy-btn" data-code="pip install kiln3d">Copy</button>
      <code><span class="cmd">pip install kiln3d</span></code>
    </div>

    <h3>Install from Source</h3>
    <div class="code-block">
      <button class="copy-btn" data-code="git clone https://github.com/codeofaxel/Kiln.git&#10;cd Kiln && pip install -e ./kiln">Copy</button>
      <code><span class="cmd">git clone https://github.com/codeofaxel/Kiln.git</span>
<span class="cmd">cd Kiln && pip install -e ./kiln</span></code>
    </div>

    <h3>One-Line Installer</h3>
    <p>Clones the repo and installs via <code>pipx</code> automatically:</p>
    <div class="code-block">
      <button class="copy-btn" data-code="git clone https://github.com/codeofaxel/Kiln.git ~/.kiln/src && ~/.kiln/src/install.sh">Copy</button>
      <code><span class="cmd">git clone https://github.com/codeofaxel/Kiln.git ~/.kiln/src && ~/.kiln/src/install.sh</span></code>
    </div>
  </div>

  <!-- Linux Panel -->
  <div class="tab-panel" id="panel-linux">
    <h3>Prerequisites</h3>
    <p>Install Python 3.10+ and pip:</p>
    <div class="code-block">
      <button class="copy-btn" data-code="sudo apt install python3 python3-pip python3-venv">Copy</button>
      <code><span class="comment"># Debian / Ubuntu</span>
<span class="cmd">sudo apt install python3 python3-pip python3-venv</span></code>
    </div>
    <div class="code-block">
      <button class="copy-btn" data-code="sudo dnf install python3 python3-pip">Copy</button>
      <code><span class="comment"># Fedora / RHEL</span>
<span class="cmd">sudo dnf install python3 python3-pip</span></code>
    </div>

    <h3>Install Kiln</h3>
    <p>The recommended install uses <code>pipx</code> for an isolated environment:</p>
    <div class="code-block">
      <button class="copy-btn" data-code="sudo apt install pipx && pipx ensurepath&#10;pipx install kiln3d">Copy</button>
      <code><span class="cmd">sudo apt install pipx && pipx ensurepath</span>
<span class="cmd">pipx install kiln3d</span></code>
    </div>

    <p>Or use pip directly:</p>
    <div class="code-block">
      <button class="copy-btn" data-code="pip install kiln3d">Copy</button>
      <code><span class="cmd">pip install kiln3d</span></code>
    </div>

    <h3>Install from Source</h3>
    <div class="code-block">
      <button class="copy-btn" data-code="git clone https://github.com/codeofaxel/Kiln.git&#10;cd Kiln && pip install -e ./kiln">Copy</button>
      <code><span class="cmd">git clone https://github.com/codeofaxel/Kiln.git</span>
<span class="cmd">cd Kiln && pip install -e ./kiln</span></code>
    </div>

    <h3>One-Line Installer</h3>
    <p>Clones the repo and installs via <code>pipx</code> automatically:</p>
    <div class="code-block">
      <button class="copy-btn" data-code="git clone https://github.com/codeofaxel/Kiln.git ~/.kiln/src && ~/.kiln/src/install.sh">Copy</button>
      <code><span class="cmd">git clone https://github.com/codeofaxel/Kiln.git ~/.kiln/src && ~/.kiln/src/install.sh</span></code>
    </div>

    <h3>Optional Dependencies</h3>
    <div class="code-block">
      <button class="copy-btn" data-code="sudo apt install prusa-slicer openscad">Copy</button>
      <code><span class="comment"># PrusaSlicer for STL slicing, OpenSCAD for text-to-3D</span>
<span class="cmd">sudo apt install prusa-slicer openscad</span></code>
    </div>
  </div>

  <!-- Windows Panel — native Windows, no WSL.  Recommended for
       Windows users with a networked printer: mDNS discovery works
       here but not in WSL 2.  Needs kiln3d >= 1.1.4 (the release
       that fixes the legacy-code-page console crash). -->
  <div class="tab-panel" id="panel-windows">
    <h3>Fastest: let your AI agent install it</h3>
    <p>Already have Claude Code (or another agent with terminal access) on this PC? Paste this and it does the whole setup for you:</p>
    <div class="code-block">
      <button class="copy-btn" data-code="Set up Kiln (kiln3d.com) on my Windows PC. If Python 3.10+ isn't installed, install it with winget. Then run pip install kiln3d. Then run kiln install-mcp to connect Kiln to this agent. Then run kiln doctor and show me the result. Tell me if I need to restart anything.">Copy</button>
      <code><span class="comment"># Paste this to your agent</span>
Set up Kiln (kiln3d.com) on my Windows PC. If Python 3.10+
isn't installed, install it with winget. Then run
pip install kiln3d. Then run kiln install-mcp to connect
Kiln to this agent. Then run kiln doctor and show me the
result. Tell me if I need to restart anything.</code>
    </div>

    <h3>Manual setup: install Python</h3>
    <p>Kiln needs Python 3.10 or newer. Open <strong>PowerShell</strong> and run:</p>
    <div class="code-block">
      <button class="copy-btn" data-code="winget install Python.Python.3.12">Copy</button>
      <code><span class="cmd">winget install Python.Python.3.12</span></code>
    </div>
    <p>No winget? Install from <code>python.org/downloads</code> &mdash; and in the installer, tick <strong>&ldquo;Add Python to PATH&rdquo;</strong>. Avoid the Microsoft Store &ldquo;python&rdquo; shortcut; it causes PATH problems.</p>

    <h3>Install Kiln</h3>
    <p>Close PowerShell and open it again first, so it picks up the new Python. Then:</p>
    <div class="code-block">
      <button class="copy-btn" data-code="pip install kiln3d">Copy</button>
      <code><span class="cmd">pip install kiln3d</span></code>
    </div>

    <h3>Connect your AI agent</h3>
    <p>Wire Kiln into Claude Desktop, Claude Code, or Codex:</p>
    <div class="code-block">
      <button class="copy-btn" data-code="kiln install-mcp">Copy</button>
      <code><span class="cmd">kiln install-mcp</span></code>
    </div>
    <p>If it asks you to sign in first, run <code>kiln signin</code>. Restart your agent afterward, then confirm everything works with <code>kiln doctor</code>.</p>

    <div class="wsl-note">
      <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="var(--accent)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>
      <div>
        <strong>You&rsquo;re on the right tab</strong>
        <p>This setup lets Kiln find your 3D printer on your home network by itself &mdash; nothing to look up or type in. The WSL 2 tab next to it is a niche option for advanced Linux setups; if you&rsquo;re not sure you need it, you don&rsquo;t.</p>
      </div>
    </div>
  </div>

  <!-- WSL 2 Panel -->
  <div class="tab-panel" id="panel-wsl">
    <h3>Prerequisites</h3>
    <p>Inside your WSL 2 Ubuntu terminal, install Python 3.10+ and pip:</p>
    <div class="code-block">
      <button class="copy-btn" data-code="sudo apt install python3 python3-pip python3-venv">Copy</button>
      <code><span class="cmd">sudo apt install python3 python3-pip python3-venv</span></code>
    </div>

    <h3>Install Kiln</h3>
    <p>The recommended install uses <code>pipx</code> for an isolated environment:</p>
    <div class="code-block">
      <button class="copy-btn" data-code="sudo apt install pipx && pipx ensurepath&#10;pipx install kiln3d">Copy</button>
      <code><span class="cmd">sudo apt install pipx && pipx ensurepath</span>
<span class="cmd">pipx install kiln3d</span></code>
    </div>

    <p>Or use pip directly:</p>
    <div class="code-block">
      <button class="copy-btn" data-code="pip install kiln3d">Copy</button>
      <code><span class="cmd">pip install kiln3d</span></code>
    </div>

    <h3>Install from Source</h3>
    <div class="code-block">
      <button class="copy-btn" data-code="git clone https://github.com/codeofaxel/Kiln.git&#10;cd Kiln && pip install -e ./kiln">Copy</button>
      <code><span class="cmd">git clone https://github.com/codeofaxel/Kiln.git</span>
<span class="cmd">cd Kiln && pip install -e ./kiln</span></code>
    </div>

    <div class="wsl-note">
      <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="var(--accent)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>
      <div>
        <strong>WSL 2 Networking Note</strong>
        <p>mDNS printer discovery (<code>kiln discover</code>) does not work in WSL 2 because of NAT networking. Use your printer's IP address directly instead (works for Ethernet and Wi-Fi LAN setups):</p>
      </div>
    </div>

    <div class="code-block">
      <button class="copy-btn" data-code="kiln auth --name my-printer --host http://192.168.1.x:port --type octoprint --api-key YOUR_KEY">Copy</button>
      <code><span class="comment"># Connect directly by IP address</span>
<span class="cmd">kiln auth --name my-printer --host http://192.168.1.x:port --type octoprint --api-key YOUR_KEY</span></code>
    </div>

    <h3>Optional Dependencies</h3>
    <div class="code-block">
      <button class="copy-btn" data-code="sudo apt install prusa-slicer openscad">Copy</button>
      <code><span class="comment"># PrusaSlicer for STL slicing, OpenSCAD for text-to-3D</span>
<span class="cmd">sudo apt install prusa-slicer openscad</span></code>
    </div>
  </div>
</div>

<style>
  .install-tabs {
    margin: 0 auto;
  }

  .tab-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  .tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
  }

  .tab-bar label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    user-select: none;
  }

  .tab-bar label:hover {
    color: var(--text);
  }

  /* Highlight active tab label via radio state */
  #tab-macos:checked ~ .tab-bar label[for="tab-macos"],
  #tab-linux:checked ~ .tab-bar label[for="tab-linux"],
  #tab-windows:checked ~ .tab-bar label[for="tab-windows"],
  #tab-wsl:checked ~ .tab-bar label[for="tab-wsl"] {
    color: var(--text);
    border-bottom-color: var(--accent);
  }

  .tab-panel {
    display: none;
  }

  /* CSS-only tab switching via radio :checked + general sibling */
  #tab-macos:checked ~ #panel-macos,
  #tab-linux:checked ~ #panel-linux,
  #tab-windows:checked ~ #panel-windows,
  #tab-wsl:checked ~ #panel-wsl {
    display: block;
  }

  .tab-panel h3 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 28px;
    margin-bottom: 8px;
    color: var(--text);
  }

  .tab-panel h3:first-child {
    margin-top: 0;
  }

  .tab-panel p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 4px;
  }

  .tab-panel code {
    color: var(--accent);
    font-size: 0.85em;
  }

  .tab-panel .code-block code {
    color: var(--text);
    font-size: 13px;
  }

  .wsl-note {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px 20px;
    background: rgba(255, 107, 43, 0.06);
    border: 1px solid rgba(255, 107, 43, 0.2);
    border-radius: 8px;
    margin: 20px 0;
  }

  .wsl-note svg {
    flex-shrink: 0;
    margin-top: 2px;
  }

  .wsl-note strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text);
  }

  .wsl-note p {
    margin: 0;
    font-size: 13px;
  }

  @media (max-width: 640px) {
    .tab-bar label {
      padding: 10px 14px;
      font-size: 13px;
      gap: 6px;
    }

    .tab-bar label svg {
      display: none;
    }
  }
</style>
