Skip to content

docs: 全コマンドの help content を充実#96

Merged
miya0001 merged 3 commits into
mainfrom
feat/improve-help-content
Apr 3, 2026
Merged

docs: 全コマンドの help content を充実#96
miya0001 merged 3 commits into
mainfrom
feat/improve-help-content

Conversation

@miya0001

@miya0001 miya0001 commented Apr 3, 2026

Copy link
Copy Markdown
Member

Summary

全コマンドの help (description / examples) を充実させた。ユーザーやテナント管理者が --help だけで操作方法を理解できるレベルに引き上げ。

改善内容

  • description の具体化: 各コマンドが何を返すか、いつ使うかを明記
  • examples の追加: --format table--profile スコープ、ユースケース別の例を網羅的に追加
  • admin コマンド: 破壊的操作(delete/deactivate)に影響範囲の注意書きを追加
  • auth/profile: auto-refresh やテナント切り替えの文脈を description に反映
  • catalog/snapshots/rules/models: 概念説明を description に組み込み

対象ファイル (24 files)

カテゴリ ファイル
Core entities, attrs, subscriptions, registrations, temporal, types
Features batch (既に充実), snapshots, rules, models, catalog
Auth/Config auth, profile, config, health, cli
User Resources me-oauth-clients, me-api-keys, me-policies
Admin tenants, users, oauth-clients, policies, api-keys

Test plan

  • npm run lint — パス
  • npm run typecheck — パス
  • npm test — 684/684 パス
  • 主要コマンドで --help 出力を目視確認

Summary by CodeRabbit

  • Documentation
    • CLIヘルプを大幅に強化:多くのコマンドで説明を具体化し、具体的な使用例(表形式出力 --format table を含む)を追加しました。
    • 操作の影響や出力項目を明確化(例:削除の恒久性や即時無効化、表示マスキング、プロファイル/テナントスコープ、状態遷移の挙動など)。

全 24 コマンドファイルの description と examples を改善:
- 各コマンドの description を具体的に(何が返るか、いつ使うか)
- thin だった get/delete/list 等に table format や profile-scoped の例を追加
- admin コマンドに破壊的操作の注意書きを追加
- auth/profile に auto-refresh やテナント切り替えの文脈を追加
- catalog/snapshots/rules/models 等の説明を大幅に充実
@coderabbitai

coderabbitai Bot commented Apr 3, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ad34e5cb-7824-4360-a4bc-260513b575ae

📥 Commits

Reviewing files that changed from the base of the PR and between a10e299 and d06bf03.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • src/commands/me-policies.ts
✅ Files skipped from review due to trivial changes (2)
  • CHANGELOG.md
  • src/commands/me-policies.ts

📝 Walkthrough

Walkthrough

このPRはCHANGELOG.mdの更新と、24件のCLIコマンド関連ファイルのhelp/description、.summary(...)、および使用例(多くに--format tableやプロファイル/具体例を追加)を文言強化したもので、機能やAPI挙動の変更はありません。

Changes

Cohort / File(s) Summary
Admin Commands
src/commands/admin/api-keys.ts, src/commands/admin/oauth-clients.ts, src/commands/admin/policies.ts, src/commands/admin/tenants.ts, src/commands/admin/users.ts
管理者向けコマンドの説明・例を拡充。キー/クライアントの表示内容や失効挙動、ポリシー効果などを明示し、--format table例や.summary(...)を追加。実装・シグネチャは不変。
User-scoped (me) Commands
src/commands/me-api-keys.ts, src/commands/me-oauth-clients.ts, src/commands/me-policies.ts
個人用APIキー・OAuthクライアント・ポリシーの説明を明確化(即時失効、資格情報無効化等)し、--format table等の例を追加。ロジック変更なし。
Entities & Attributes
src/commands/entities.ts, src/commands/attrs.ts, src/commands/temporal.ts
エンティティ/属性/テンポラル削除や取得の説明を具体化(永続削除、メタデータ、履歴データ削除)、.summary(...)と追加例を導入。API挙動は変更なし。
Models, Types & Catalog
src/commands/models.ts, src/commands/types.ts, src/commands/catalog.ts
データモデル/型/カタログの説明を強化(スキーマ・プロパティ制約・DCAT-AP等)し、--format tableなどの例を追加。機能影響なし。
Workflows: Registrations, Rules, Snapshots, Subscriptions
src/commands/registrations.ts, src/commands/rules.ts, src/commands/snapshots.ts, src/commands/subscriptions.ts
フェデレーション設定、ReactiveCoreルール、スナップショット、通知設定などの説明を詳細化。多数の使用例と.summary(...)追加。実装不変。
System, Auth, CLI, Config, Profile
src/commands/health.ts, src/commands/auth.ts, src/commands/cli.ts, src/commands/config.ts, src/commands/profile.ts
ヘルスチェック・バージョン表示、ログアウト挙動、プロファイルスコープ、CLI更新手順等の説明を明確化。追加例(プロファイル指定、--dry-run等)。処理は変更なし。
Batch & Misc.
src/commands/batch.ts
batchサブコマンドに.summary(...)を追加。その他は説明/例文の拡張。実装影響なし。
Changelog
CHANGELOG.md
Unreleased(2026-04-03)に「Docs」項目を追加し、24ファイルにわたるCLIヘルプ改善を記録。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 新しい例がぴょんと増えたよ、
--format table が道を照らす、
説明は詳しく、迷わぬ案内、
小さなウサギがコマンドを導く、
さあ森のCLIを楽しく探検しよう!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed プルリクエストのタイトルは、24ファイルにおけるヘルプコンテンツ(description/examples)の充実という主要な変更を適切に要約している。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/improve-help-content

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CHANGELOG.md`:
- Line 11: The Docs entry "全コマンドの help 内容を充実 — description の具体化、examples
の追加(テーブル形式、プロフィルスコープ、ユースケース別の例)、24 ファイル改善" is missing the PR number suffix;
update that line to append the same PR suffix used elsewhere (e.g., "(`#96`)") so
its format matches other entries in CHANGELOG.md and maintains consistency with
the date group.

