facturas CLI provides four commands that cover the full credential setup and verification workflow for ARCA. This page documents every flag, output, and exit condition for each command. For a high-level introduction, see CLI Overview.
init, cert, and check never write to ARCA and do not create or modify any fiscal records. Only issue contacts ARCA to create a document — a real homologación voucher.facturas init
Generates a 2048-bit RSA private key (PKCS#8, unencrypted) and a CSR formatted with the subject ARCA requires:
CUIT — this is what the ARCA spec mandates.
--cuit and --env are required; the command exits with code 2 if either is missing.
CUIT validation runs before writing anything. The CLI accepts CUITs with or without hyphens or spaces (20-12345678-6, 20 12345678 6, 20123456786) and validates the 11-digit format and modulo-11 check digit. In a terminal it retries up to three times with the reason; non-interactively it exits immediately with code 2.
After writing the files, init prints the exact steps to follow in ARCA — page names, field labels, and button text — for whichever environment you chose. It then prompts you to paste the certificate (equivalent to running facturas cert immediately after). Press Ctrl-C or pass --no-paste to skip that step and do it later with npx facturas cert.
Flags
required
Your 11-digit CUIT. Accepts hyphens and spaces. Validated before any file is written.
required
Target environment. Determines file names, clipboard behavior, and the ARCA instructions printed.
Common name for the CSR. Defaults to
facturas. The alias ARCA sees is this name with hyphens and dots removed, plus Test or Production (ARCA only accepts letters and digits in symbolic names).Organization field of the CSR. Defaults to the CUIT when omitted.
Directory to write the key and CSR. Defaults to the current working directory.
Overwrite existing
arca-<env>.key and arca-<env>.csr files. Without this flag, the command refuses to overwrite and exits with code 1.Print the CSR to the terminal instead of copying it to the clipboard.
Skip the certificate prompt at the end. Use
npx facturas cert later to save the certificate.Output files
If a
.gitignore file exists in the target directory, init appends arca-*.key and arca-*.crt to it (once only) and tells you.
Clipboard behavior
In test (--env test), init copies the CSR to your clipboard before printing the instructions, so pasting it into the ARCA form requires no manual selection. It uses the first available tool: pbcopy, wl-copy, xclip, xsel, or clip — called directly, without a shell, with no extra installs. If none of these tools is available (headless server, SSH session), the CSR is printed inline in the instructions instead.
In production (--env production), the CSR is not copied to the clipboard because ARCA expects a file upload, not a text paste.
Example
facturas cert
Saves the PEM certificate that ARCA issues after approving your CSR. This is the same step init offers at the end — cert exists for when you skipped it with Ctrl-C or --no-paste, or when you ran init in a non-interactive environment.
-----BEGIN CERTIFICATE----- to -----END CERTIFICATE-----). It finishes automatically as soon as it sees the closing line. In scripts, pipe in the file instead:
cert verifies two things and exits with code 1 if either check fails — without saving anything:
- The certificate’s RSA modulus matches
arca-<env>.key(same key pair) - The CUIT in the certificate’s
serialNumberfield matches your configured CUIT
1 on the first failure.
Flags
Which key/certificate pair to use when both are present in the directory. Required when
arca-test.key and arca-production.key both exist; the command exits with code 1 and asks you to specify.Where to look for
arca-<env>.key (and write arca-<env>.crt). Defaults to the current working directory.Overwrite an existing
arca-<env>.crt file.Output file
Example
facturas check
Tests each ARCA integration layer in sequence and stops at the first failure, reporting the exact diagnosis and the fix. After running init and cert, you need nothing else:
check also works with environment variables — the same ones your application will use:
Layers tested
Value resolution order
check and issue resolve configuration in this order — the first source that provides a value wins:
File discovery rules:
- One complete pair → that pair is used; environment is inferred from the filename
- Both pairs present → exits with code
1and asks you to specify--env - Half a pair (key without certificate, or vice versa) → tells you which file is missing
Flags
Read the certificate PEM from a file instead of
ARCA_CERTIFICATE_PEM.Read the private key PEM from a file instead of
ARCA_PRIVATE_KEY_PEM.CUIT override. Validated with the same rules as
init.Environment override, or disambiguation when both pairs exist in the directory.
Directory to search for
arca-<env>.crt and arca-<env>.key. Defaults to the current directory.Verify a specific sales point. Must be an integer from 1 to 99999; any other value exits with code
2.Skip the WSAA ticket cache entirely — request a new ticket and hold it in memory only. Use this when you want to force a fresh login.
Print a single JSON object instead of the human-readable output. Layers that weren’t reached are omitted.
WSAA ticket cache
The CLI caches WSAA tickets in<tmpdir>/facturas-cli (directory mode 0700, files mode 0600). ARCA rejects a second login while a ticket is still valid — up to 12 hours (coe.alreadyAuthenticated) — so the cache makes it safe to run check multiple times, or chain check with issue, without triggering that error. Pass --no-cache to request a fresh ticket that is never written to disk.
Warnings that don’t fail
Two conditions produce a warning but keep the exit code at0:
- A certificate expiring within 30 days
- An empty sales point list in the test environment (ARCA often omits them in homologación even when they work; a
--sales-pointnot found in the list is reported as3 (no informado)andissuecan still proceed)
1).
JSON output
Example
Diagnostics reference
All check failures and fixes
All check failures and fixes
Each named failure maps to exactly one row in this table.
Any error not listed here surfaces with the SDK’s safe message and stable error code. See the Errors reference for the full error hierarchy.
facturas issue
Issues one ARS 1 invoice in the homologación environment to verify that the full issuance circuit works end-to-end. The command refuses to run outside test — it will not issue in production.
Before emitting, issue runs all five check layers. If any layer fails, it stops there and exits with code 1.
Flags
Accepts allcheck flags (--dir, --no-cache, --env, --cert, --key, --tax-id) plus:
required
Sales point number. Prompted interactively if not provided in a terminal.
The issuer’s tax condition. One of:
monotributo, responsable_inscripto, exento, no_alcanzado. Prompted interactively if not provided in a terminal.Print the result as JSON — same shape as the SDK’s
issue() return value. On ARCA failure, prints an error object with the stable SDK error code.Non-authorized outcomes
If ARCA fails after the layers pass (between number reservation and authorization), the CLI shows
✗ emisión with the SDK’s safe error message and exits with code 1. No raw traces or PEM contents are ever printed.