Skip to content

CLI & Config changes to support disabling core tools#35

Merged
ezynda3 merged 3 commits into
mark3labs:masterfrom
kskarthik:no-core-tools
May 29, 2026
Merged

CLI & Config changes to support disabling core tools#35
ezynda3 merged 3 commits into
mark3labs:masterfrom
kskarthik:no-core-tools

Conversation

@kskarthik

@kskarthik kskarthik commented May 27, 2026

Copy link
Copy Markdown
Contributor

Allow users to disable all built-in core tools (bash, read, write,
edit, grep, find, ls, subagent) without recompiling, using a CLI flag,
environment variable, or .kit.yml config key.

Changes

cmd/root.go

  • Declare noCoreToolsFlag bool alongside noExtensionsFlag.
  • Register --no-core-tools persistent flag with a descriptive help string
    listing the affected tools.
  • Bind the flag to viper key "no-core-tools" so the config file and
    KIT_NO_CORE_TOOLS env var also work (viper's standard precedence:
    CLI flag > env var > config file > default).
  • Set kitOpts.DisableCoreTools = viper.GetBool("no-core-tools") when
    assembling the Options struct in runNormalMode.

pkg/kit/kit.go

  • Add disableCoreTools local variable inside the viperInitMu-protected
    snapshot block, mirroring the noExtensions pattern exactly.
  • Resolve it as opts.DisableCoreTools || viper.GetBool("no-core-tools")
    so the SDK option and the viper key are both respected (OR semantics:
    either source can enable the flag).
  • Pass the resolved disableCoreTools into kitsetup.AgentSetupOptions
    instead of the raw opts.DisableCoreTools, completing the chain.

Usage

CLI flag

kit --no-core-tools

Environment variable

KIT_NO_CORE_TOOLS=true kit

.kit.yml config file

no-core-tools: true

SDK (unchanged, was already supported)

kit.New(ctx, &kit.Options{DisableCoreTools: true})

The downstream path (kitsetup → agent.AgentConfig.DisableCoreTools →
agent.NewAgent nil-tool branch) was already in place and required no
changes.

Summary by CodeRabbit

  • New Features

    • Added --no-core-tools CLI flag (also configurable via KIT_NO_CORE_TOOLS env var or .kit.yml) to control built-in core tools.
  • Documentation

    • Updated README and SDK docs to document the --no-core-tools flag, env var, and configuration key; updated example YAML and CLI flag docs.

Review Change Stack

kskarthik added 2 commits May 27, 2026 19:57
Allow users to disable all built-in core tools (bash, read, write,
edit, grep, find, ls, subagent) without recompiling, using a CLI flag,
environment variable, or .kit.yml config key.

Changes
-------
cmd/root.go
  - Declare noCoreToolsFlag bool alongside noExtensionsFlag.
  - Register --no-core-tools persistent flag with a descriptive help string
    listing the affected tools.
  - Bind the flag to viper key "no-core-tools" so the config file and
    KIT_NO_CORE_TOOLS env var also work (viper's standard precedence:
    CLI flag > env var > config file > default).
  - Set kitOpts.DisableCoreTools = viper.GetBool("no-core-tools") when
    assembling the Options struct in runNormalMode.

pkg/kit/kit.go
  - Add disableCoreTools local variable inside the viperInitMu-protected
    snapshot block, mirroring the noExtensions pattern exactly.
  - Resolve it as opts.DisableCoreTools || viper.GetBool("no-core-tools")
    so the SDK option and the viper key are both respected (OR semantics:
    either source can enable the flag).
  - Pass the resolved disableCoreTools into kitsetup.AgentSetupOptions
    instead of the raw opts.DisableCoreTools, completing the chain.

Usage
-----
  # CLI flag
  kit --no-core-tools

  # Environment variable
  KIT_NO_CORE_TOOLS=true kit

  # .kit.yml config file
  no-core-tools: true

  # SDK (unchanged, was already supported)
  kit.New(ctx, &kit.Options{DisableCoreTools: true})

