@@ -55,7 +55,14 @@ export function registerOAuthClientsCommand(parent: Command): void {
5555 // oauth-clients create
5656 const create = oauthClients
5757 . command ( "create [json]" )
58- . description ( "Create a new OAuth client" )
58+ . description (
59+ "Create a new OAuth client\n\n" +
60+ "JSON payload example:\n" +
61+ " {\n" +
62+ ' "clientName": "my-app",\n' +
63+ ' "allowedScopes": ["read:entities", "write:entities"]\n' +
64+ " }" ,
65+ )
5966 . action (
6067 withErrorHandler ( async ( json : unknown , _opts : unknown , cmd : Command ) => {
6168 const body = await parseJsonInput ( json as string | undefined ) ;
@@ -71,15 +78,27 @@ export function registerOAuthClientsCommand(parent: Command): void {
7178
7279 addExamples ( create , [
7380 {
74- description : "Create an OAuth client from a JSON file" ,
81+ description : "Create with inline JSON" ,
82+ command : `geonic admin oauth-clients create '{"clientName":"my-app","allowedScopes":["read:entities","write:entities"]}'` ,
83+ } ,
84+ {
85+ description : "Create from a JSON file" ,
7586 command : "geonic admin oauth-clients create @client.json" ,
7687 } ,
88+ {
89+ description : "Create from stdin pipe" ,
90+ command : "cat client.json | geonic admin oauth-clients create" ,
91+ } ,
7792 ] ) ;
7893
7994 // oauth-clients update
8095 const update = oauthClients
8196 . command ( "update <id> [json]" )
82- . description ( "Update an OAuth client" )
97+ . description (
98+ "Update an OAuth client\n\n" +
99+ "JSON payload: only specified fields are updated.\n" +
100+ ' e.g. {"description": "Updated client"}' ,
101+ )
83102 . action (
84103 withErrorHandler (
85104 async ( id : unknown , json : unknown , _opts : unknown , cmd : Command ) => {
@@ -99,9 +118,17 @@ export function registerOAuthClientsCommand(parent: Command): void {
99118
100119 addExamples ( update , [
101120 {
102- description : "Update an OAuth client from a JSON file" ,
121+ description : "Update description" ,
122+ command : `geonic admin oauth-clients update <client-id> '{"description":"Updated client"}'` ,
123+ } ,
124+ {
125+ description : "Update from a JSON file" ,
103126 command : "geonic admin oauth-clients update <client-id> @client.json" ,
104127 } ,
128+ {
129+ description : "Update from stdin pipe" ,
130+ command : "cat client.json | geonic admin oauth-clients update <client-id>" ,
131+ } ,
105132 ] ) ;
106133
107134 // oauth-clients delete
@@ -155,7 +182,14 @@ export function registerCaddeCommand(parent: Command): void {
155182 // cadde set
156183 const caddeSet = cadde
157184 . command ( "set [json]" )
158- . description ( "Set CADDE configuration" )
185+ . description (
186+ "Set CADDE configuration\n\n" +
187+ "JSON payload example:\n" +
188+ " {\n" +
189+ ' "provider": "my-provider",\n' +
190+ ' "endpoint": "http://localhost:6000"\n' +
191+ " }" ,
192+ )
159193 . action (
160194 withErrorHandler ( async ( json : unknown , _opts : unknown , cmd : Command ) => {
161195 const body = await parseJsonInput ( json as string | undefined ) ;
@@ -171,9 +205,17 @@ export function registerCaddeCommand(parent: Command): void {
171205
172206 addExamples ( caddeSet , [
173207 {
174- description : "Set CADDE configuration from a JSON file" ,
208+ description : "Set with inline JSON" ,
209+ command : `geonic admin cadde set '{"provider":"my-provider","endpoint":"http://localhost:6000"}'` ,
210+ } ,
211+ {
212+ description : "Set from a JSON file" ,
175213 command : "geonic admin cadde set @cadde-config.json" ,
176214 } ,
215+ {
216+ description : "Set from stdin pipe" ,
217+ command : "cat cadde-config.json | geonic admin cadde set" ,
218+ } ,
177219 ] ) ;
178220
179221 // cadde delete
0 commit comments