Skip to content

Add config command to view current settings#140

Merged
404-Page-Found merged 1 commit into
404-PF:mainfrom
Peter7896:peter7896/config-command
Jun 19, 2026
Merged

Add config command to view current settings#140
404-Page-Found merged 1 commit into
404-PF:mainfrom
Peter7896:peter7896/config-command

Conversation

@Peter7896

@Peter7896 Peter7896 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Closes #55

Summary

  • add commit-echo config to display provider, model, endpoint, history size, and a masked API key
  • resolve built-in provider endpoints when the saved config does not store a base URL
  • cover missing config, masked key output, custom endpoint output, and omitted API keys with CLI tests

Testing

  • npm.cmd run build
  • node --test tests/config-command.test.mjs
  • npx.cmd prettier --check src\commands\config.ts src\index.ts tests\config-command.test.mjs
  • git diff --check
  • npm.cmd test

Summary by CodeRabbit

  • New Features

    • Added commit-echo config CLI command to display current configuration settings, including provider, model, endpoint, and history size.
    • API keys are automatically masked to protect sensitive information.
  • Tests

    • Added comprehensive test suite for the config command covering scenarios including missing configuration and API key masking verification.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3f79f1dd-1a51-4c62-8420-a91d31fde7f1

📥 Commits

Reviewing files that changed from the base of the PR and between 224500b and 082b4b1.

📒 Files selected for processing (3)
  • src/commands/config.ts
  • src/index.ts
  • tests/config-command.test.mjs
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (2)
src/index.ts

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript for CLI entry point implementation in src/index.ts

Files:

  • src/index.ts
src/commands/**/*

📄 CodeRabbit inference engine (AGENTS.md)

Organize command implementations in src/commands/ directory

Files:

  • src/commands/config.ts
🔇 Additional comments (3)
src/commands/config.ts (1)

1-54: LGTM!

src/index.ts (1)

11-11: LGTM!

Also applies to: 41-42, 66-67, 83-83

tests/config-command.test.mjs (1)

1-124: LGTM!


📝 Walkthrough

Walkthrough

Adds a commit-echo config CLI subcommand in src/commands/config.ts that reads stored configuration and prints provider, model, endpoint, history size, and a masked API key. The command is wired into src/index.ts and covered by a four-case integration test suite in tests/config-command.test.mjs.

Changes

commit-echo config command

Layer / File(s) Summary
configCommand implementation and helpers
src/commands/config.ts
Implements maskApiKey utility that masks API keys or returns "not stored in config", provider display and endpoint resolution helpers, and the configCommand async function that loads config, prints styled fields via picocolors, and returns early with an outro when no config exists.
CLI registration and help text
src/index.ts
Imports configCommand, adds commit-echo config to help examples text, registers the config subcommand on the program instance, and reformats the autoCommit boolean expression in the suggest command options.
Integration test suite
tests/config-command.test.mjs
Adds platform-aware helpers for config directory resolution, isolated temp-home execution, and four test cases covering: no config present, default config display with masked key, custom baseUrl/provider display, and undefined API key messaging.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • 404-Page-Found

Poem

🐰 A config command hops into view,
Masked keys and endpoints, neat and true.
No config found? It gently says "init!"
The clack prompts chime, a perfect fit.
✨ Another command for the warren's stew!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding a config command to display current settings, which is the primary focus of the PR.
Linked Issues check ✅ Passed The implementation fully satisfies all acceptance criteria from issue #55: displays current configuration with masked API key, shows guidance when config missing, follows the command pattern, and successfully builds.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the linked issue #55: new config command implementation, CLI registration, and comprehensive tests for the feature with no extraneous modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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


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

@Peter7896 Peter7896 force-pushed the peter7896/config-command branch from a2ae549 to 0572d66 Compare June 18, 2026 09:19
@Peter7896 Peter7896 force-pushed the peter7896/config-command branch from 0572d66 to 082b4b1 Compare June 18, 2026 09:25
@404-Page-Found

Copy link
Copy Markdown
Contributor

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@404-Page-Found 404-Page-Found merged commit 16d363a into 404-PF:main Jun 19, 2026
1 check passed
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.

Add commit-echo config command to view current configuration

2 participants