@br-validators/cli
Advanced tools
+13
-4
| { | ||
| "name": "@br-validators/cli", | ||
| "version": "0.12.0-alpha.0", | ||
| "description": "Terminal CLI for Brazilian document validation — CPF, CNPJ, CEP, IE, PIX, boleto, and more", | ||
| "version": "0.12.0-alpha.1", | ||
| "description": "CLI for @br-validators/core — CPF, CNPJ, NF-e, IE, PIX, boleto + detect/sanitize/generate", | ||
| "license": "MIT", | ||
@@ -21,3 +21,12 @@ "type": "module", | ||
| "cpf", | ||
| "cnpj" | ||
| "cnpj", | ||
| "nfe", | ||
| "cnh", | ||
| "renavam", | ||
| "pix", | ||
| "boleto", | ||
| "inscricao-estadual", | ||
| "detect", | ||
| "sanitize", | ||
| "generate" | ||
| ], | ||
@@ -33,3 +42,3 @@ "publishConfig": { | ||
| "commander": "^13.1.0", | ||
| "@br-validators/core": "0.12.0-alpha.0" | ||
| "@br-validators/core": "0.12.0-alpha.1" | ||
| }, | ||
@@ -36,0 +45,0 @@ "devDependencies": { |
+49
-7
@@ -23,3 +23,3 @@ # @br-validators/cli | ||
| ## Commands | ||
| ## Global commands | ||
@@ -29,15 +29,31 @@ ```bash | ||
| br-validators --version | ||
| br-validators --help | ||
| ``` | ||
| --- | ||
| ## Per-type commands | ||
| ```bash | ||
| br-validators cnpj validate 12ABC34501DE35 --json --source | ||
| br-validators cpf validate 12345678909 | ||
| br-validators cep format 01310100 | ||
| br-validators telefone validate 11999999999 | ||
| br-validators cnh validate 62472927637 | ||
| br-validators renavam validate 63977791104 | ||
| br-validators titulo-eleitor validate 004356870906 | ||
| br-validators nfe-chave validate 52060433009911002506550120000007800267301615 --json | ||
| br-validators nfe-chave parse 52060433009911002506550120000007800267301615 --json | ||
| br-validators brcode validate '<emv-payload>' --json | ||
| br-validators placa validate ABC1D23 | ||
| br-validators pis-pasep validate 10027230888 | ||
| br-validators pix validate pix@bcb.gov.br | ||
| br-validators boleto validate <linha-ou-barcode> | ||
| br-validators boleto validate '03399.02579 08991.834006 71742.301014 6 14500000099668' | ||
| br-validators cartao validate 4111111111111111 | ||
| br-validators cartao-credito validate 4111111111111111 | ||
| br-validators ie validate 110042490114 --uf SP --json | ||
| br-validators ie validate P-01100424.3/002 --uf SP # SP produtor rural (auto-detect) | ||
| ``` | ||
| ### Actions (all types) | ||
| ### Actions (per-type) | ||
@@ -49,12 +65,37 @@ | Action | Description | | ||
| | `strip` | Normalize to canonical digits/chars | | ||
| | `parse` | NF-e chave, BR Code | | ||
| | `convert` | Boleto linha ↔ barcode; placa legacy → Mercosul | | ||
| | `detect` | PIX key type; boleto input kind; cartão brand | | ||
| ### Flags | ||
| --- | ||
| ## Platform commands | ||
| | Command | Description | | ||
| |---------|-------------| | ||
| | `detect [value]` | Classify raw input; `--uf` for IE | | ||
| | `sanitize <type> [value]` | ETL fixes + validate; `--uf` for `inscricao-estadual` | | ||
| | `generate <type>` | Synthetic test document; `--seed`, `--masked`, `--format` | | ||
| ```bash | ||
| br-validators detect '123.456.789-09' --json | ||
| br-validators detect '110042490114' --uf SP --json | ||
| br-validators sanitize cpf ' 123.456.789-09 ' --json | ||
| br-validators sanitize inscricao-estadual '110.042.490.114' --uf SP --json | ||
| br-validators generate cpf --seed 42 --masked --json | ||
| br-validators generate cnpj --format alphanumeric --seed 7 --json | ||
| br-validators generate placa --format mercosul --seed 3 | ||
| ``` | ||
| --- | ||
| ## Flags | ||
| | Flag | Description | | ||
| |------|-------------| | ||
| | `--json` | JSON output (`ValidationResult`) | | ||
| | `--json` | JSON output | | ||
| | `--quiet` / `-q` | Exit code only (CI) | | ||
| | `--file` / `-f` | Read value from file | | ||
| | `--source` | Print official source URL | | ||
| | `--uf` | Required for IE (27 UFs) | | ||
| | `--source` | Print official source URL (per-type) | | ||
| | `--uf` | Required for IE / detect / sanitize IE | | ||
@@ -65,2 +106,3 @@ ### CI | ||
| br-validators cnpj validate "$CNPJ" --quiet || exit 1 | ||
| br-validators detect "$RAW_INPUT" --json --quiet || exit 1 | ||
| ``` | ||
@@ -67,0 +109,0 @@ |
68440
2.58%111
60.87%+ Added
- Removed