Skip to content

feat: add digest restore mode to rebuild projects from digest.txt#579

Open
chiragjoshi12 wants to merge 1 commit into
coderamp-labs:mainfrom
chiragjoshi12:main
Open

feat: add digest restore mode to rebuild projects from digest.txt#579
chiragjoshi12 wants to merge 1 commit into
coderamp-labs:mainfrom
chiragjoshi12:main

Conversation

@chiragjoshi12
Copy link
Copy Markdown

Summary

This PR adds reverse-ingestion support so users can reconstruct a project from an existing digest.txt.

What’s included

  • Added a new restore module to parse digest blocks (FILE: / SYMLINK:) and rebuild files.
  • Added CLI restore mode:
    • --restore
    • --restore-dir
    • --overwrite
  • Added safety guard to prevent path traversal (e.g. ../ escaping destination).
  • Added restore completion stats in CLI output:
    • number of files
    • number of directories
    • number of symlinks
  • Added tests for parsing, restore behavior, CLI flow, and traversal protection.
  • Updated README with restore usage examples.

Why

gitingest already converts repositories into prompt-ready digests.
This change enables the reverse workflow: digest back to runnable project structure.

Usage examples

# Restore into current directory
gitingest digest.txt --restore

# Restore into a specific folder
gitingest digest.txt --restore --restore-dir ./restored-project

# Overwrite existing files
gitingest digest.txt --restore --restore-dir ./restored-project --overwrite

Support rebuilding a project from digest.txt via CLI and Python helpers, with overwrite/path-safety guards and restore stats output.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant