Renames your PDFs, scans, photos and screenshots based on their content, entirely on your Mac: Apple's on-device model (FoundationModels) and Vision OCR. Nothing leaves the machine.
Scan 20261109-140943.pdf → 2026-11-09 - Reçu de paiement Le Petit Café - Repas - 45.80 EUR.pdf
IMG_0877.jpeg → 2026-11-03 - Photo - Couverture du livre L'océan d'amour.jpeg
Format, in French: AAAA-MM-JJ - Type Émetteur - Détail - MONTANT (date, document type
and issuer, detail, amount). The amount only appears for invoices,
receipts, quotes, credit notes, rent receipts and expense reports. Photos and screenshots
take the date they were taken. Names and prompts are in French.
Requirements: an Apple silicon Mac on macOS 27 or later, with Apple Intelligence turned on (System Settings → Apple Intelligence & Siri); Xcode 27 (Swift 6.4) only to build.
curl -fsSL https://raw.githubusercontent.com/levups/archiviste/main/scripts/install.sh | zsh
Installs the latest release:
the app in /Applications, the archiviste command in ~/.local/bin, then opens the app.
Running the same command again updates it (ARCHIVISTE_VERSION=1.2.0 for a given version).
Archiviste checks at launch, then every 12 hours, whether a new version is out: a single anonymous request to GitHub's API, which you can turn off in Settings › General. When there is one, "Install Archiviste x.y…" appears in the icon's menu and in Settings. If you accept, the app downloads the version, checks its checksum and that it is signed with Archiviste's release key, puts it in place of the old one, then reopens. Nothing downloaded runs before this check. Every version is signed with the same key, so macOS keeps the permissions (controlling Mail…) from one version to the next. Up to 1.3.0, the app was signed ad hoc: install the next version one last time with the command above.
The app is not notarized by Apple (self-signed certificate). The script downloads it with
curl, which does not quarantine it: it opens directly. If you download Archiviste.zip
from the releases page with a browser instead, macOS blocks it at first launch: open it
once, then System Settings › Privacy & Security › "Open Anyway".
Up to version 1.0, the app was called PDF Namer. The install command replaces the old app
and the old pdf-namer command. At first launch, Archiviste takes everything over:
~/.config/pdf-namer/ becomes ~/.config/archiviste/ (a link stays in the old place),
history and preferences are copied, and Archiviste opens at login if PDF Namer did. Files
already handled are still recognized: their hidden mark does not change. macOS only asks
again for permission to send notifications.
Written in Swift 6.4 in Swift 6 language mode (concurrency checked by the compiler), with
Approachable Concurrency: the app and the command live on the main actor, rendering and OCR
run as @concurrent.
The app is available in 34 languages, all those macOS offers (English, French, German, Spanish, Italian, Brazilian and European Portuguese, Dutch, Danish, Swedish, Norwegian, Finnish, Polish, Czech, Slovak, Croatian, Hungarian, Romanian, Greek, Catalan, Russian, Ukrainian, Turkish, Arabic, Hebrew, Hindi, Thai, Vietnamese, Indonesian, Malay, Japanese, Korean, Simplified and Traditional Chinese): it follows the system language (per-app choice in System Settings › General › Language & Region). File names stay in French.
- Clicking the menu bar icon shows its menu: a new version to install first when there is one, then open the window, tidy up now, pause, rules, settings, about, check for updates, help, quit. The Archiviste window has Activity (drop files, rename history with search, which you can clear), Rules, Folders (⌘1 to ⌘3). Preferences have their own Settings window (⌘,): General, Backups and Cleanup. With the window closed, the app stays in the menu bar.
- Settings › General: open at login (
SMAppService), menu bar icon (on/off), Dock icon (always, when the window is open, never). Everything applies right away, without relaunching. ⌘Q asks whether to quit or keep running in the background (with no window), unless you chose once and for all. With no icon at all, reopening the app from the Finder, Spotlight or Raycast shows its window. - Drop files (or a folder) on the icon or on the Activity page, choose them (⌘O), or paste them (⌘V).
- The Folders page has two kinds of watched folders; a folder is one or the other,
never both:
- inboxes (Downloads, Desktop, Scans…, key
watchedFolders): each file arriving there goes through the rules, first those on the name, then those on the content; the first one that matches renames and files it. With no rule, the model names PDFs and images in place, except in "Rules only" (keyrulesOnly): what no rule takes then keeps its name, handy for Downloads or the Desktop. A notification follows: clicking it shows the file in the Finder, "Undo" restores its original name. An inbox can also be a relay ("Only Move To…", keymoveTo): what arrives there is moved as is to another folder, for example an app's scans to the Desktop; - binders (Purchases, Sales…, key
datedFolders): any file put at their top level, by hand or by a rule, goes into its subfolder2026(by year),2026-11(by month) or2026-T4(by quarter, for quarterly VAT). The date is the document's, else that of a name that is already dated, else the file's. Option "Date the names": anAAAA-MM-JJ -(year-month-day) prefix for files put there by hand (a rule gives its own name). A rule that files into a binder puts the file directly into the right subfolder, in a single move.
- inboxes (Downloads, Desktop, Scans…, key
- What arrived while the app was closed is caught up at launch (the Finder's date added). A folder you just added starts from scratch, without taking the files already there.
- A file is only taken once it is fully written: same size and same modification date from
one look to the next, and not yet marked "being copied" by the Finder or AirDrop
(creation date of 24 January 1984, or 1946 for older Finders), nor reserved empty by
Firefox next to its
.part. A copy that stays like this for 10 minutes without changing (interrupted copy?) is set aside, with a card that says so. System files (.DS_Store,Thumbs.db,desktop.ini,._…), Office locks (~$…) and iCloud files not yet downloaded are never touched. - A rule that files to a disconnected disk or network share (
/Volumes/…) creates nothing on the Mac: the file waits, a notification says so once, and it goes as soon as the disk is back. - Tidy Up Now (⇧⌘R) takes care of files already there: the rules on those in the inboxes, date sorting on those left loose at the top level of the binders. A preview shows where each one would go, "File All" (⌘↩) files them. The model renames nothing during this pass; files with no rule stay in place.
- The history works like the Finder: Space for Quick Look, double-click to open, drag a file to another app, right-click to share, copy the name or the path, or undo the rename (several at once with ⇧ or ⌘).
- Every shortcut is in the menus (File, View, Renaming, Rules); pause: ⌥⌘P.
- Every rename can be edited or undone. The option "Confirm each name before renaming" waits for your approval for dropped files. Undo only restores the file Archiviste left there (same volume, same inode): if it has been moved or deleted since, or if another file now has its name, nothing moves and the app says so. The tags it had added are removed.
- Option (Settings › General): a Finder tag with the document type, named in French ("Facture", "Relevé de compte"…), on the files the model names, to find them in the Finder or Spotlight.
- In an inbox, a file renamed or filed by Archiviste is never taken again, even if its name
has no date or was edited by hand: a hidden mark (extended attribute
com.github.czj.pdf-namer.renamed, from the app's former name, which keeps the original name) flags it. The model does not rename files already namedAAAA-MM-JJ - …either. A binder, on the other hand, files any file put at its top level; live, a name that is already dated keeps its date (only "Tidy Up Now", with its preview, corrects it from the document).
Your Gmail filters already apply labels ("Achats", "Factures/EDF"…); in Apple Mail, each label is a folder of the account. In Settings › Mail, pair a label with a folder: every 5 minutes, while Mail is open, Archiviste reads that label's mails received since the given date (the day you added it), and saves their PDFs in that folder. They are named there like any dropped file, or taken by the rules and the model if the folder is an inbox, or dated if it is a binder.
- The mail then gets the label
Archiviste/Traité("handled"), visible in Gmail everywhere: it is never read again, on any Mac. - A mail with no PDF (the invoice is on the sender's website) gets
Archiviste/À récupérer("to fetch"): the list of what is left to download. Or, if you prefer, its text is saved as a PDF (receipts sent in the body of the mail). - Archiviste controls Mail through AppleScript (
osascript): macOS asks once for your permission (System Settings › Privacy & Security › Automation). It never opens Mail itself. Gmail filters remain the only place to say what is an invoice.
Before anything goes through the model, each file is checked against the rules: first those that only look at the name, then those that read the text, each group in list order. The first one that matches renames and files it, without calling the model. A rule looks at the file's name, its text (all the given phrases, case and accents ignored), where it came from, or several at once.
Text is read in PDFs (OCR for scans), images (OCR), Word (.docx, .doc), RTF,
OpenDocument, Excel (.xlsx), PowerPoint (.pptx), Pages, Numbers and Keynote (through
the preview they keep, unless they were saved without one: since iWork 2013, an image of
the first page only, read by OCR), and text files (.txt, .md, .csv, .json…). The
tester says how the text was read, or why it was not.
The origin is the Finder's Get Info "Where from": the address of the page a file was downloaded from. "impots.gouv.fr" takes everything that comes from the French tax site, whatever its name, without reading the document. Only web addresses count.
The name is described in words: "Facture" then "Power UP", and a kind of file (PDF,
images, audio, videos, spreadsheets). The words must appear in that order, anything can be
between them, case is ignored, and space, _ and - are all the same: "Power UP" also
finds power_up and PowerUP. The editor shows the regular expression written for you,
and the files in the history it would take. For what words cannot say (alternatives,
precise digits…), the "Regular expression" mode is still there. A rule already written
opens in words when its expression translates into them, and is only rewritten if you edit
it.
A rule files the file into a folder, under a new name, optionally prefixed with the document date (read by the model, else the file's creation date). The year or month subfolder is not set in the rule: it is the destination folder's when that folder is a binder. The rule editor shows it and lets you change it, for every rule that files there. A rule can also add Finder tags to what it files ("Factures", "À payer"); those the file already had stay.
The Rules page of the Archiviste window (⌘2) lists, searches, sorts, reorders and edits
them (⌘N, ⌘D, ⌫, ⌥⌘↑/↓, Space, ⌘Z). The tester (⌥⌘T, a file chosen with ⌥⌘O, or a file
dropped on the page) shows which rule takes a file, and what the rules that almost took it
are missing. They are saved in ~/.config/archiviste/rules.json:
{
"rules": [
{
"name": "Électricité",
"filename": "(?i)^Facture[ _-]*EDF.*\\.pdf\\z",
"contains": [],
"folder": "~/Documents/Factures",
"rename": "Facture EDF",
"datePrefix": true
},
{
"name": "Hébergement",
"contains": ["Example Hosting", "Facture"],
"folder": "~/Documents/Factures",
"rename": "Facture Example Hosting"
},
{
"name": "Impôts",
"from": "impots.gouv.fr",
"folder": "~/Documents/Impôts",
"tags": ["Impôts"]
}
]
}An empty folder leaves the file in place, an empty rename keeps its name. from
(origin) and tags (Finder tags) are only written when used. An older file may have a
subfolder key (year, yearMonth): it is still read, and the app moves it once and for
all to the folder's binder (datedFolders in config.json), without changing any
file's destination. Like config.json, the app writes this file: if it is versioned with
chezmoi, run chezmoi re-add after editing it in the app.
archiviste facture.pdf # prints the proposed name (from a rule or the model)
archiviste facture.pdf --json
archiviste --rename *.pdf # files by rule, else renames (with a backup)
archiviste --rename --dry-run * # dry run; with rules, any kind of file
archiviste --rename --force *.pdf # also takes files already handled or named
archiviste --rules *.pdf # which rule takes each file, why not the others, how its text is read
archiviste --text scan.pdf # what the model reads: text, candidate dates and amounts
archiviste --eval corpus/synthetique # scores the model on a labelled corpus (see "Name quality")
Before each rename, the original is copied as RENAME BACKUP <date> - <name> into the
backup folder, then deleted after 6 months.
The settings live in one file, ~/.config/archiviste/config.json (or
$XDG_CONFIG_HOME/archiviste/config.json), next to rules.json. The Settings window
writes it, the command reads it, and it can be edited by hand: the app reloads on its own
when it changes. When it saves, the app only rewrites the keys whose value changed; the
others, keys it doesn't know included, stay as written, and settings left at their default
are not added. It can be versioned with your dotfiles (chezmoi, stow…): run
chezmoi re-add after changing settings in the app. A link to it (stow) stays a link.
Before the app changes config.json or rules.json, the previous version is copied to
~/.config/archiviste/backups/ (config-2026-12-02.json, rules-2026-12-02.json), at
most once a day per file; the 30 most recent are kept (Settings › Backups and Cleanup,
configBackups and configBackupsKept).
Up to 1.6, a second file, config.local.json, held what the Settings window changed, and
its keys won over those of config.json. The first launch of the app or of the command
merges it into config.json, key by key, then moves it to backups/
(config.local-<date-time>.json, next to config-<date-time>.json, the config.json it
had before). If either file can't be read, nothing changes and the error is shown.
Every key is optional:
{
"backupDir": "~/Documents/Archives",
"backupMaxAgeDays": 180,
"expireMaxAgeDays": 548,
"watchedFolders": [
{ "path": "~/Documents/Scans", "enabled": true },
{ "path": "~/Downloads", "enabled": false }
],
"confirmBeforeRename": false
}| Key | Default | Purpose |
|---|---|---|
backupDir |
~/Documents/Archiviste/Originaux |
where originals are copied |
backupMaxAgeDays |
180 |
age after which backups are deleted (0 = never) |
expireMaxAgeDays |
0 |
moves to the Trash the other files of the backup folder added longer ago: handy if this folder also serves as "to throw away later" (0 = never) |
watchedFolders |
[] |
inboxes: rules then the model, rules only (rulesOnly), or relay (moveTo) |
datedFolders |
[] |
binders: path, subfolder (year, yearMonth, quarter, none), datePrefix, enabled |
confirmBeforeRename |
false |
dropped files: wait for "Rename" |
myNames |
[] |
you and your companies: the recipient, never taken for the issuer (Settings › General) |
tagDocumentType |
false |
Finder tag with the document type on the files the model names |
mailLabels |
[] |
Gmail labels read in Apple Mail: label, folder (where the PDFs go), since (YYYY-MM-DD), enabled |
mailBodyAsPDF |
false |
mail with no PDF: its text as a PDF, rather than the Archiviste/À récupérer label |
configBackups |
true |
before the app changes config.json or rules.json, a copy of the previous version in backups/, once a day at most |
configBackupsKept |
30 |
how many of these daily copies are kept, per file |
The prompt is measured on a labelled corpus rather than by eye. corpus/synthetique/ holds
18 fictitious documents (marketplace invoice, credit note with the recipient in the header,
payslip, prescription, tax notice with a deadline, till receipt…): their text and the
expected fields are in corpus.json, the PDFs come out of swift tools/make_corpus.swift corpus/synthetique.
archiviste --eval corpus/synthetique # each mismatch, then the score per field
A private corpus is built the same way outside the repository (a folder, its files and a
corpus.json) and passed to the same command. For a score to mean something, the prompt is
tuned on corpus/synthetique and measured on the others, without rereading them to
fix things: otherwise they become as flattering as it is.
Several ways of querying the model are compared with --strategy (see
Sources/ArchivisteCore/Strategy.swift) and tools/compare_strategies.sh <corpus> <folder>.
Tuned on corpus/dev (40 fictitious documents), then measured once on the others, the app
keeps twoPass+reasoning+guards+headTail+blend: the type alone first, then the other fields
after having the model copy out the title and the author's line, the start and end of long
texts, and the amount from the simple query, which picks the total including VAT better
(asked alone with the type, at the same time as the rest). About 4 s per document instead
of 2.5; on the private corpus the issuer goes from 43 to 60 %, the date from 93 to 100 % and
the amount from 73 to 80 % (88 to 95 % on the public invoices). Not attaching the page image
when the text exists (textOnly) saves 15 % of the time but drops the amount on the public
invoices to 51 %: rejected. These corpora have therefore served two choices (the strategy,
then the image): their scores are a bit flattering, and the next honest measurement needs
new, never-seen documents. That is corpus/controle (24 fictitious documents, another
recipient, hard cases: issuer in the footer, a platform's seller, subtotals, report, guide,
label…): it has never been run yet. It only serves for the final measurement of a change,
never to choose between two variants. Asking the model directly for the file name was
tried: clearly worse (issuer 30 % instead of 62 % on corpus/dev).
A public corpus completes it: 100 labelled fictitious French invoices
(N-Mehdi/french-invoices-synth,
Apache-2.0), downloaded into corpus/public/ (not versioned):
uv run --with pyarrow --with huggingface_hub python tools/fetch_public_corpus.py
archiviste --eval corpus/public/french-invoices-synth
scripts/build-app.sh # release build, signs, installs "Archiviste Dev"
# in /Applications, beside Archiviste
scripts/build-app.sh --no-install # only build/Archiviste Dev.app
scripts/import-dev-identity.sh # once per Mac: the "Archiviste Dev" identity, from 1Password
scripts/release.sh # from a clean main: tests, build, GitHub release of the
# Info.plist version, notes taken from the CHANGELOG (tag v1.2.0)
swift test
Every pull request and every push to main is built and tested by GitHub Actions
(.github/workflows/ci.yml, macOS 27 and Xcode 27).
Publishing a version: a pull request that changes the version in Resources/Info.plist
(CFBundleShortVersionString, and CFBundleVersion + 1) and renames "Unreleased" in
CHANGELOG.md to ## 1.2.1 — 30 November 2026. Once merged, GitHub Actions
(.github/workflows/release.yml) tests, builds and publishes the v1.2.1 release, with that
CHANGELOG section as notes (scripts/release.sh, which also works by hand).
Signing: published versions are signed with the self-signed certificate "Archiviste
Release". Its key is stored, as a base64-encoded .p12, with its password, in the
SIGNING_CERTIFICATE_P12 and SIGNING_CERTIFICATE_PASSWORD secrets of the GitHub
environment release, restricted to main. The workflow imports it into a throwaway
keychain (scripts/import-certificate.sh), then deletes it. The certificate's SHA-1
fingerprint is in Sources/ArchivisteCore/Release.swift and scripts/install.sh: the app
and the install script refuse any other signature.
Test builds: scripts/build-app.sh makes "Archiviste Dev" (com.github.czj.archiviste.dev),
which installs beside Archiviste and never replaces it. It has its own permissions and
preferences, keeps its settings and rules in ~/.config/archiviste-dev and its backups in
~/Documents/Archiviste Dev/Originaux by default, leaves
~/.local/bin/archiviste alone and never updates itself. It is signed with the "Archiviste
Dev" identity, a self-signed certificate kept in 1Password: scripts/import-dev-identity.sh
puts it in the login keychain, once per Mac, so macOS keeps the test build's permissions from
one build to the next. Without it the build is signed ad hoc and macOS asks again each time.
Xcode must be selected (sudo xcode-select -s /Applications/Xcode.app/Contents/Developer):
the script compiles the icon (Resources/AppIcon.icon, Icon Composer format with Liquid
Glass layers, editable in Icon Composer) with actool. You can also open Package.swift
in Xcode.
A port of a personal Python script. swift test checks that the naming rules (case,
cleanup, amounts, candidate dates, final name) give exactly the same results as the script
on ~2,500 cases, recorded in Tests/ArchivisteCoreTests/Fixtures/parity.json by
tools/gen_parity.py. The only intended difference: Vision OCR runs in accurate mode.
MIT