<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Cradicle Explorer</title>
    <link href="/css/bootstrap/bootstrap.min.css" rel="stylesheet">
    <style>
      .form-control-dark::placeholder {
          color: #aaa;
          opacity: 1;
      }
    </style>
    <link rel="stylesheet" href="/assets/fontawesome/css/all.min.css">
    <link rel="icon" type="image/png" href="/favicon.png">


                <link href="/css/dashboard.css" rel="stylesheet">
                </head>
                <body>
                <header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
                  <a class="navbar-brand col-md-3 col-lg-2 me-0 px-3 fs-6" href="/">Cradicle Explorer</a>
                  <button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                  </button>
                  <form method="get" action="/cgi-bin/main" style="width:100%;"><input class="form-control form-control-dark w-100 rounded-0 border-0" type="text" name="q" placeholder="Search repos" aria-label="Search"></form>
                  <div class="navbar-nav flex-row">
                    <div class="nav-item text-nowrap">
                      <a class="nav-link px-3 active" href="/cgi-bin/repo?id=z2MVnNUGexV3zmrGcqaqhZWv3CgbP">narc</a>
                    </div>
                  </div>
                </header>
                <div class="container-fluid">
                  <div class="row">
                    <nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-dark sidebar collapse">
                      <div class="position-sticky pt-3 sidebar-sticky">
                        <ul class="nav flex-column">
                          <li class="nav-item">
                            <a class="nav-link active" href="/cgi-bin/repo?id=z2MVnNUGexV3zmrGcqaqhZWv3CgbP">
                              <i class="align-text-bottom fa-solid fa-info"></i>
                              Info
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z2MVnNUGexV3zmrGcqaqhZWv3CgbP&issue=list">
                              <i class="align-text-bottom fa-solid fa-layer-group"></i>
                              Issues
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z2MVnNUGexV3zmrGcqaqhZWv3CgbP&patch=list">
                              <i class="align-text-bottom fa-solid fa-vest-patches"></i>
                              Patches
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z2MVnNUGexV3zmrGcqaqhZWv3CgbP&wallet=list">
                              <i class="align-text-bottom fa-solid fa-wallet"></i>
                              Wallets
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z2MVnNUGexV3zmrGcqaqhZWv3CgbP&source=.">
                              <i class="align-text-bottom fa-solid fa-code"></i>
                              Source
                            </a>
                          </li>
                        <h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted text-uppercase">
                          <span></span>
                        </h6>
                        <ul class="nav flex-column mb-2">
                        
                        </ul>
                      </div>
                    </nav>
                <main class="col-md-9 ms-sm-auto col-lg-10">
                  <div class="container px-1 py-3">
        

    <div class="list-group">
    <div class="list-group-item">
    <div style="font-size:1.3rem;">narc</div>
    <div class="repo-item">A command-line utility for manipulating NAR archives</div>
    <div>rad:z2MVnNUGexV3zmrGcqaqhZWv3CgbP</div>
    </div>
    <div class="list-group-item">
    <div>Visibility</div>
    <div class="repo-item">public</div>
    </div>
    <div class="list-group-item">
    <div>Delegates</div><div class="repo-item">did:key:z6MktH4iY2Mvq5ZkmoM7ayB4GM3U4p6HXKgB98nafiWkCam7</div>
    </div>
    <div class="list-group-item">
    <div>Default branch</div>
    <div><span class="repo-item">master &#8594 ab593c9b7fbe699a50358f7a15085d85ff8a544c</span> (Fri Jul  4 02:25:27 2025)</div>
    </div>
    <div class="list-group-item">
    <div>Threshold</div>
    <div class="repo-item">1</div>
    </div>
    </div>
    
        <div class="list-group mt-3">
        <div class="list-group-item">
        <div class="mb-2" style="font-weight:bold;"><i class="fa-solid fa-book"></i> README.md</div>
        <pre style="margin:0; font-size:0.85rem; overflow-x:auto; color:#fafafa;"># narc: Nix Archive (NAR) Command-Line Utility

