Skip to main content

sonar_config_manager

Manage local Bob the Fixer configuration settings.

Description

View, validate, reset, or update the local configuration file (bobthefixer.env). Essential for troubleshooting connection issues and managing project settings.

Parameters

ParameterTypeRequiredDefaultDescription
actionstringYes-Action: view, validate, reset, update
showTokenbooleanNofalseShow token value when viewing

Actions

ActionDescription
viewDisplay current configuration
validateCheck configuration validity
resetRemove configuration file
updateRefresh/update settings

Usage

View Configuration

Show me the current SonarQube configuration

Tool call:

{
"action": "view"
}

View with Token

Show me the config including the token

Tool call:

{
"action": "view",
"showToken": true
}

Validate Settings

Is my SonarQube configuration correct?

Tool call:

{
"action": "validate"
}

Reset Configuration

Reset the SonarQube configuration

Tool call:

{
"action": "reset"
}

Response Format

View Action

CONFIGURATION DETAILS
━━━━━━━━━━━━━━━━━━━━━

📁 Config File: /Users/dev/myproject/bobthefixer.env

🔧 SETTINGS:

SONAR_HOST_URL: http://localhost:9000
SONAR_PROJECT_KEY: myproject-a1b2c3d4
SONAR_TOKEN: squ_****...**** (hidden)

📅 Created: 2024-01-10 09:15:00
📅 Modified: 2024-01-15 14:30:00

✅ Configuration file exists and is readable

View with Token

CONFIGURATION DETAILS
━━━━━━━━━━━━━━━━━━━━━

📁 Config File: /Users/dev/myproject/bobthefixer.env

🔧 SETTINGS:

SONAR_HOST_URL: http://localhost:9000
SONAR_PROJECT_KEY: myproject-a1b2c3d4
SONAR_TOKEN: squ_abc123def456789...

⚠️ Token displayed - keep this secure!

Validate Action

CONFIGURATION VALIDATION
━━━━━━━━━━━━━━━━━━━━━━━━

📁 Config File: /Users/dev/myproject/bobthefixer.env

✅ CHECKS PASSED:

✓ Config file exists
✓ SONAR_HOST_URL is set
✓ SONAR_PROJECT_KEY is set
✓ SONAR_TOKEN is set
✓ URL format is valid
✓ Connection to SonarQube successful
✓ Token has valid permissions
✓ Project exists on server

📊 VALIDATION RESULT: ALL PASSED

Your configuration is valid and ready to use.

Validation with Errors

CONFIGURATION VALIDATION
━━━━━━━━━━━━━━━━━━━━━━━━

📁 Config File: /Users/dev/myproject/bobthefixer.env

⚠️ ISSUES FOUND:

✓ Config file exists
✓ SONAR_HOST_URL is set
✓ SONAR_PROJECT_KEY is set
✗ SONAR_TOKEN is missing or empty
✓ URL format is valid
✗ Connection to SonarQube failed

❌ VALIDATION RESULT: 2 ERRORS

RECOMMENDATIONS:

1. Set SONAR_TOKEN in bobthefixer.env
Run: sonar_auto_setup to regenerate

2. Check SonarQube is running
Run: docker ps | grep sonarqube

Reset Action

CONFIGURATION RESET
━━━━━━━━━━━━━━━━━━━

📁 File Removed: /Users/dev/myproject/bobthefixer.env

✅ Configuration has been reset.

NEXT STEPS:

1. Run sonar_auto_setup to create new configuration
2. Or use sonar_link_existing_project to link manually

Note: Your SonarQube project still exists on the server.
To delete it completely, use sonar_delete_project.

Configuration File

The bobthefixer.env file contains:

# Bob the Fixer Configuration
SONAR_HOST_URL=http://localhost:9000
SONAR_PROJECT_KEY=myproject-a1b2c3d4
SONAR_TOKEN=squ_abcdef123456...

Location

  • Created in project root directory
  • One file per project
  • Should be in .gitignore

Examples

Example 1: Troubleshoot Connection

Prompt:

My scans are failing, check the configuration

Tool Call:

{
"action": "validate"
}

Example 2: Check Token

Prompt:

What token is configured? I need to verify it

Tool Call:

{
"action": "view",
"showToken": true
}

Example 3: Start Fresh

Prompt:

Reset everything and start over

Tool Call:

{
"action": "reset"
}

Troubleshooting

Missing Config File

❌ No configuration file found

Solution: Run sonar_auto_setup or sonar_link_existing_project

Invalid Token

❌ Token is invalid or expired

Solution:

  1. Check token in SonarQube UI
  2. Reset config and run sonar_auto_setup

Connection Failed

❌ Cannot connect to SonarQube

Solution:

  1. Verify SonarQube is running: docker ps
  2. Check URL is correct
  3. Run sonar_diagnose_permissions

Best Practices

  1. Keep tokens secure - Don't commit bobthefixer.env
  2. Validate before scanning - Catch issues early
  3. Reset when moving - New machine, new config
  4. One project, one config - Don't share between projects

Common Issues

"Permission denied"

Cause: File permissions issue.

Solution: Check file ownership and permissions.

"Token works but scans fail"

Cause: Token may lack specific permissions.

Solution: Run sonar_diagnose_permissions for details.