@br-validators/cli 0.12.0-alpha.0 → 0.12.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +49 -7
  2. package/package.json +13 -4
package/README.md CHANGED
@@ -20,45 +20,87 @@ npx @br-validators/cli --help
20
20
 
21
21
  ---
22
22
 
23
- ## Commands
23
+ ## Global commands
24
24
 
25
25
  ```bash
26
26
  br-validators list
27
27
  br-validators --version
28
+ br-validators --help
29
+ ```
30
+
31
+ ---
32
+
33
+ ## Per-type commands
28
34
 
35
+ ```bash
29
36
  br-validators cnpj validate 12ABC34501DE35 --json --source
30
37
  br-validators cpf validate 12345678909
31
38
  br-validators cep format 01310100
39
+ br-validators telefone validate 11999999999
40
+ br-validators cnh validate 62472927637
41
+ br-validators renavam validate 63977791104
42
+ br-validators titulo-eleitor validate 004356870906
43
+ br-validators nfe-chave validate 52060433009911002506550120000007800267301615 --json
44
+ br-validators nfe-chave parse 52060433009911002506550120000007800267301615 --json
45
+ br-validators brcode validate '<emv-payload>' --json
32
46
  br-validators placa validate ABC1D23
33
47
  br-validators pis-pasep validate 10027230888
34
48
  br-validators pix validate pix@bcb.gov.br
35
- br-validators boleto validate <linha-ou-barcode>
49
+ br-validators boleto validate '03399.02579 08991.834006 71742.301014 6 14500000099668'
36
50
  br-validators cartao validate 4111111111111111
51
+ br-validators cartao-credito validate 4111111111111111
37
52
  br-validators ie validate 110042490114 --uf SP --json
53
+ br-validators ie validate P-01100424.3/002 --uf SP # SP produtor rural (auto-detect)
38
54
  ```
39
55
 
40
- ### Actions (all types)
56
+ ### Actions (per-type)
41
57
 
42
58
  | Action | Description |
43
59
  |--------|-------------|
44
60
  | `validate` | Check format + check digits |
45
61
  | `format` | Apply official mask |
46
62
  | `strip` | Normalize to canonical digits/chars |
63
+ | `parse` | NF-e chave, BR Code |
64
+ | `convert` | Boleto linha ↔ barcode; placa legacy → Mercosul |
65
+ | `detect` | PIX key type; boleto input kind; cartão brand |
66
+
67
+ ---
68
+
69
+ ## Platform commands
70
+
71
+ | Command | Description |
72
+ |---------|-------------|
73
+ | `detect [value]` | Classify raw input; `--uf` for IE |
74
+ | `sanitize <type> [value]` | ETL fixes + validate; `--uf` for `inscricao-estadual` |
75
+ | `generate <type>` | Synthetic test document; `--seed`, `--masked`, `--format` |
76
+
77
+ ```bash
78
+ br-validators detect '123.456.789-09' --json
79
+ br-validators detect '110042490114' --uf SP --json
80
+ br-validators sanitize cpf ' 123.456.789-09 ' --json
81
+ br-validators sanitize inscricao-estadual '110.042.490.114' --uf SP --json
82
+ br-validators generate cpf --seed 42 --masked --json
83
+ br-validators generate cnpj --format alphanumeric --seed 7 --json
84
+ br-validators generate placa --format mercosul --seed 3
85
+ ```
86
+
87
+ ---
47
88
 
48
- ### Flags
89
+ ## Flags
49
90
 
50
91
  | Flag | Description |
51
92
  |------|-------------|
52
- | `--json` | JSON output (`ValidationResult`) |
93
+ | `--json` | JSON output |
53
94
  | `--quiet` / `-q` | Exit code only (CI) |
54
95
  | `--file` / `-f` | Read value from file |
55
- | `--source` | Print official source URL |
56
- | `--uf` | Required for IE (27 UFs) |
96
+ | `--source` | Print official source URL (per-type) |
97
+ | `--uf` | Required for IE / detect / sanitize IE |
57
98
 
58
99
  ### CI
59
100
 
60
101
  ```bash
61
102
  br-validators cnpj validate "$CNPJ" --quiet || exit 1
103
+ br-validators detect "$RAW_INPUT" --json --quiet || exit 1
62
104
  ```
63
105
 
64
106
  ---
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@br-validators/cli",
3
- "version": "0.12.0-alpha.0",
4
- "description": "Terminal CLI for Brazilian document validation — CPF, CNPJ, CEP, IE, PIX, boleto, and more",
3
+ "version": "0.12.0-alpha.1",
4
+ "description": "CLI for @br-validators/core — CPF, CNPJ, NF-e, IE, PIX, boleto + detect/sanitize/generate",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "repository": {
@@ -18,7 +18,16 @@
18
18
  "cli",
19
19
  "validator",
20
20
  "cpf",
21
- "cnpj"
21
+ "cnpj",
22
+ "nfe",
23
+ "cnh",
24
+ "renavam",
25
+ "pix",
26
+ "boleto",
27
+ "inscricao-estadual",
28
+ "detect",
29
+ "sanitize",
30
+ "generate"
22
31
  ],
23
32
  "publishConfig": {
24
33
  "access": "public",
@@ -29,7 +38,7 @@
29
38
  },
30
39
  "dependencies": {
31
40
  "commander": "^13.1.0",
32
- "@br-validators/core": "0.12.0-alpha.0"
41
+ "@br-validators/core": "0.12.0-alpha.1"
33
42
  },
34
43
  "devDependencies": {
35
44
  "@types/node": "^22.15.21",