Configure Peacock statusline and linting - run after plugin installation
Configure Peacock statusline and linting after plugin installation. Sets up editor detection, automatic linting preferences, and updates settings.json.
/plugin marketplace add b-open-io/claude-peacock/plugin install peacock@b-open-ioConfigure the Peacock statusline for Claude Code.
Run this after installing the plugin:
/peacock:setup
First, verify jq is installed (required for JSON manipulation):
command -v jq
If jq is not found, output:
❌ Error: jq is required but not installed
Please install jq first:
macOS: brew install jq
Ubuntu: sudo apt install jq
After installing jq, run /peacock:setup again.
And stop execution.
The statusline will auto-detect your editor, but you can override it.
Ask the user if they want to configure the editor manually:
Question 1:
Store the selected value as EDITOR_CHOICE.
Ask the user if they want automatic linting enabled:
Question 2:
Store the selected value as LINT_ENABLED.
If user selected "Yes", ask which languages:
Question 3:
Store the selected values as LINT_LANGUAGES (will be an array).
Always create the config file to store linting preferences.
Build the config file content based on user selections:
cat > ~/.claude/.peacock-config << 'EOF'
# Peacock configuration
# This file is sourced by statusline.sh and lint hooks
# Editor configuration
EDITOR_SCHEME="$EDITOR_SCHEME"
# Linting configuration
LINT_ENABLED="$LINT_ENABLED"
LINT_TYPESCRIPT="$LINT_TYPESCRIPT"
LINT_GO="$LINT_GO"
EOF
Variable values:
EDITOR_SCHEME:
LINT_ENABLED:
LINT_TYPESCRIPT:
LINT_GO:
The plugin should be installed at ~/.claude/plugins/cache/peacock/statusline.sh.
Check if this file exists:
ls ~/.claude/plugins/cache/peacock/statusline.sh
If it doesn't exist, output:
❌ Error: Peacock plugin not found
The statusline.sh file should be at:
~/.claude/plugins/cache/peacock/statusline.sh
Make sure you've installed the plugin first:
/plugin install peacock@b-open-io
And stop execution.
Copy the statusline script from the plugin directory to ~/.claude/:
cp ~/.claude/plugins/cache/peacock/statusline.sh ~/.claude/statusline.sh
chmod +x ~/.claude/statusline.sh
Note: Lint hooks are automatically installed via the plugin system - no manual setup needed!
Create or update ~/.claude/settings.json with the statusLine configuration.
If settings.json doesn't exist:
echo '{"statusLine": {"type": "command", "command": "~/.claude/statusline.sh"}}' | jq . > ~/.claude/settings.json
If settings.json exists:
First read it to check if statusLine is already configured:
jq -e '.statusLine' ~/.claude/settings.json
If statusLine already exists, check if it points to our script:
~/.claude/statusline.sh, output a note that it's already configuredIf statusLine doesn't exist, add it:
jq '. + {"statusLine": {"type": "command", "command": "~/.claude/statusline.sh"}}' ~/.claude/settings.json > ~/.claude/settings.json.tmp
mv ~/.claude/settings.json.tmp ~/.claude/settings.json
Build the success message based on user configuration:
✅ Peacock statusline configured successfully!
Configuration:
• Editor: $EDITOR_DISPLAY
• Statusline: ~/.claude/statusline.sh
• Settings: ~/.claude/settings.json
• Config: ~/.claude/.peacock-config
• Linting: $LINT_STATUS
Next step:
Restart Claude Code to see your new statusline and activate lint hooks
Features:
✓ Automatic project root detection (finds .git, package.json, etc.)
✓ Works with any code directory (~/code, ~/Source, ~/projects)
✓ Shows Peacock theme colors from .vscode/settings.json
✓ Displays git branch, lint status, and token usage
✓ Clickable file paths that open in your editor
✓ Separate visual segments for project and working folder
$LINT_FEATURES
Set project colors:
/peacock:change-color dark forest green
/peacock:change-color #8d0756
Need to change settings?
Run /peacock:setup again (safe to re-run)
Need to uninstall later?
Run /peacock:unsetup before uninstalling the plugin
Variable values:
EDITOR_DISPLAY:
LINT_STATUS:
LINT_FEATURES: