Skip to content

Commit b38299c

Browse files
authored
Merge pull request #96 from geolonia/feat/improve-help-content
docs: 全コマンドの help content を充実
2 parents 53ab96f + d06bf03 commit b38299c

25 files changed

Lines changed: 427 additions & 132 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
## [Unreleased]
99

1010
### 2026-04-03
11+
- **Docs**: 全コマンドの help 内容を充実 — description の具体化、examples の追加(テーブル形式、プロフィルスコープ、ユースケース別の例)、24 ファイル改善 (#96)
1112
- **Feat**: マルチテナント対応 — ログイン時のテナント名指定 (`-s <テナント名>`)、`tenantId` / `availableTenants` の config 保存、`profile use` 時のトークン自動リフレッシュ (#90)
1213
- **Feat**: `geonic cli update` コマンドを追加 — `npm update -g` のエイリアスとして CLI を最新版に更新可能に (#94)
1314
- **Fix**: 複数ターミナルで同一プロファイルを使用時、refresh token rotation によりセッションが無効化される問題を修正 — トークンリフレッシュ前に config を再読み込みし、別プロセスが既にリフレッシュ済みならそのトークンを使用する (#93)

src/commands/admin/api-keys.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export function registerApiKeysCommand(parent: Command): void {
107107
// api-keys list
108108
const list = apiKeys
109109
.command("list")
110-
.description("List all API keys")
110+
.description("List all API keys, showing name, tenant, policy, and status (key values are masked)")
111111
.option("--tenant-id <id>", "Filter by tenant ID")
112112
.action(
113113
withErrorHandler(async (_opts: unknown, cmd: Command) => {
@@ -130,6 +130,10 @@ export function registerApiKeysCommand(parent: Command): void {
130130
description: "List all API keys",
131131
command: "geonic admin api-keys list",
132132
},
133+
{
134+
description: "List API keys in table format",
135+
command: "geonic admin api-keys list --format table",
136+
},
133137
{
134138
description: "List API keys for a specific tenant",
135139
command: "geonic admin api-keys list --tenant-id <tenant-id>",
@@ -139,7 +143,7 @@ export function registerApiKeysCommand(parent: Command): void {
139143
// api-keys get
140144
const get = apiKeys
141145
.command("get <keyId>")
142-
.description("Get an API key by ID")
146+
.description("Get an API key's metadata — name, policy, allowed origins, and rate limit (key value is masked)")
143147
.action(
144148
withErrorHandler(async (keyId: unknown, _opts: unknown, cmd: Command) => {
145149
const client = createClient(cmd);
@@ -155,7 +159,7 @@ export function registerApiKeysCommand(parent: Command): void {
155159

156160
addExamples(get, [
157161
{
158-
description: "Get an API key by ID",
162+
description: "Inspect an API key's configuration",
159163
command: "geonic admin api-keys get <key-id>",
160164
},
161165
]);
@@ -346,7 +350,7 @@ export function registerApiKeysCommand(parent: Command): void {
346350
// api-keys delete
347351
const del = apiKeys
348352
.command("delete <keyId>")
349-
.description("Delete an API key")
353+
.description("Delete an API key. Any requests using this key will be immediately rejected")
350354
.action(
351355
withErrorHandler(async (keyId: unknown, _opts: unknown, cmd: Command) => {
352356
const client = createClient(cmd);
@@ -360,7 +364,7 @@ export function registerApiKeysCommand(parent: Command): void {
360364

361365
addExamples(del, [
362366
{
363-
description: "Delete an API key",
367+
description: "Delete an API key by ID",
364368
command: "geonic admin api-keys delete <key-id>",
365369
},
366370
]);

src/commands/admin/oauth-clients.ts

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function registerOAuthClientsCommand(parent: Command): void {
1212
// oauth-clients list
1313
const list = oauthClients
1414
.command("list")
15-
.description("List all OAuth clients")
15+
.description("List all registered OAuth clients and their configurations")
1616
.action(
1717
withErrorHandler(async (_opts: unknown, cmd: Command) => {
1818
const client = createClient(cmd);
@@ -27,12 +27,16 @@ export function registerOAuthClientsCommand(parent: Command): void {
2727
description: "List all OAuth clients",
2828
command: "geonic admin oauth-clients list",
2929
},
30+
{
31+
description: "List OAuth clients in table format",
32+
command: "geonic admin oauth-clients list --format table",
33+
},
3034
]);
3135

3236
// oauth-clients get
3337
const get = oauthClients
3438
.command("get <id>")
35-
.description("Get an OAuth client by ID")
39+
.description("Get an OAuth client's details — name, client ID, policy, and redirect URIs")
3640
.action(
3741
withErrorHandler(async (id: unknown, _opts: unknown, cmd: Command) => {
3842
const client = createClient(cmd);
@@ -47,14 +51,15 @@ export function registerOAuthClientsCommand(parent: Command): void {
4751

4852
addExamples(get, [
4953
{
50-
description: "Get an OAuth client by ID",
54+
description: "Inspect an OAuth client's configuration",
5155
command: "geonic admin oauth-clients get <client-id>",
5256
},
5357
]);
5458

5559
// oauth-clients create
5660
const create = oauthClients
5761
.command("create [json]")
62+
.summary("Create a new OAuth client")
5863
.description(
5964
"Create a new OAuth client\n\n" +
6065
"JSON payload example:\n" +
@@ -94,6 +99,7 @@ export function registerOAuthClientsCommand(parent: Command): void {
9499
// oauth-clients update
95100
const update = oauthClients
96101
.command("update <id> [json]")
102+
.summary("Update an OAuth client")
97103
.description(
98104
"Update an OAuth client\n\n" +
99105
"JSON payload: only specified fields are updated.\n" +
@@ -134,7 +140,7 @@ export function registerOAuthClientsCommand(parent: Command): void {
134140
// oauth-clients delete
135141
const del = oauthClients
136142
.command("delete <id>")
137-
.description("Delete an OAuth client")
143+
.description("Delete an OAuth client. Existing tokens issued by this client will be invalidated")
138144
.action(
139145
withErrorHandler(async (id: unknown, _opts: unknown, cmd: Command) => {
140146
const client = createClient(cmd);
@@ -148,7 +154,7 @@ export function registerOAuthClientsCommand(parent: Command): void {
148154

149155
addExamples(del, [
150156
{
151-
description: "Delete an OAuth client",
157+
description: "Delete an OAuth client by ID",
152158
command: "geonic admin oauth-clients delete <client-id>",
153159
},
154160
]);
@@ -157,12 +163,12 @@ export function registerOAuthClientsCommand(parent: Command): void {
157163
export function registerCaddeCommand(parent: Command): void {
158164
const cadde = parent
159165
.command("cadde")
160-
.description("Manage CADDE configuration");
166+
.description("Manage CADDE (data exchange) configuration for cross-platform data sharing");
161167

162168
// cadde get
163169
const caddeGet = cadde
164170
.command("get")
165-
.description("Get CADDE configuration")
171+
.description("Get the current CADDE data exchange configuration (provider, endpoint, etc.)")
166172
.action(
167173
withErrorHandler(async (_opts: unknown, cmd: Command) => {
168174
const client = createClient(cmd);
@@ -174,14 +180,19 @@ export function registerCaddeCommand(parent: Command): void {
174180

175181
addExamples(caddeGet, [
176182
{
177-
description: "Get CADDE configuration",
183+
description: "View current CADDE configuration",
178184
command: "geonic admin cadde get",
179185
},
186+
{
187+
description: "View CADDE configuration in table format",
188+
command: "geonic admin cadde get --format table",
189+
},
180190
]);
181191

182192
// cadde set
183193
const caddeSet = cadde
184194
.command("set [json]")
195+
.summary("Set CADDE configuration")
185196
.description(
186197
"Set CADDE configuration\n\n" +
187198
"JSON payload example:\n" +
@@ -221,7 +232,7 @@ export function registerCaddeCommand(parent: Command): void {
221232
// cadde delete
222233
const caddeDelete = cadde
223234
.command("delete")
224-
.description("Delete CADDE configuration")
235+
.description("Remove the CADDE data exchange configuration, disabling cross-platform data sharing")
225236
.action(
226237
withErrorHandler(async (_opts: unknown, cmd: Command) => {
227238
const client = createClient(cmd);
@@ -232,7 +243,7 @@ export function registerCaddeCommand(parent: Command): void {
232243

233244
addExamples(caddeDelete, [
234245
{
235-
description: "Delete CADDE configuration",
246+
description: "Remove CADDE configuration",
236247
command: "geonic admin cadde delete",
237248
},
238249
]);

src/commands/admin/policies.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import { addExamples } from "../help.js";
77
export function registerPoliciesCommand(parent: Command): void {
88
const policies = parent
99
.command("policies")
10-
.description("Manage policies");
10+
.description("Manage XACML access control policies");
1111

1212
// policies list
1313
const list = policies
1414
.command("list")
15-
.description("List all policies")
15+
.description("List all access control policies, showing their status and priority")
1616
.action(
1717
withErrorHandler(async (_opts: unknown, cmd: Command) => {
1818
const client = createClient(cmd);
@@ -27,12 +27,16 @@ export function registerPoliciesCommand(parent: Command): void {
2727
description: "List all policies",
2828
command: "geonic admin policies list",
2929
},
30+
{
31+
description: "List policies in table format for an overview",
32+
command: "geonic admin policies list --format table",
33+
},
3034
]);
3135

3236
// policies get
3337
const get = policies
3438
.command("get <id>")
35-
.description("Get a policy by ID")
39+
.description("Get a policy's full details — target rules, effect, priority, and status")
3640
.action(
3741
withErrorHandler(async (id: unknown, _opts: unknown, cmd: Command) => {
3842
const client = createClient(cmd);
@@ -47,14 +51,15 @@ export function registerPoliciesCommand(parent: Command): void {
4751

4852
addExamples(get, [
4953
{
50-
description: "Get a policy by ID",
54+
description: "Inspect a policy's rules and target configuration",
5155
command: "geonic admin policies get <policy-id>",
5256
},
5357
]);
5458

5559
// policies create
5660
const create = policies
5761
.command("create [json]")
62+
.summary("Create a new policy")
5863
.description(
5964
"Create a new policy\n\n" +
6065
"JSON payload examples:\n\n" +
@@ -127,6 +132,7 @@ export function registerPoliciesCommand(parent: Command): void {
127132
// policies update
128133
const update = policies
129134
.command("update <id> [json]")
135+
.summary("Update a policy")
130136
.description(
131137
"Update a policy\n\n" +
132138
"JSON payload: only specified fields are updated.\n" +
@@ -167,7 +173,7 @@ export function registerPoliciesCommand(parent: Command): void {
167173
// policies delete
168174
const del = policies
169175
.command("delete <id>")
170-
.description("Delete a policy")
176+
.description("Delete a policy. Users or API keys referencing this policy will lose the access it granted")
171177
.action(
172178
withErrorHandler(async (id: unknown, _opts: unknown, cmd: Command) => {
173179
const client = createClient(cmd);
@@ -181,15 +187,15 @@ export function registerPoliciesCommand(parent: Command): void {
181187

182188
addExamples(del, [
183189
{
184-
description: "Delete a policy",
190+
description: "Delete a policy by ID",
185191
command: "geonic admin policies delete <policy-id>",
186192
},
187193
]);
188194

189195
// policies activate
190196
const activate = policies
191197
.command("activate <id>")
192-
.description("Activate a policy")
198+
.description("Activate a policy so its access control rules are enforced")
193199
.action(
194200
withErrorHandler(async (id: unknown, _opts: unknown, cmd: Command) => {
195201
const client = createClient(cmd);
@@ -203,15 +209,15 @@ export function registerPoliciesCommand(parent: Command): void {
203209

204210
addExamples(activate, [
205211
{
206-
description: "Activate a policy",
212+
description: "Enable a policy to start enforcing its rules",
207213
command: "geonic admin policies activate <policy-id>",
208214
},
209215
]);
210216

211217
// policies deactivate
212218
const deactivate = policies
213219
.command("deactivate <id>")
214-
.description("Deactivate a policy")
220+
.description("Deactivate a policy, suspending its rules without deleting it")
215221
.action(
216222
withErrorHandler(async (id: unknown, _opts: unknown, cmd: Command) => {
217223
const client = createClient(cmd);
@@ -225,7 +231,7 @@ export function registerPoliciesCommand(parent: Command): void {
225231

226232
addExamples(deactivate, [
227233
{
228-
description: "Deactivate a policy",
234+
description: "Temporarily disable a policy without deleting it",
229235
command: "geonic admin policies deactivate <policy-id>",
230236
},
231237
]);

0 commit comments

Comments
 (0)