In `@src/commands/me-policies.ts`:
- Line 175: me-policies コマンドの .description にある "Delete a personal policy — any
API key or OAuth client bound to it loses its access restrictions"
は誤解を招く表現なので、ポリシーが削除された結果「そのポリシーで付与されていたアクセス(権限)を失う」という意味に明確に言い換えてください;具体的には
me-policies コマンドの .description(...) の文字列を「Delete a personal policy — any API key
or OAuth client that relied on it will lose the access it
granted」や日本語なら「個人ポリシーを削除します — そのポリシーで付与されていたアクセス権を該当の API キーや OAuth
クライアントが失います」などの表現に置き換えてください。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b1658180-81f9-4f10-8cf9-1f32b74de35e

📥 Commits

Reviewing files that changed from the base of the PR and between 53ab96f and 1d1905a.

📒 Files selected for processing (24)
  • CHANGELOG.md
  • src/commands/admin/api-keys.ts
  • src/commands/admin/oauth-clients.ts
  • src/commands/admin/policies.ts
  • src/commands/admin/tenants.ts
  • src/commands/admin/users.ts
  • src/commands/attrs.ts
  • src/commands/auth.ts
  • src/commands/catalog.ts
  • src/commands/cli.ts
  • src/commands/config.ts
  • src/commands/entities.ts
  • src/commands/health.ts
  • src/commands/me-api-keys.ts
  • src/commands/me-oauth-clients.ts
  • src/commands/me-policies.ts
  • src/commands/models.ts
  • src/commands/profile.ts
  • src/commands/registrations.ts
  • src/commands/rules.ts
  • src/commands/snapshots.ts
  • src/commands/subscriptions.ts
  • src/commands/temporal.ts
  • src/commands/types.ts

Comment thread CHANGELOG.md Outdated
Comment thread src/commands/me-policies.ts Outdated
複数行の .description() を持つ 29 コマンドに .summary() を追加。
Commander の .summary() が親コマンド一覧で優先されるため、
SUBCOMMANDS セクションが1行ずつきれいに表示されるようになった。
個別コマンドの --help では引き続き詳細な description が表示される。

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
src/commands/me-policies.ts (1)

176-176: ⚠️ Potential issue | 🟡 Minor

削除影響の文言が逆方向に読めるため修正してください。

Line 176 の “loses its access restrictions” は「制限が外れる(権限が広がる)」解釈になり得ます。admin/policies 側と同様に「このポリシーで付与されていたアクセスを失う」意味へ揃えるのが安全です。

修正案
-    .description("Delete a personal policy — any API key or OAuth client bound to it loses its access restrictions")
+    .description("Delete a personal policy — any API key or OAuth client bound to it loses the access it granted")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/commands/me-policies.ts` at line 176, The description string for the
"delete personal policy" command is worded poorly and can be read as removing
restrictions instead of revoking access; update the .description(...) call in
src/commands/me-policies.ts (the builder/command where the Delete personal
policy description is set) to mirror admin/policies wording so it clearly states
that any API key or OAuth client bound to the policy will lose the access
granted by this policy (e.g., replace "loses its access restrictions" with "will
lose the access granted by this policy").
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@src/commands/me-policies.ts`:
- Line 176: The description string for the "delete personal policy" command is
worded poorly and can be read as removing restrictions instead of revoking
access; update the .description(...) call in src/commands/me-policies.ts (the
builder/command where the Delete personal policy description is set) to mirror
admin/policies wording so it clearly states that any API key or OAuth client
bound to the policy will lose the access granted by this policy (e.g., replace
"loses its access restrictions" with "will lose the access granted by this
policy").

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d4f6794d-f0be-4f26-b740-1bfac27d5b2f

📥 Commits

Reviewing files that changed from the base of the PR and between 1d1905a and a10e299.

📒 Files selected for processing (13)
  • src/commands/admin/oauth-clients.ts
  • src/commands/admin/policies.ts
  • src/commands/admin/tenants.ts
  • src/commands/admin/users.ts
  • src/commands/attrs.ts
  • src/commands/batch.ts
  • src/commands/entities.ts
  • src/commands/me-policies.ts
  • src/commands/models.ts
  • src/commands/registrations.ts
  • src/commands/rules.ts
  • src/commands/subscriptions.ts
  • src/commands/temporal.ts
✅ Files skipped from review due to trivial changes (8)
  • src/commands/batch.ts
  • src/commands/temporal.ts
  • src/commands/entities.ts
  • src/commands/attrs.ts
  • src/commands/admin/oauth-clients.ts
  • src/commands/rules.ts
  • src/commands/admin/tenants.ts
  • src/commands/registrations.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/commands/admin/policies.ts
  • src/commands/models.ts
  • src/commands/subscriptions.ts

- CHANGELOG.md: Docs エントリに (#96) サフィックス追加
- me-policies.ts: "loses its access restrictions" → "loses access granted
  by this policy" に修正(セキュリティ上の誤解を防止)
@miya0001
miya0001 merged commit b38299c into main Apr 3, 2026
7 checks passed
@miya0001
miya0001 deleted the feat/improve-help-content branch May 11, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant