Skip to content

Commit b1560f2

Browse files
feat(cli): align official slugs and add oauthv2
1 parent 78e7ab8 commit b1560f2

28 files changed

Lines changed: 947 additions & 112 deletions

.convcommit

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# convcommit - Conventional Commit message builder
2+
# This file is read by the `convcommit` CLI tool to populate
3+
# the interactive selector menus.
4+
# Commit this file to share the project's commit vocabulary with the team.
5+
#
6+
# FORMAT
7+
# type:<value> — commit type option (e.g. fix, feat, docs)
8+
# scope:<value> — commit scope option
9+
# message:<value> — commit message template
10+
#
11+
# SPECIAL PREFIXES
12+
# ~<value> — marks the default selection
13+
# _ — enables free-text manual input (press ".")
14+
# [X]<value> — forces key letter X for this entry (e.g. [B]build, [W]wip)
15+
#
16+
# HOW TO USE (interactive)
17+
# Run `convcommit` in a git repo. A menu appears for type, scope, message.
18+
# Press the letter in brackets [A][B]... or [.] for free-text input.
19+
# Stage and push in one shot:
20+
# convcommit -a -p
21+
#
22+
# HOW TO USE (direct flags — scripts, AI agents)
23+
# Bypass the selector entirely with explicit flags:
24+
# convcommit --type fix --scope auth --message "fix null pointer" --push
25+
# convcommit -t feat -s api -m "add endpoint" -a -p
26+
#
27+
# SMART PATTERN — stage specific files and commit in one command
28+
# Use --add instead of nested command substitution.
29+
# Anti-pattern (avoid):
30+
# msg=$(convcommit --type fix --message "fix") && git commit -m "$msg" && git push
31+
# Recommended:
32+
# convcommit --add src/auth.sh --type fix --scope auth --message "fix null pointer" --push
33+
# Stage multiple files:
34+
# convcommit --add src/auth.sh --add tests/auth_test.sh -t test -s auth -m "add tests" -p
35+
#
36+
# HOW TO USE (pipe / non-interactive)
37+
# Pipe selections as lines: one per stage (type, scope, message).
38+
# Use the letter shown in the menu, or "." to trigger free-text input.
39+
# Examples:
40+
# printf "G\n.\nfix null pointer in login\n" | convcommit
41+
# printf "F\n\nadd endpoint\n" | convcommit -a -p
42+
# Capture just the formatted message:
43+
# msg=$(printf "G\n\nfix null pointer\n" | convcommit)
44+
#
45+
# OTHER USEFUL FLAGS
46+
# --reset Regenerate this file with the latest defaults
47+
# --help Show all options
48+
#
49+
# INSTALLATION
50+
# convcommit is a single bash file with no dependencies.
51+
# Install it locally in your project:
52+
# curl -fsSL https://raw.githubusercontent.com/francescobianco/convcommit/refs/heads/main/bin/convcommit \
53+
# -o bin/convcommit && chmod +x bin/convcommit
54+
# Or system-wide:
55+
# curl -fsSL https://raw.githubusercontent.com/francescobianco/convcommit/refs/heads/main/bin/convcommit \
56+
# -o /usr/local/bin/convcommit && chmod +x /usr/local/bin/convcommit
57+
type:[B]build
58+
type:~chore
59+
type:[D]docs
60+
type:deps
61+
type:feat
62+
type:fix
63+
type:ci
64+
type:init
65+
type:merge
66+
type:perf
67+
type:refactor
68+
type:revert
69+
type:security
70+
type:style
71+
type:test
72+
type:[W]wip
73+
scope:_
74+
scope:~
75+
message:_
76+
message:~_

CHANGELOG.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- Renamed CLI service commands and scope aliases to use the official Openapi console slugs from `oas/00-list.txt`.
13+
- Replaced legacy aliases such as `token`, `sms`, `cadastre`, `certified-email`, `chamber-of-commerce`, `exchange-rate`, `massive-rem`, `paying-bills`, `postal-service`, `real-estate`, `time-stamping`, and `zip-codes` with `oauth`, `smsv2`, `catasto`, `pec`, `visurecamerali`, `exchange`, `pecmassiva`, `bollettini`, `ufficiopostale`, `realestate`, `marchetemporali`, and `cap`.
14+
15+
### Added
16+
17+
- Added `oauthv2` as a separate command for the new OAuth v2 API on `oauth.openapi.com`, alongside the existing `oauth` command on `oauth.openapi.it`.
18+
1019
---
1120