`narc` is an ergonomic command-line tool for manipulating Nix Archive (NAR) files. It provides easy creation and extraction of NAR files, with a focus on streamability, allowing for seamless integration into shell pipelines.

## Purpose

The Nix Archive (NAR) format is a simple, self-describing, and reproducible serialization format for file system trees used by the Nix package manager. While Nix itself provides some utilities for NAR manipulation, `narc` aims to offer a more user-friendly and stream-oriented interface, particularly addressing the ability to pack to standard output and unpack from standard input.

## Usage

### `pack` subcommand

To create a NAR archive from a file or directory:

```bash
narc pack &lt;PATH&gt; [--output &lt;FILE&gt;] [--compress &lt;ALGORITHM&gt;] [--level &lt;LEVEL&gt;]
```

- `&lt;PATH&gt;`: The path to the file or directory to pack.
- `--output &lt;FILE&gt;` or `-o &lt;FILE&gt;`: (Optional) The path to the output NAR file. If omitted, the NAR stream will be written to standard output (stdout).
- `--compress &lt;ALGORITHM&gt;` or `-c &lt;ALGORITHM&gt;`: (Optional) Specifies the compression algorithm to use. Supported algorithms: `gzip`, `zstd`. If omitted, no compression is used.
- `--level &lt;LEVEL&gt;` or `-l &lt;LEVEL&gt;`: (Optional) Specifies the compression level. For `gzip`, this is a value from 0 (no compression) to 9 (best compression). For `zstd`, this is a value from 0 (default) to 22 (best compression). If omitted, the default compression level for the chosen algorithm will be used.

**Examples:**

Pack a directory to a file with gzip compression at level 9:
```bash
narc pack my_directory -o my_archive.nar.gz --compress gzip --level 9
```

Pack a single file to stdout with zstd compression at level 10:
```bash
narc pack my_file.txt --compress zstd --level 10
```

**Examples:**

Pack a directory to a file:
```bash
narc pack my_directory -o my_archive.nar
```

Pack a single file to stdout:
```bash
narc pack my_file.txt
```

### `unpack` subcommand

To extract a NAR archive:

```bash
narc unpack [&lt;FILE&gt;] --output &lt;DIR&gt; [--decompress &lt;ALGORITHM&gt;]
```

- `[&lt;FILE&gt;]`: (Optional) The path to the input NAR file. If omitted, the NAR stream will be read from standard input (stdin).
- `--output &lt;DIR&gt;` or `-o &lt;DIR&gt;`: (Required) The directory to unpack the contents into. If the directory does not exist, it will be created. If it exists, the contents will be unpacked into it.
- `--decompress &lt;ALGORITHM&gt;` or `-d &lt;ALGORITHM&gt;`: (Optional) Specifies the decompression algorithm to use. Supported algorithms: `gzip`, `zstd`. If omitted, no decompression is performed.

**Examples:**

Unpack a gzip-compressed archive from a file:
```bash
narc unpack my_archive.nar.gz -o my_unpacked_directory --decompress gzip
```

Unpack a zstd-compressed archive from stdin to a directory:
```bash
cat my_archive.nar.zst | narc unpack -o my_unpacked_directory --decompress zstd
```

Pipe directly from `pack` to `unpack` with compression:
```bash
narc pack my_directory --compress zstd --level 15 | narc unpack -o my_unpacked_directory --decompress zstd
```

**Examples:**

Unpack an archive from a file:
```bash
narc unpack my_archive.nar -o my_unpacked_directory
```

Unpack from stdin to a directory:
```bash
cat my_archive.nar | narc unpack -o my_unpacked_directory
```

Pipe directly from `pack` to `unpack`:
```bash
narc pack my_directory | narc unpack -o my_unpacked_directory
```

## Gemini CLI Session Progress

This project is being developed with the assistance of the Gemini CLI. A detailed log of the development process, including implemented features, current state, and next steps, is maintained in `.gemini/GEMINI_PROGRESS.md`.
</pre>
        </div>
        </div>

</div>
</main>
</div>
</div>


</body>
</html>

