feat/002_init-remote
Raw Download raw file

tissue export

Export issues to various formats.

Tissue Command

# Export to JSON
tissue export > issues.json

Manual Workflow (bash + git)

Export to JSON

# Export all issues to JSON format
export_to_json() {
    OUTPUT_FILE="${1:-issues.json}"

    cd ../issues 2>/dev/null || return 1

    echo "Exporting issues to JSON: $OUTPUT_FILE"

    # Start JSON array
    echo "[" > "$OUTPUT_FILE"

    FIRST=true
    for file in *.md; do
        [ "$file" = "README.md" ] && continue
        [ -f "$file" ] || continue

        # Add comma separator after first item
        if [ "$FIRST" = true ]; then
            FIRST=false
        else
            echo "," >> "$OUTPUT_FILE"
        fi

        # Extract frontmatter fields
        ID=$(awk '/^id:/ {print $2}' "$file")
        TITLE=$(awk '/^title:/ {$1=""; print substr($0,2)}' "$file" | sed 's/"/\\"/g')
        STATUS=$(yq --front-matter '.status // ""' "$file")
        PRIORITY=$(yq --front-matter '.priority // ""' "$file")
        TAGS=$(awk '/^tags:/ {$1=""; print substr($0,2)}' "$file")
        CREATED=$(awk '/^created:/ {print $2, $3}' "$file")
        UPDATED=$(awk '/^updated:/ {print $2, $3}' "$file")
        AUTHOR=$(awk '/^author:/ {$1=""; print substr($0,2)}' "$file" | sed 's/"/\\"/g')
        ASSIGNEE=$(awk '/^assignee:/ {$1=""; print substr($0,2)}' "$file" | sed 's/"/\\"/g')

        # Extract body (everything after second ---)
        BODY=$(awk '/^---$/ {count++} count==2 {body=1; next} body' "$file" | \
               sed 's/\\/\\\\/g; s/"/\\"/g; s/$/\\n/' | tr -d '\n' | sed 's/\\n$//')

        # Write JSON object (without trailing comma)
        cat >> "$OUTPUT_FILE" << EOF
  {
    "file": "${file}",
    "id": "${ID}",
    "title": "${TITLE}",
    "status": "${STATUS}",
    "priority": "${PRIORITY}",
    "tags": ${TAGS:-[]},
    "created": "${CREATED}",
    "updated": "${UPDATED}",
    "author": "${AUTHOR}",
    "assignee": "${ASSIGNEE}",
    "body": "${BODY}"
  }
EOF
    done

    # Close JSON array
    echo "" >> "$OUTPUT_FILE"
    echo "]" >> "$OUTPUT_FILE"

    echo "Export complete: $OUTPUT_FILE"
    cd - > /dev/null
}

export_to_json

What tissue does for you:

  1. Exports to multiple formats (JSON, CSV, HTML, Markdown)
  2. Handles special characters and escaping
  3. Provides filtered exports
  4. Creates GitHub-compatible exports
  5. Includes attachments and related files
  6. Generates statistics and metrics
  7. Creates portable archives
  8. Maintains data integrity
  9. Provides format conversion
  10. Supports bulk operations