1221
## [0.1.1] - 2026-04-02
@@ -16,7 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1625
- **Scope alias `all`** — passing `--scopes all` when creating a token now expands to every available scope returned by the API. The keyword is case-insensitive (`ALL`, `All`, etc. are all valid).
1726

1827
```bash
19-
openapi token create --scopes all
28+
openapi oauth create --scopes all
2029
```
2130

2231
- Global `--who` easter egg powered by the external `billy-ray` crate.
@@ -35,7 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3544
- First public release of the Openapi CLI
3645
- Token management: `create`, `list`, `revoke`, `scopes`, `credit`
3746
- Scope aliases — use short service names instead of full scope strings when creating tokens
38-
- Method filtering for scope aliases (`post:sms`, `get:company`, …)
47+
- Method filtering for scope aliases (`post:smsv2`, `get:company`, …)
3948
- Sandbox mode via `-S` / `--sandbox` flag
40-
- Service commands: `ai`, `automotive`, `cadastre`, `certified-email`, `chamber-of-commerce`, `company`, `docuengine`, `domains`, `esignature`, `exchange-rate`, `geocoding`, `invoice`, `massive-rem`, `paying-bills`, `pdf`, `postal-service`, `real-estate`, `risk`, `sdi`, `sms`, `time-stamping`, `trust`, `visengine`, `zip-codes`
49+
- Service commands: `ai`, `automotive`, `bollettini`, `cap`, `catasto`, `company`, `docuengine`, `domains`, `esignature`, `exchange`, `geocoding`, `invoice`, `marchetemporali`, `oauth`, `pec`, `pecmassiva`, `pdf`, `realestate`, `risk`, `sdi`, `smsv2`, `trust`, `ufficiopostale`, `visengine`, `visurecamerali`
4150
- `info` command to verify environment variables and token scopes

README.md

Lines changed: 53 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
## Overview
1818

