Skip to content

[TASK] Refactor tools enabling command #19

Closed

Description

@edenreich

Summary

When you want to enable tool calls we should use the config namespace.

infer config tools <enable|disable>

instead of:

infer tools enable

Also when generating a new config we should use:

infer config init

Instead of:

infer init

This makes the command clearer in what it does - only mutate the config and creating a new config.

Let's also make the tools enabled by default but we only allow Read operation (non-armful commands)

Acceptance Criteria

  • The commands are adjusted as explained above
  • The tools are enabled by default (when running infer config init)
  • The documentation is up to date

Activity

  1. added theissue type on Aug 12, 2025
  2. edenreich commented on Aug 12, 2025

    @edenreich
    ContributorAuthor

    @claude Can you refactor this?

  3. claude commented on Aug 12, 2025

    @claude
    Contributor

    Claude finished @edenreich's task —— View job • claude/issue-19-20250812-2035 • Create PR ➔


    Refactoring Tools Command Structure ✅

    I've successfully refactored the CLI commands as requested to improve the command structure and enable tools by default with safe read-only operations.

    Todo List

    • Analyze current command structure
    • Set up development environment
    • Refactor infer tools enable to infer config tools <enable|disable>
    • Refactor infer init to infer config init
    • Update default configuration to enable tools with read-only operations
    • Update documentation in CLAUDE.md
    • Test the changes
    • Commit changes and create PR

    ✅ Completed Successfully

    Changes Made:

    • ✅ Command Restructuring: Moved infer tools commands to infer config tools namespace
    • ✅ Init Command: Moved infer init to infer config init
    • ✅ Default Tools: Enabled tools by default with safe read-only commands (ls, pwd, echo, cat, head, tail, grep, find, wc, sort, uniq)
    • ✅ Safety: Maintained safety approval requirement by default
    • ✅ Documentation: Updated CLAUDE.md with new command structure and usage examples

    New Command Structure:

    # Configuration management
    infer config init [--overwrite]         # Initialize project configuration  
    infer config set-model [MODEL_NAME]     # Set default model
    
    # Tools management
    infer config tools enable               # Enable tool execution
    infer config tools disable              # Disable tool execution
    infer config tools list [--format]      # List whitelisted commands
    infer config tools validate <command>   # Validate command
    infer config tools exec <command>       # Execute command
    infer config tools safety enable        # Enable safety prompts
    infer config tools safety disable       # Disable safety prompts
    infer config tools safety status        # Show safety status

    Verified:

    • ✅ All commands work correctly in new structure
    • ✅ Tools enabled by default with safe commands only
    • ✅ Safety approval remains enabled by default
    • ✅ All tests and quality checks pass
    • ✅ Documentation updated with examples

  4. added
    refactor
    on Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactor

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions