1
Fork 0
mirror of https://github.com/thegeneralist01/archivr synced 2026-07-21 18:55:36 +02:00

docs: document runtime entrypoints

This commit is contained in:
TheGeneralist 2026-06-21 19:22:59 +02:00
parent b56c969624
commit 44c17eee3d
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
2 changed files with 77 additions and 0 deletions

View file

@ -57,6 +57,40 @@ label = "Personal"
archive_path = "/path/to/archive/.archivr"
```
## How To Run It
There are two user-facing binaries:
| Binary | Purpose |
|---|---|
| `archivr` | CLI for initializing archives and capturing material into one archive |
| `archivr-server` | Web server for browsing one or more existing archives |
The CLI writes archive data:
```sh
nix run .#archivr -- init ./my-archive --name "My Archive"
nix run .#archivr -- archive file:///absolute/path/to/file.pdf
```
The server reads archive data:
```sh
nix run .#archivr-server -- ./archivr-server.toml
```
If no config path is passed, the server reads `./archivr-server.toml`.
The config is a server registry, not archive data:
```toml
[[archives]]
id = "personal"
label = "Personal"
archive_path = "/absolute/path/to/my-archive/.archivr"
```
The packaged Nix server wrapper sets `ARCHIVR_STATIC_DIR` so the server can find the installed web UI assets. Source-tree runs do not need that variable because they fall back to `crates/archivr-server/static`.
## Write Data Flow
When archiving something through the CLI:

View file

@ -56,6 +56,49 @@ This project aims to provide a reliable solution for archiving important data fr
- Direct platform URLs
- Platform shorthand inputs such as `tweet:...`, `yt:...`, or `instagram:...`
## Running Archivr
Archivr currently ships as two binaries:
- `archivr`
- The CLI for creating and writing to one archive.
- Use this for `init` and `archive`.
- `archivr-server`
- The web server for reading one or more existing archives through the browser UI.
- Use this after archives already exist.
With Nix, run the CLI with:
```sh
nix run .#archivr -- init ./my-archive --name "My Archive"
nix run .#archivr -- archive file:///absolute/path/to/file.pdf
```
Run the web server with:
```sh
nix run .#archivr-server -- ./archivr-server.toml
```
The server expects a TOML registry file. If no path is passed, it reads `./archivr-server.toml`.
Example:
```toml
[[archives]]
id = "personal"
label = "Personal"
archive_path = "/absolute/path/to/my-archive/.archivr"
```
Then open:
```text
http://127.0.0.1:8080
```
When installed through Nix, `archivr-server` is wrapped so it can find the static web UI assets automatically. The wrapper sets `ARCHIVR_STATIC_DIR` to the installed static asset directory. Running from source with `cargo run -p archivr-server` falls back to `crates/archivr-server/static`.
### Supported Platforms
- Local files: `file:///absolute/path/to/file.ext`