1919
A command-line client for the APIs available at [Openapi®](https://openapi.com).
20-
It provides direct terminal access to the Openapi® Marketplace, including token management, scope aliases, and sandbox support.
20+
It provides direct terminal access to the Openapi® Marketplace, including OAuth and OAuth v2 token management, scope aliases, and sandbox support.
2121
With this CLI you can quickly interact with hundreds of certified APIs and accelerate your digital transformation projects.
2222

2323
## Pre-requisites
@@ -76,7 +76,7 @@ The CLI uses two sets of environment variables depending on the type of command.
7676

7777
### OAuth credentials (for token management)
7878

79-
Used by `openapi token` commands. These are your Openapi.it account credentials (Basic auth).
79+
Used by `openapi oauth` and `openapi oauthv2` commands. These are your Openapi account credentials (Basic auth).
8080

8181
```bash
8282
export OPENAPI_USERNAME="your-username"
@@ -86,7 +86,7 @@ export OPENAPI_SANDBOX_KEY="your-sandbox-key" # optional
8686

8787
### Bearer tokens (for service API commands)
8888

89-
Used by all service commands (`sms`, `company`, `risk`, etc.). These are tokens generated via `openapi token create`.
89+
Used by all service commands (`smsv2`, `company`, `risk`, etc.). These are tokens generated via `openapi oauth create` or `openapi oauthv2 tokens create`.
9090

9191
```bash
9292
export OPENAPI_TOKEN="your-bearer-token"
@@ -106,32 +106,38 @@ This shows all 5 environment variables, their status, and the scopes attached to
106106
Use the `-S` (or `--sandbox`) flag to run against sandbox environments:
107107

108108
```bash
109-
openapi -S sms send --to "+391234567890" --message "Test"
110-
openapi -S token list
109+
openapi -S smsv2 send --to "+391234567890" --message "Test"
110+
openapi -S oauth list
111111
```
112112

113113
## Token management
114114

115115
```bash
116116
# List active tokens
117-
openapi token list
117+
openapi oauth list
118118

119119
# List all available scopes
120-
openapi token scopes
120+
openapi oauth scopes
121121

122122
# Create a new token
123-
openapi token create --scopes "sms"
123+
openapi oauth create --scopes "smsv2"
124124

125125
# Check credit
126-
openapi token credit
126+
openapi oauth credit
127127

128128
# Revoke a token
129-
openapi token revoke --token "token-id"
129+
openapi oauth revoke --token "token-id"
130+
131+
# OAuth v2 token creation
132+
openapi oauthv2 tokens create --scopes "smsv2"
133+
134+
# OAuth v2 scopes
135+
openapi oauthv2 scopes list
130136
```
131137

132138
## Scope aliases
133139

134-
When creating tokens with `openapi token create --scopes`, you can use **scope aliases** instead of writing full scope strings.
140+
When creating tokens with `openapi oauth create --scopes`, you can use **scope aliases** instead of writing full scope strings.
135141

136142
### How it works
137143

@@ -142,41 +148,42 @@ Each API service is mapped to an alias name. When you use an alias, it automatic
142148
| `all` | **All services** _(special keyword)_ ||
143149
| `ai` | AI language models | ai.openapi.com |
144150
| `automotive` | Automotive data | automotive.openapi.com |
145-
| `cadastre` | Italian cadastral data | catasto.openapi.it |
146-
| `certified-email` | PEC / Legalmail | pec.openapi.it |
147-
| `chamber-of-commerce` | Chamber of Commerce | visurecamerali.openapi.it |
151+
| `bollettini` | Bills payment | ws.pagasubito.it |
152+
| `cap` | Zip codes and municipalities | cap.openapi.it |
153+
| `catasto` | Italian cadastral data | catasto.openapi.it |
148154
| `company` | Company data | company.openapi.com |
149155
| `docuengine` | Official documents | docuengine.openapi.com |
150156
| `domains` | .it domain management | domains.altravia.com |
151157
| `esignature` | Electronic signature | esignature.openapi.com |
152-
| `exchange-rate` | Currency exchange rates | exchange.altravia.com |
158+
| `exchange` | Currency exchange rates | exchange.altravia.com |
153159
| `geocoding` | Geocoding | geocoding.openapi.it |
154160
| `invoice` | Electronic invoicing | invoice.openapi.com |
155-
| `massive-rem` | Massive REM | ws.pecmassiva.com |
156-
| `paying-bills` | Bills payment | ws.pagasubito.it |
161+
| `marchetemporali` | Time stamping | ws.marchetemporali.com |
162+
| `oauth` | OAuth token management | oauth.openapi.it |
163+
| `oauthv2` | OAuth v2 token management | oauth.openapi.com |
164+
| `pec` | PEC / Legalmail | pec.openapi.it |
165+
| `pecmassiva` | Massive REM | ws.pecmassiva.com |
157166
| `pdf` | HTML to PDF | pdf.openapi.it |
158-
| `postal-service` | Postal mail | ws.ufficiopostale.com |
159-
| `real-estate` | Real estate valuation | realestate.openapi.com |
167+
| `realestate` | Real estate valuation | realestate.openapi.com |
160168
| `risk` | Risk reports and scoring | risk.openapi.com |
161169
| `sdi` | SDI electronic invoicing | sdi.openapi.it |
162-
| `sms` | SMS messaging | sms.openapi.com |
163-
| `time-stamping` | Time stamping | ws.marchetemporali.com |
164-
| `token` | OAuth token management | oauth.openapi.it |
170+
| `smsv2` | SMS messaging | sms.openapi.com |
165171
| `trust` | Trust verification | trust.openapi.com |
172+
| `ufficiopostale` | Postal mail | ws.ufficiopostale.com |
166173
| `visengine` | Official documents | visengine2.altravia.com |
167-
| `zip-codes` | Zip codes and municipalities | cap.openapi.it |
174+
| `visurecamerali` | Chamber of Commerce | visurecamerali.openapi.it |
168175

169176
### Examples
170177

171178
```bash
172179
# All SMS scopes
173-
openapi token create --scopes "sms"
180+
openapi oauth create --scopes "smsv2"
174181

175182
# Multiple services
176-
openapi token create --scopes "sms,company"
183+
openapi oauth create --scopes "smsv2,company"
177184

178185
# All available scopes (special keyword)
179-
openapi token create --scopes "all"
186+
openapi oauth create --scopes "all"
180187
```
181188

182189
### Method filtering
@@ -185,13 +192,13 @@ Prefix an alias with an HTTP method to include only scopes for that method:
185192

186193
```bash
187194
# Only POST scopes for SMS
188-
openapi token create --scopes "post:sms"
195+
openapi oauth create --scopes "post:smsv2"
189196

190197
# Only GET scopes for company
191-
openapi token create --scopes "get:company"
198+
openapi oauth create --scopes "get:company"
192199

193200
# Mix methods and full aliases
194-
openapi token create --scopes "post:sms,get:company,geocoding"
201+
openapi oauth create --scopes "post:smsv2,get:company,geocoding"
195202
```
196203

197204
Supported method prefixes: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`.
@@ -201,9 +208,9 @@ Supported method prefixes: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`.
201208
Aliases and method prefixes are case insensitive:
202209

203210
```bash
204-
openapi token create --scopes "SMS"
205-
openapi token create --scopes "Post:Sms"
206-
openapi token create --scopes "POST:SMS"
211+
openapi oauth create --scopes "SMSV2"
212+
openapi oauth create --scopes "Post:SmsV2"
213+
openapi oauth create --scopes "POST:SMSV2"
207214
```
208215

209216
All of the above are equivalent.
@@ -213,39 +220,40 @@ All of the above are equivalent.
213220
If a term does not match any alias, it is passed through as a literal scope:
214221

215222
```bash
216-
openapi token create --scopes "sms,GET:imprese.openapi.it/base"
223+
openapi oauth create --scopes "smsv2,GET:imprese.openapi.it/base"
217224
```
218225

219226
## Available commands
220227

221228
| Command | Description |
222229
|---|---|
223230
| `info` | Show configuration status and readiness |
224-
| `token` | OAuth token management |
231+
| `oauth` | OAuth token management |
225232
| `ai` | AI language models |
226233
| `automotive` | Automotive data (vehicles, insurance) |
227-
| `cadastre` | Italian cadastral data |
228-
| `certified-email` | Italian certified email (PEC / Legalmail) |
229-
| `chamber-of-commerce` | Chamber of Commerce documents |
234+
| `bollettini` | Bills payment |
235+
| `cap` | Zip codes, municipalities, provinces, regions |
236+
| `catasto` | Italian cadastral data |
230237
| `company` | Company data and information |
231238
| `docuengine` | Official documents (Business Register, Revenue Agency, INPS) |
232239
| `domains` | .it domain management |
233240
| `esignature` | Electronic signature |
234-
| `exchange-rate` | Foreign currency exchange rates |
241+
| `exchange` | Foreign currency exchange rates |
235242
| `geocoding` | Geocoding and reverse geocoding |
236243
| `invoice` | Electronic invoicing |
237-
| `massive-rem` | Massive Registered Electronic Mail |
238-
| `paying-bills` | Bills payment |
244+
| `marchetemporali` | Document time stamping |
245+
| `pec` | Italian certified email (PEC / Legalmail) |
246+
| `pecmassiva` | Massive Registered Electronic Mail |
239247
| `pdf` | HTML to PDF conversion |
240-
| `postal-service` | Postal mail service |
241-
| `real-estate` | Real estate valuation data |
248+
| `realestate` | Real estate valuation data |
242249
| `risk` | Risk reports and scoring |
243250
| `sdi` | SDI electronic invoicing |
244-
| `sms` | SMS messaging (v2) |
245-
| `time-stamping` | Document time stamping |
251+
| `smsv2` | SMS messaging (v2) |
252+
| `oauthv2` | OAuth v2 token management and analytics |
246253
| `trust` | Trust verification services |
254+
| `ufficiopostale` | Postal mail service |
247255
| `visengine` | Official documents (Chamber of Commerce, INPS, Tax Agency) |
248-
| `zip-codes` | Zip codes, municipalities, provinces, regions |
256+
| `visurecamerali` | Chamber of Commerce documents |
249257

250258
Run `openapi --help` for the full list, or `openapi <command> --help` for subcommand details.
251259

0 commit comments

Comments
 (0)