Files
afilmory/apps/docs/contents/builder/cli.mdx
Innei d5a2ea4db2 feat: enhance documentation and add new features for Afilmory
- Introduced a comprehensive `DEVELOPMENT.md` guide for contributors and self-hosters, detailing workspace layout and common commands.
- Updated `README.md` to include links to the new development guide and improved deployment instructions.
- Added new documentation files covering architecture, builder pipeline, configuration, and deployment strategies.
- Implemented new storage provider documentation for Backblaze B2, Eagle, GitHub, and local storage options.
- Enhanced the UI components with new features, including a navigation context and improved theme handling.
- Removed outdated GitHub Action deployment documentation.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-23 19:40:51 +08:00

54 lines
1.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: CLI & Run Modes
description: Per-run flags, concurrency behavior, and cluster vs worker execution.
createdAt: 2025-11-23T19:00:00+08:00
lastModified: 2025-11-23T19:40:52+08:00
order: 2
---
# CLI & Run Modes
The builder CLI lives in `packages/builder/src/cli.ts` and is invoked via `pnpm run build:manifest`. Use flags for one-off overrides; everything else comes from config.
## Commands
```bash
# Incremental (default)
pnpm run build:manifest
# Full rebuild
pnpm run build:manifest -- --force
# Refresh manifest fields (keep thumbnails unless missing)
pnpm run build:manifest -- --force-manifest
# Regenerate thumbnails only
pnpm run build:manifest -- --force-thumbnails
# Show resolved config
pnpm run build:manifest -- --config
# Disable TUI, use plain logs
pnpm run build:manifest -- --no-ui
```
## Concurrency & execution model
- `system.processing.defaultConcurrency` provides the baseline per worker.
- `observability.performance.worker.workerCount` sets how many workers/threads (or cluster workers) run in parallel. If unset, defaults to `os.cpus().length * 2`.
- Cluster mode turns on when `useClusterMode: true` **and** the task queue is large enough; otherwise it falls back to a worker pool.
- `workerConcurrency` controls how many photos a single worker handles concurrently.
## Incremental logic (per file)
- `--force`: process everything.
- New file: processed.
- Updated `LastModified` or `--force-manifest`: rebuild manifest entry (EXIF + tone).
- Missing thumbnail or `--force-thumbnails`: regenerate thumbnail + ThumbHash.
- Otherwise reuse existing manifest item and thumbnail.
## Exit codes & help
- `--help` prints all flags and exits 0.
- The CLI exits nonzero on failures (e.g., missing storage config, missing Perl, processing errors).