The downstream path (kitsetup → agent.AgentConfig.DisableCoreTools →
agent.NewAgent nil-tool branch) was already in place and required no
changes.
Update three locations in README.md to reflect the new no-core-tools
control surface introduced in the previous commit:

CLI Reference → Global Flags
  Add --no-core-tools under the Extensions and tools section alongside
  --no-extensions, with a description listing the affected tools.

Configuration → Basic Configuration
  Add no-core-tools: false to the example .kit.yml block so users know
  it is a valid config file key (equivalent to the CLI flag and env var).

Go SDK → With Options
  Expand the DisableCoreTools comment to note that the same behaviour is
  also available via --no-core-tools, KIT_NO_CORE_TOOLS, and
  no-core-tools: true in .kit.yml, making the cross-surface relationship
  explicit for SDK consumers.
@mark-iii-labs-huly

Copy link
Copy Markdown

Connected to Huly®: KIT-36

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dbaae7de-8fe1-4d9e-b127-9842ffacff45

📥 Commits

Reviewing files that changed from the base of the PR and between 5d8714c and 3d81cf9.

📒 Files selected for processing (1)
  • cmd/root.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • cmd/root.go

📝 Walkthrough

Walkthrough

Adds a persistent --no-core-tools CLI flag, binds it into viper, surfaces the viper value into the SDK options (merged with programmatic options), and documents the flag/config/env control paths in the README.

Changes

no-core-tools capability

Layer / File(s) Summary
CLI flag registration and viper binding
cmd/root.go
Defines noCoreToolsFlag variable, registers it as a persistent flag, binds it into viper, and reads the value to set kitOpts.DisableCoreTools during normal mode execution.
SDK viper-to-options merge
pkg/kit/kit.go
New() snapshots the viper no-core-tools value and merges it with Options.DisableCoreTools using OR logic, passing the result to agent setup so both option sources control behavior consistently.
Documentation of no-core-tools across configs and APIs
README.md
Basic Configuration YAML example documents no-core-tools setting, CLI flags reference adds --no-core-tools flag, and SDK option comment lists all three control paths: CLI flag, environment variable, and config key.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A little flag hops into the tree,
Whispering "no-core-tools" to you and me,
Viper listens, options align,
Core tools quiet — the CLI's design,
I nibble docs and dance — all's tidy and fine.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly reflects the primary change: adding CLI and configuration support for disabling core tools, which is the main focus across all three modified files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmd/root.go`:
- Line 333: The call to viper.BindPFlag that binds "no-core-tools" currently
discards its returned error; update the init code so the error from
viper.BindPFlag(rootCmd.PersistentFlags().Lookup("no-core-tools")) is checked,
and if non-nil return or handle it by wrapping with fmt.Errorf("bind
no-core-tools flag: %w", err) (or log and exit as appropriate for init),
ensuring the binding failure is not silently ignored.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: c0207512-3f05-4163-93d0-0891cbd1857c

📥 Commits

Reviewing files that changed from the base of the PR and between d7c4565 and 5d8714c.

📒 Files selected for processing (3)
  • README.md
  • cmd/root.go
  • pkg/kit/kit.go

Comment thread cmd/root.go
@kskarthik

Copy link
Copy Markdown
Contributor Author

Tested it locally & it works as expected 🎉

@ezynda3

ezynda3 commented May 29, 2026

Copy link
Copy Markdown
Contributor

@kskarthik thanks for the PR. Could you fix the linting issues?

@kskarthik

Copy link
Copy Markdown
Contributor Author

@ezynda3 Done!

@ezynda3 ezynda3 merged commit 1e12102 into mark3labs:master May 29, 2026
3 checks passed
@kskarthik kskarthik deleted the no-core-tools branch May 30, 2026 10:19
@coderabbitai coderabbitai Bot mentioned this pull request Jun 10, 2026
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.

2 participants