tissue config
Configure tissue settings for the project.
Tissue Commands
# Set local config
tissue config editor.default "nvim"
# Set global config
tissue config --global editor.default "nvim"
# List configuration
tissue config --list
tissue config --list --global
Manual Workflow (bash + git)
Set configuration values
# Set a configuration value
tissue_config_set() {
KEY="$1"
VALUE="$2"
GLOBAL="${3:-}"
if [ "$GLOBAL" = "--global" ]; then
CONFIG_FILE="${HOME}/.config/tissue/config"
else
CONFIG_FILE=".tissue/config"
fi
# Ensure config file exists
if [ ! -f "$CONFIG_FILE" ]; then
echo "Config file not found: $CONFIG_FILE"
echo "Run: tissue_config_init"
return 1
fi
# Parse key (section.key format)
SECTION=$(echo "$KEY" | cut -d'.' -f1)
KEY_NAME=$(echo "$KEY" | cut -d'.' -f2)
# Check if section exists
if ! grep -q "^\[$SECTION\]" "$CONFIG_FILE"; then
# Add new section
echo "" >> "$CONFIG_FILE"
echo "[$SECTION]" >> "$CONFIG_FILE"
fi
# Check if key exists in section
if grep -q "^$KEY_NAME = " "$CONFIG_FILE"; then
# Update existing key
sed -i.bak "/^\[$SECTION\]/,/^\[/{s/^$KEY_NAME = .*/$KEY_NAME = $VALUE/}" "$CONFIG_FILE"
else
# Add new key to section
awk -v section="[$SECTION]" -v key="$KEY_NAME = $VALUE" '
$0 == section {print; print key; next}
{print}
' "$CONFIG_FILE" > "$CONFIG_FILE.tmp"
mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
fi
echo "Set $KEY = $VALUE in $CONFIG_FILE"
}
# Examples
tissue_config_set "editor.default" "vim"
tissue_config_set "defaults.priority" "high" --global
List all configuration
# List all configuration settings
tissue_config_list() {
GLOBAL="${1:-}"
echo "Tissue Configuration"
echo "===================="
echo ""
if [ "$GLOBAL" = "--global" ]; then
CONFIG_FILE="${HOME}/.config/tissue/config"
echo "Global settings ($CONFIG_FILE):"
else
# Show both local and global
LOCAL_CONFIG=".tissue/config"
GLOBAL_CONFIG="${HOME}/.config/tissue/config"
if [ -f "$LOCAL_CONFIG" ]; then
echo "Local settings ($LOCAL_CONFIG):"
echo "--------------------------------"
grep -E "^[a-z]+ = " "$LOCAL_CONFIG" | while read line; do
echo " $line"
done
echo ""
fi
if [ -f "$GLOBAL_CONFIG" ]; then
echo "Global settings ($GLOBAL_CONFIG):"
echo "---------------------------------"
CONFIG_FILE="$GLOBAL_CONFIG"
fi
fi
if [ -f "$CONFIG_FILE" ]; then
CURRENT_SECTION=""
while IFS= read -r line; do
# Check for section header
if [[ "$line" =~ ^\[.*\]$ ]]; then
CURRENT_SECTION=$(echo "$line" | tr -d '[]')
echo ""
echo "[$CURRENT_SECTION]"
elif [[ "$line" =~ ^[a-z_]+[[:space:]]*=[[:space:]]*.+ ]]; then
KEY=$(echo "$line" | cut -d'=' -f1 | tr -d ' ')
VALUE=$(echo "$line" | cut -d'=' -f2- | sed 's/^ *//')
echo " ${CURRENT_SECTION}.${KEY} = ${VALUE}"
fi
done < "$CONFIG_FILE"
else
echo "No configuration file found"
fi
}
tissue_config_list
What tissue does for you:
- Manages local and global configuration files
- Provides cascading configuration (local overrides global)
- Supports environment variable overrides
- Manages issue templates
- Configures git hooks for automation
- Validates configuration integrity
- Provides sensible defaults
- Stores user preferences
- Enables workflow customization
- Maintains configuration versioning