Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.1] - 2025-12-21

### Added
- Automated installation into prompts and agent hooks

### Changed
- Documented installation options for easier setup
- Ensured end-to-end installation tests run before release to improve reliability


## [1.1.0] - 2025-12-19

This release introduces --agentic mode, see docs/agentic_mode.md for
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all help build build-all test test-integration fmt fmt-check check-ctx clean install hooks coverage coverage-html coverage-signals gosec vet revive install-fabric-pattern release load-light load-medium load-heavy load stress-test
.PHONY: all help build build-all test test-integration fmt fmt-check check-ctx clean install hooks coverage coverage-html coverage-signals gosec vet revive install-fabric-pattern release load-light load-medium load-heavy load stress-test docker-install-test

# Detect Go bin directory portably
GOBIN := $(shell go env GOBIN)
Expand Down Expand Up @@ -33,6 +33,7 @@ help:
@echo " make load-medium - Generate medium system load (Ctrl+C to stop)"
@echo " make load-heavy - Generate heavy system load (Ctrl+C to stop)"
@echo " make stress-test - Run dashlights repeatedly under load with stats"
@echo " make docker-install-test - Run dockerized install test plan"
@echo " make install-fabric-pattern - Install Fabric pattern for changelog generation"
@echo " make release - Create a new release with AI-generated changelog"

Expand Down Expand Up @@ -217,7 +218,7 @@ install-fabric-pattern:
@echo "✅ Fabric pattern installed to ~/.config/fabric/patterns/create_git_changelog/"

# Create a new release with AI-generated changelog
release:
release: docker-install-test
@bash scripts/release.sh

# Load testing targets
Expand All @@ -244,3 +245,5 @@ stress-test:
@echo "Stress testing dashlights..."
@bash scripts/stress-dashlights.sh

docker-install-test:
@bash scripts/dockerized-install-test.sh
109 changes: 10 additions & 99 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,107 +105,17 @@ make install

## Configure your PROMPT

After installing dashlights, add it to your shell prompt to get continuous security monitoring.

### Bash

Add to your `~/.bashrc`:

```bash
# Add dashlights to your prompt
PS1='$(dashlights) '"$PS1"
```

### Zsh

Add to your `~/.zshrc`:

```bash
# For left prompt (PROMPT)
PROMPT='$(dashlights) '"$PROMPT"

# Or for right prompt (RPROMPT)
RPROMPT='$(dashlights)'
```

### oh-my-zsh

Add to your `~/.zshrc` after the oh-my-zsh initialization:

```bash
# Source oh-my-zsh first
source $ZSH/oh-my-zsh.sh

# Then add dashlights to your prompt
PROMPT='$(dashlights) '"$PROMPT"
```

### Powerlevel10k

If you use Powerlevel10k, add dashlights as a custom prompt segment by editing your `~/.p10k.zsh` configuration file.

#### Step 1: Define the custom segment function

Add this function anywhere in your `~/.p10k.zsh` file (recommended: after the initial comments, before the main configuration block):

```bash
function prompt_dashlights() {
# Run dashlights and capture output
local content=$(dashlights 2>/dev/null)

# Only render the segment if dashlights returned output
if [[ -n $content ]]; then
p10k segment -t "$content"
fi
}
```

#### Step 2: Add to your prompt elements

Find the `POWERLEVEL9K_LEFT_PROMPT_ELEMENTS` array in your `~/.p10k.zsh` and add `dashlights` to it:
After installing dashlights, run the installer once. It detects bash, zsh, fish, and Powerlevel10k automatically.

```bash
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
# =========================[ Line #1 ]=========================
dir # current directory
vcs # git status
# =========================[ Line #2 ]=========================
newline # \n
dashlights # <-- Add this line
prompt_char # prompt symbol
)
dashlights --installprompt
```

**Alternative**: Add to right prompt or second line:

```bash
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
# =========================[ Line #1 ]=========================
command_execution_time # previous command duration
dashlights # <-- Add here for right prompt
time # current time
)
```

#### Step 3: Reload your configuration

```bash
source ~/.zshrc
```

**Note**: This approach keeps your `~/.zshrc` clean and follows Powerlevel10k best practices by keeping all prompt configuration in `~/.p10k.zsh`. The segment will only appear when dashlights detects security issues or custom dashboard lights.

### Fish

Add to your `~/.config/fish/config.fish`:

```fish
# Add dashlights to your prompt
function fish_prompt
echo -n (dashlights)" "
# ... rest of your prompt configuration
end
```
Tips:
- Use `--yes` for non-interactive installs.
- Use `--configpath` to target a specific config file (e.g., `~/.p10k.zsh`).
- Use `--dry-run` to preview changes without modifying files.
- Re-run any time; it is idempotent.

## Usage

Expand Down Expand Up @@ -314,8 +224,9 @@ Dashlights includes an `--agentic` mode for AI coding assistants like Claude Cod
- **Rule of Two violations**: Actions combining untrusted input + sensitive access + state changes

```bash
# Add to .claude/settings.json hooks
"command": "dashlights --agentic"
# Install agent hooks
dashlights --installagent claude -y
dashlights --installagent cursor -y
```

👉 **[View the complete agentic mode documentation →](docs/agentic_mode.md)**
Expand Down
16 changes: 14 additions & 2 deletions docs/agentic_mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ When all three capabilities are combined in a single action, the risk of securit

### Claude Code

Claude Code is the primary supported agent. Add to your `.claude/settings.json`:
Claude Code is the primary supported agent. Recommended installer:

```bash
dashlights --installagent claude -y
```

Manual configuration (if you prefer to edit by hand):

```json
{
Expand All @@ -59,7 +65,13 @@ Claude Code is the primary supported agent. Add to your `.claude/settings.json`:

Cursor IDE is supported via the `beforeShellExecution` hook. Dashlights automatically detects Cursor input format and outputs the expected response format.

**Configuration:** Create `.cursor/hooks.json` in your project or home directory:
Recommended installer:

```bash
dashlights --installagent cursor -y
```

Manual configuration (if you prefer to edit by hand). Create `.cursor/hooks.json` in your project or home directory:

```json
{
Expand Down
Loading
Loading