Menu
AkurAI-Build
publicLatest change 0cf28150faedd8c150474a4f16be4c9922c04f56 - feat: add Ponytail UI design system by Olafur Bui
{% extends "layouts/docs.html" %} {% block title %}CLI and operations ยท Bunfork
docs{% endblock %} {% block description %}Use the single Bunfork CLI to build,
admit, diagnose, serve, migrate, test, back up, restore, manage vectors, and
deploy.{% endblock %} {% block breadcrumb %}CLI & operations{% endblock %}
{% block docs_title %}CLI & operations{% endblock %} {% block docs_summary
%}Every supported lifecycle operation is an explicit subcommand. Global data
scope comes first; command-specific paths and behavior follow.{% endblock %} {%
block docs_content %}
<section class="doc-section" aria-labelledby="global-options">
<h2 id="global-options">Global data scope</h2>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Option</th>
<th>Environment</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--database</code></td>
<td><code>BUNFORK_DB</code></td>
<td><code>data/bunfork.db</code></td>
</tr>
<tr>
<td><code>--key-file</code></td>
<td><code>BUNFORK_KEY_FILE</code></td>
<td><code>.bunfork.key</code></td>
</tr>
<tr>
<td><code>--tenant</code></td>
<td><code>BUNFORK_TENANT</code></td>
<td><code>default</code></td>
</tr>
<tr>
<td><code>--model</code></td>
<td><code>BUNFORK_MODEL</code></td>
<td><code>default</code></td>
</tr>
</tbody>
</table>
</div>
<p>
Secret files take precedence over <code>BUNFORK_DB_KEY</code> and
<code>BUNFORK_API_TOKEN</code>.
</p>
</section>
<section class="doc-section" aria-labelledby="command-reference">
<h2 id="command-reference">Command reference</h2>
<div class="table-wrap command-table">
<table>
<thead>
<tr>
<th>Command</th>
<th>Purpose</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>keygen</code></td>
<td>Create a private 256-bit key or token file.</td>
</tr>
<tr>
<td><code>build</code></td>
<td>
Run one explicit frontend command with a reduced environment, then
admit its output.
</td>
</tr>
<tr>
<td><code>admit</code></td>
<td>
Inventory a completed browser directory and atomically write its
deterministic manifest.
</td>
</tr>
<tr>
<td><code>doctor</code></td>
<td>
Verify every admitted file, digest, length, and manifest invariant
without listening.
</td>
</tr>
<tr>
<td><code>dev</code></td>
<td>
Serve native pages with request-time route rescans, or a frozen
static artifact.
</td>
</tr>
<tr>
<td><code>serve</code></td>
<td>
Run the production native or static server. <code>start</code> is an
alias.
</td>
</tr>
<tr>
<td><code>migrate</code></td>
<td>
Apply embedded migrations transactionally and verify the exact
schema.
</td>
</tr>
<tr>
<td><code>backup</code></td>
<td>Create and verify an encrypted, atomic, no-overwrite backup.</td>
</tr>
<tr>
<td><code>restore</code></td>
<td>
Verify and restore a backup while preserving the previous live
database.
</td>
</tr>
<tr>
<td><code>vector</code></td>
<td>Put, search, or delete tenant/model-scoped vector records.</td>
</tr>
<tr>
<td><code>test</code></td>
<td>
Run locked Rust tests plus native route, migration, vector, and
backup smoke checks.
</td>
</tr>
<tr>
<td><code>deploy</code></td>
<td>
Test, release-build, and atomically install a digest-owned local
bundle.
</td>
</tr>
</tbody>
</table>
</div>
</section>
<section class="doc-section" aria-labelledby="operational-loop">
<h2 id="operational-loop">A small operational loop</h2>
<pre><code># before a release
./target/release/bunfork test
./target/release/bunfork backup --out backups/pre-release.db
# create a verified local release directory
./target/release/bunfork deploy
# production probes
curl --fail http://localhost:3100/_bunfork/health
curl --fail http://localhost:3100/_bunfork/ready</code></pre>
<p>
Health reports <code>status</code>, <code>service</code>,
<code>version</code>, and <code>uptime_seconds</code>. Readiness returns
<code>{"message":"ok"}</code>; native mode answers HTTP 503 with
<code>{"message":"unavailable"}</code> if its encrypted database check
fails.
</p>
<p>
<code>deploy</code> runs its own checks and release build. It creates a
local bundle; it does not upload, provision, configure DNS/TLS, or delete
old releases.
</p>
</section>
<section class="doc-section" aria-labelledby="server-options">
<h2 id="server-options">Server controls</h2>
<dl class="reference-list">
<div>
<dt><code>--address</code></dt>
<dd>
Defaults to <code>0.0.0.0:3100</code>; environment:
<code>BUNFORK_ADDRESS</code>.
</dd>
</div>
<div>
<dt><code>--pages</code></dt>
<dd>Native page root; defaults to <code>app/pages</code>.</dd>
</div>
<div>
<dt><code>--public</code></dt>
<dd>
Native asset root served below <code>/assets</code>; defaults to
<code>public</code>.
</dd>
</div>
<div>
<dt><code>--token-file</code></dt>
<dd>Bearer token source; defaults to <code>.bunfork.token</code>.</dd>
</div>
<div>
<dt><code>--public-origin</code></dt>
<dd>
Canonical HTTP(S) origin allowed for browser mutations; environment:
<code>BUNFORK_PUBLIC_ORIGIN</code>.
</dd>
</div>
<div>
<dt><code>--static</code> + <code>--manifest</code></dt>
<dd>
Enter data-free static mode. The two options are required together.
</dd>
</div>
</dl>
</section>
<nav class="docs-pagination" aria-label="Documentation pagination">
<a href="/docs/frameworks"
><small>Previous</small><span aria-hidden="true">โ</span> Framework
exports</a
>
<a href="/docs/data"
><small>Next</small>SQLite & vectors
<span aria-hidden="true">โ</span></a
>
</nav>
{% endblock %}