Install
openclaw skills install swiftbutlerAnalyze, syntax-check, reindent, and distribute Swift source code with the SwiftButler CLI. Use when working with Swift files or packages and you need a compact API overview (`analyze` in interface/json/yaml/markdown), fast syntax validation (`check`), indentation cleanup with spaces or tabs (`reindent`), or to split large Swift files into declaration-based output files (`distribute`). Also use when setting up SwiftButler from Homebrew or verifying the installed CLI version.
openclaw skills install swiftbutlerUse butler to reduce Swift source into a more manageable working surface.
Install via Homebrew:
brew install cocoanetics/tap/swiftbutler
Verify:
butler --version
For local development from a checkout:
swift build
.build/debug/butler --version
analyze when an agent needs API shape, not full implementation details.--format yaml or --format json when the result will be parsed or reused.check for fast validation loops before swift build.reindent to normalize indentation in place; choose exactly one of --spaces <n> or --tabs.distribute before targeted edits when a generated file has become too large or noisy.# Default interface-style output
butler analyze Sources/MyModule
# Public API only
butler analyze Sources/MyModule --visibility public
# Recursive YAML output for tooling
butler analyze Sources --recursive --format yaml
# Write structured output to a file
butler analyze Sources --recursive --format yaml --output api.yaml
Supported formats:
interfacejsonyamlmarkdownbutler check Sources --recursive
butler check Sources --recursive --json
butler check Sources --recursive --json --pretty
butler check Sources --recursive --format markdown --show-fixits
# Default: 3 spaces
butler reindent Sources --recursive
# Explicit spaces
butler reindent Sources --recursive --spaces 2
butler reindent Sources --recursive --spaces 4
# Tabs instead of spaces
butler reindent Sources --recursive --tabs
# Preview without modifying files
butler reindent Sources --recursive --tabs --dry-run
Notes:
--spaces <n> accepts values from 1 to 16.--tabs and --spaces <n> are mutually exclusive.--tabs, the default is --spaces 3.# Split one large generated file
butler distribute Generated.swift
# Preview recursive distribution
butler distribute Sources/Generated --recursive --dry-run
# Write distributed files to a separate directory
butler distribute Sources/Generated --recursive --output SplitSources
analyze to hand an LLM a compact view of types, functions, properties, and docs.check inside generation or repair loops for immediate syntax feedback.reindent after generated or patched code has inconsistent indentation.distribute when one large Swift file should become declaration-sized files that are easier to inspect and edit.