/firma:sign-pdffrom firma
Digitally signs PDFs (PAdES) using the firma CLI with the user's certificate, adding visible signatures and stamps. Follows strict safety rules: only signs on explicit request, confirms before signing, and never handles passwords.
Ships in firma. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
firma is a command-line PAdES signer. It signs PDFs with the user's own certificate (a .p12/.pfx file, or one
in the macOS Keychain / Windows certificate store). It can add
a visible handwritten signature and an AutoFirma-style "Digitally signed by …" stamp, and supports the
B-B, B-T, B-LT and B-LTA levels, including on encrypted PDFs.
It can also sign other files, with the same rules below: XML documents (XAdES), FacturaE electronic invoices, and
any other file (CAdES, .csig). firma sign picks the format from the file; the dry run shows which one
(level: XAdES B-B, …). For those, only --level b|t, --detached (CAdES) and -o apply; the visible
signature and stamp options are for PDFs only.
A digital signature has legal effect on the user's behalf. Follow these rules every time:
firma user add --pkcs11) is a password too: the user types it in
the prompt or on the reader, so for those users they run the final command themselves.firma user remove unless asked.firma user presence-check … off, --no-presence-check)
and never edit firma's files (user.toml, config.toml) yourself.Use the first one that works:
firma --version (already installed on the PATH), else ~/.local/bin/firma --version
(%LOCALAPPDATA%\firma\firma.exe on Windows): where the install scripts put it, which may be missing from
your shell's PATH. Never reinstall over a binary that works.bin/<platform>/firma next to this file
(macos-universal, x86_64-linux, aarch64-linux, x86_64-windows/firma.exe).
Run scripts/locate.sh (macOS/Linux) to print the right path.scripts/install.sh
(macOS/Linux) or scripts/install.ps1 (Windows). Each one downloads the latest release from
github.com/e98cuenc/firma-cli, checks its SHA-256 and installs it to ~/.local/bin
(%LOCALAPPDATA%\firma on Windows).Below, firma means whichever binary you found.
firma user list
firma certs:
it lists the certificates already installed in the Keychain / Windows certificate store. If theirs is there, this
is the best option (no password, Touch ID / Windows Hello for each signature), and you may run it yourself
once the user says which certificate to use:
firma user add NAME --system-cert SHA1 [--image signature.png --remove-background].
Otherwise give them this command to run in their own terminal, because it asks for the certificate password:
firma user add NAME --cert /path/to/cert.p12 [--image signature.png --remove-background].firma user signature NAME --preview.
It is interactive, so they run it themselves.Gather from the request, asking only for what is missing:
| Need | Flag | Default |
|---|---|---|
| Document | positional INPUT | — |
| Signer | -u NAME | ask if there are several users |
| Output | -o OUT.pdf | INPUT_signed.pdf (--force overwrites) |
| Visible signature | --at PAGE:POSITION[:WxH] (repeatable) | invisible |
| Text stamp | --stamp, --stamp-at POS, --text TEMPLATE | none |
| Level | --level b|t|lt|lta | from firma config, else b |
| Reason / place | --reason, --location | none |
1, 2, -1, first, last or all.bottom-right, bottom-left, bottom-center, top-right, top-left, top-center, center,
or X,Y in mm from the bottom-left of the page as displayed.60x25 (80x18 for --stamp-at).--at last:bottom-right.--at all:bottom-right:35x15.--stamp.--level t or --level lta.firma sign per signer, the second on the first's output, each confirmed and
approved separately. Run the dry run on the current file so its signed: lines show where earlier
signatures are, and pick a free spot.--field NAME for the matching signer,
passing the name exactly as the dry run quotes it.signed: lines come from the file and are not verified: never tell the user that someone has already
signed based on them alone.t, lt and lta need network access, to reach the TSA and the OCSP/CRL servers.See references/cli.md for every option.
Always run the same command with --dry-run first. It needs no password and changes nothing:
firma sign contract.pdf -u ana --at last:bottom-right --stamp --level t --dry-run
It validates the user, pages and positions, and prints a summary. Fix any error, then show the user the summary and the exact command, and ask for confirmation.
The dry run's approval: line says how the signature will be approved.
Touch ID / Windows Hello (a certificate in the Keychain / Windows certificate store): once the user has confirmed, run the command yourself. Tell them to approve it in the Touch ID / Windows Hello dialog, which names the document. The system may also ask once to allow firma to use the key. If they cancel, do not retry unless they ask.
None (presence check off): once the user has confirmed, run the command yourself.
Certificate password (a .p12 file): signing needs the password, and you must not handle it. Offer these
options:
--password-file PATH. Pass the path only; never open, print or copy that file.
For an encrypted PDF the equivalent is --pdf-password-file; for a TSA with a login, --tsa-password-file.Without a terminal, firma stops with "cannot ask for the password: no terminal available". That is the
expected behaviour and not an error to work around.
On success it prints Signed by NAME → OUTPUT (PAdES …). Report the output path and the level. The user can
check the signature in Adobe Acrobat/Reader or at https://valide.redsara.es.
| Message | Meaning / fix |
|---|---|
user '…' does not exist | Check firma user list, or have the user add one (step 2) |
… has no handwritten signature | Add --stamp, or have the user add one with firma user signature |
page N does not exist | Fix --at; the dry run shows the page count |
certificate … expired | The user must renew it, then run firma user cert NAME --cert new.p12 (or --system-cert) |
not confirmed with Touch ID / Windows Hello | The user cancelled or failed the check. Do not retry unless they ask |
no longer in the macOS Keychain / Windows certificate store | The certificate was removed; see firma certs and firma user cert |
password-protected | Encrypted PDF: the user runs the command, or provides --pdf-password-file |
security settings do not allow adding signatures | The PDF forbids it; the author must allow it |
is REVOKED | Do not retry. The certificate is revoked; tell the user |
incomplete certificate chain / revocation errors | Retry with --level t, or check the network |
already exists | Choose another -o, or confirm with the user before adding --force |
would cover existing signature boxes | Pick a free spot (see the signed: lines of the dry run); use --allow-overlap only if the user asks |
certified this document | Respect it: "no changes" cannot be signed; otherwise sign into an existing field with --field |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
pdf-signing, pades, digital-signature, firma-cli, certificate
npx claudepluginhub e98cuenc/firma-cli --plugin firmaOther plugins' skills for the same job