tissue view (tissue [id])
View a specific issue by ID or filename.
Tissue Commands
# View issue by ID (pretty table output)
tissue 42
tissue issues/042-memory_leak.md
# View with different formats
tissue 42 --format # default pretty format
tissue 42 --format json
tissue 42 --raw # raw markdown with frontmatter
# Open in editor
tissue 42 --edit
tissue 42 -e
tissue 42 --editor vim
Manual Workflow (bash + git)
View issue by number
# Find and display issue by number
view_issue() {
ISSUE_NUM="$1"
cd ../issues
# Pad number with zeros
PADDED_NUM=$(printf "%03d" "$ISSUE_NUM")
# Find the file
FILE=$(ls ${PADDED_NUM}_*.md 2>/dev/null | head -1)
if [ -z "$FILE" ]; then
echo "Issue #${ISSUE_NUM} not found"
return 1
fi
# Display the file
cat "$FILE"
}
view_issue 42
View issue with formatted output
# Pretty print issue using yq
pretty_view_issue() {
ISSUE_NUM="$1"
cd ../issues
PADDED_NUM=$(printf "%03d" "$ISSUE_NUM")
FILE=$(ls ${PADDED_NUM}_*.md 2>/dev/null | head -1)
if [ -z "$FILE" ]; then
echo "Issue #${ISSUE_NUM} not found"
return 1
fi
# Extract frontmatter fields using yq
TITLE=$(yq --front-matter '.title // ""' "$FILE")
STATUS=$(yq --front-matter '.status // "unknown"' "$FILE")
PRIORITY=$(yq --front-matter '.priority // ""' "$FILE")
TAGS=$(yq --front-matter '.tags | join(", ") // ""' "$FILE")
CREATED=$(yq --front-matter '.created // ""' "$FILE")
UPDATED=$(yq --front-matter '.updated // ""' "$FILE")
AUTHOR=$(yq --front-matter '.author // ""' "$FILE")
ASSIGNEE=$(yq --front-matter '.assignee // "unassigned"' "$FILE")
# Extract body (content after frontmatter)
BODY=$(sed -n '/^---$/,/^---$/d; p' "$FILE")
# Display formatted output
echo "════════════════════════════════════════════════════════════════"
echo " Issue #${ISSUE_NUM}: ${TITLE}"
echo "════════════════════════════════════════════════════════════════"
echo ""
echo "Status: ${STATUS}"
echo "Priority: ${PRIORITY}"
echo "Tags: ${TAGS}"
echo "Author: ${AUTHOR}"
echo "Assignee: ${ASSIGNEE:-unassigned}"
echo "Created: ${CREATED}"
echo "Updated: ${UPDATED}"
echo ""
echo "────────────────────────────────────────────────────────────────"
echo ""
echo "$BODY"
}
pretty_view_issue 42
View as JSON
# Convert issue to JSON format using yq
issue_to_json() {
ISSUE_NUM="$1"
cd ../issues
PADDED_NUM=$(printf "%03d" "$ISSUE_NUM")
FILE=$(ls ${PADDED_NUM}_*.md 2>/dev/null | head -1)
if [ -z "$FILE" ]; then
echo '{"error": "Issue not found"}'
return 1
fi
# Extract all frontmatter as JSON using yq
FRONTMATTER=$(yq --front-matter -o json '.' "$FILE")
# Extract body and escape for JSON
BODY=$(sed -n '/^---$/,/^---$/d; p' "$FILE" | \
jq -Rs '.')
# Combine frontmatter with additional fields
echo "$FRONTMATTER" | jq --arg num "$ISSUE_NUM" \
--arg file "$FILE" \
--argjson body "$BODY" '
. + {
"number": ($num | tonumber),
"file": $file,
"body": $body
}
'
}
issue_to_json 42 | jq . # Pretty print with jq if available
View raw markdown
# Show raw file with syntax highlighting (if available)
view_raw() {
ISSUE_NUM="$1"
cd ../issues
PADDED_NUM=$(printf "%03d" "$ISSUE_NUM")
FILE=$(ls ${PADDED_NUM}_*.md 2>/dev/null | head -1)
if [ -z "$FILE" ]; then
echo "Issue #${ISSUE_NUM} not found"
return 1
fi
# Use bat for syntax highlighting if available
if command -v bat &> /dev/null; then
bat --style=full --language=markdown "$FILE"
elif command -v pygmentize &> /dev/null; then
pygmentize -l markdown "$FILE"
else
# Fallback to cat with line numbers
cat -n "$FILE"
fi
}
view_raw 42
Open in editor
# Edit issue with yq timestamp update
edit_issue() {
ISSUE_NUM="$1"
EDITOR="${2:-${EDITOR:-vim}}"
cd ../issues
PADDED_NUM=$(printf "%03d" "$ISSUE_NUM")
FILE=$(ls ${PADDED_NUM}_*.md 2>/dev/null | head -1)
if [ -z "$FILE" ]; then
echo "Issue #${ISSUE_NUM} not found"
return 1
fi
# Open in editor
$EDITOR "$FILE"
# Update the 'updated' timestamp after editing
yq --front-matter '.updated = now' -i "$FILE"
# Commit changes
git add "$FILE"
git commit -m "Update issue #${ISSUE_NUM}"
}
edit_issue 42 vim
What tissue does for you:
- Automatically finds issues by number or pattern
- Provides multiple output formats
- Handles editor integration seamlessly
- Updates timestamps automatically
- Validates issue structure before display
- Provides syntax highlighting
- Manages git operations after edits
- Shows issue history and changes
- Supports templates for consistent viewing
- Integrates with shell completion for issue IDs