RepoPackPy 0.1.8__tar.gz → 0.1.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,215 @@
1
+ Metadata-Version: 2.4
2
+ Name: RepoPackPy
3
+ Version: 0.1.9
4
+ Summary: Pack/unpack any source workspace into portable JSON, with MCP server support.
5
+ License: MIT
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.10
8
+ Requires-Dist: mcp[cli]>=1.0
9
+ Requires-Dist: pathspec>=0.12
10
+ Requires-Dist: typer>=0.12
11
+ Provides-Extra: dev
12
+ Requires-Dist: pytest>=8; extra == 'dev'
13
+ Description-Content-Type: text/markdown
14
+
15
+ # RepoPack
16
+
17
+ Pack/unpack **any source workspace regardless of technology stack** (Python, Node.js, React, Angular, Vue, Rust, Go, Java, C#, and more) into a portable, structured JSON payload — and restore it faithfully from that payload.
18
+
19
+ ## Features
20
+
21
+ - **Universal ignore engine** — respects root and nested `.gitignore` files plus stack-agnostic defaults (node_modules, __pycache__, .venv, target/, dist/, secrets, lock files, …)
22
+ - **Polyglot stack detection** — auto-detects Node.js, React, TypeScript, Angular, Next.js, Vue, Python, Rust, Go, Java, C# from project sentinel files
23
+ - **Binary safety** — text files encoded as UTF-8; binaries skipped by default or included as Base64 with `--include-binary`
24
+ - **5 MB guard** — files larger than 5 MB are skipped with a warning
25
+ - **Dry-run mode** — preview exactly which files would be packed or unpacked before committing with `--dry-run`
26
+ - **Path traversal shield** — `unpack` validates every path against the destination root before writing anything; blocks `../`, absolute paths, and injection attempts (CWE-22)
27
+ - **Secure PyPI version check** — uses `http.client.HTTPSConnection` (not `urlopen`) to enforce HTTPS at the type level
28
+ - **MCP server** — expose pack/unpack as tools to any MCP-compatible AI client (Claude Desktop, etc.)
29
+ - **Automated security auditing** — weekly `pip-audit` + `bandit` CI scans on all dependencies
30
+
31
+ ## Installation
32
+
33
+ ### From PyPI (recommended)
34
+
35
+ ```bash
36
+ pip install RepoPackPy
37
+ ```
38
+
39
+ Requires Python 3.10+.
40
+
41
+ ### Quick start after install
42
+
43
+ ```bash
44
+ # Verify the install
45
+ repopack --version
46
+ repopack --help
47
+
48
+ # Pack your project
49
+ repopack pack . -o my-workspace.json
50
+
51
+ # Preview what would be packed (no output written)
52
+ repopack pack . --dry-run
53
+
54
+ # Restore it somewhere else
55
+ repopack unpack my-workspace.json -t ./restored
56
+
57
+ # Preview what would be unpacked (nothing written)
58
+ repopack unpack my-workspace.json -t ./restored --dry-run
59
+ ```
60
+
61
+ ### For development
62
+
63
+ ```bash
64
+ git clone https://github.com/ShanKonduru/RepoPack.git
65
+ cd RepoPack
66
+ pip install ".[dev]"
67
+ ```
68
+
69
+ > **Note:** Install without `-e` (editable) so `pip-audit` can audit the package metadata correctly.
70
+
71
+ ## CLI Usage
72
+
73
+ ```
74
+ repopack pack [DIRECTORY] [-o output.json] [--include-binary] [--custom-ignore ".next,dist"] [--dry-run]
75
+ repopack unpack <input.json> [-t TARGET_DIR] [--force] [--dry-run]
76
+ repopack serve
77
+ ```
78
+
79
+ ### Options
80
+
81
+ | Command | Flag | Description |
82
+ |---|---|---|
83
+ | `pack` | `-o / --output` | Write packed JSON to this file (prints to stdout if omitted) |
84
+ | `pack` | `--include-binary` | Include binary files encoded as Base64 |
85
+ | `pack` | `--custom-ignore` | Comma-separated extra ignore patterns |
86
+ | `pack` | `--dry-run` | List files that would be packed — encoding, size, path — without writing anything |
87
+ | `unpack` | `-t / --target` | Destination directory (default: current directory) |
88
+ | `unpack` | `--force` | Overwrite existing files |
89
+ | `unpack` | `--dry-run` | List files that would be extracted or skipped without writing anything |
90
+
91
+ ### Examples
92
+
93
+ ```bash
94
+ # Pack current directory
95
+ repopack pack . -o workspace.json
96
+
97
+ # Dry-run: see what would be packed
98
+ repopack pack . --dry-run
99
+
100
+ # Pack a specific project, include binaries
101
+ repopack pack ~/projects/my-app -o my-app.json --include-binary
102
+
103
+ # Unpack into a new directory
104
+ repopack unpack workspace.json -t ./restored
105
+
106
+ # Dry-run: see what would be unpacked (and what would be skipped)
107
+ repopack unpack workspace.json -t ./restored --dry-run
108
+
109
+ # Unpack and overwrite existing files
110
+ repopack unpack workspace.json -t ./restored --force
111
+ ```
112
+
113
+ #### Sample `--dry-run` output
114
+
115
+ ```
116
+ # pack --dry-run
117
+ Dry run — would pack 42 files (186320 bytes)
118
+ Root : /home/user/my-app
119
+ Stack : Node.js, React, TypeScript
120
+ utf-8 1024 src/App.tsx
121
+ utf-8 512 src/index.tsx
122
+ base64 8192 public/favicon.ico
123
+ ...
124
+
125
+ # unpack --dry-run
126
+ Dry run — destination: /home/user/restored
127
+ Would extract : 40
128
+ Would skip : 2
129
+ create src/App.tsx
130
+ create src/index.tsx
131
+ skip (exists) README.md
132
+ ...
133
+ ```
134
+
135
+ ## JSON Payload Schema
136
+
137
+ ```json
138
+ {
139
+ "version": "1.0",
140
+ "metadata": {
141
+ "created_at": "2026-07-26T12:00:00Z",
142
+ "root_directory_name": "my-app",
143
+ "detected_stack": ["Node.js", "React", "TypeScript"],
144
+ "total_files": 38,
145
+ "total_bytes": 128450
146
+ },
147
+ "files": [
148
+ { "path": "src/App.tsx", "encoding": "utf-8", "content": "..." },
149
+ { "path": "public/favicon.ico", "encoding": "base64", "content": "..." }
150
+ ]
151
+ }
152
+ ```
153
+
154
+ ## MCP Server Tools
155
+
156
+ When running `repopack serve`, two tools are registered via FastMCP:
157
+
158
+ | Tool | Parameters | Description |
159
+ |---|---|---|
160
+ | `export_workspace` | `workspace_path, output_json_path, include_binary, dry_run` | Pack a directory into JSON |
161
+ | `import_workspace` | `json_input, destination_path, overwrite, dry_run` | Unpack JSON into a directory |
162
+
163
+ Set `dry_run=true` on either tool to get a plain-text report without reading file content or writing to disk.
164
+
165
+ ## Security
166
+
167
+ ### Path traversal protection
168
+
169
+ Every path in an incoming JSON payload is validated before the filesystem is touched:
170
+
171
+ - Absolute paths are rejected.
172
+ - Any path component equal to `..` is rejected.
173
+ - The resolved output path is checked with `os.path.commonpath` to confirm it stays inside the destination root.
174
+
175
+ This blocks directory traversal attacks (CWE-22) regardless of how the JSON was produced.
176
+
177
+ ### PyPI version check
178
+
179
+ The `--version` flag checks for newer releases on PyPI using `http.client.HTTPSConnection` directly, which enforces HTTPS at the type level and is not susceptible to `file://` or custom-scheme abuse (bandit B310 / CWE-22).
180
+
181
+ ### CI security scanning
182
+
183
+ Every push and weekly schedule runs:
184
+
185
+ - **`pip-audit --strict`** — checks all third-party dependencies against known CVE databases.
186
+ - **`bandit -r repopack/ -ll -ii`** — static analysis for common Python security issues.
187
+
188
+ ## Project Structure
189
+
190
+ ```
191
+ repopack/
192
+ ├── pyproject.toml
193
+ ├── README.md
194
+ └── repopack/
195
+ ├── __init__.py
196
+ ├── cli.py # Typer CLI (pack / unpack / serve)
197
+ ├── mcp_server.py # FastMCP server
198
+ ├── packer.py # Directory walker & JSON builder
199
+ ├── unpacker.py # JSON extractor & path-safe reconstructor
200
+ └── utils.py # Ignore engine, binary detector, stack detection
201
+ tests/
202
+ └── test_repopack.py
203
+ ```
204
+
205
+ ## Running Tests
206
+
207
+ ```bash
208
+ pytest tests/ -v
209
+ ```
210
+
211
+ ## Dependencies
212
+
213
+ - [typer](https://typer.tiangolo.com/) — CLI framework
214
+ - [mcp](https://github.com/modelcontextprotocol/python-sdk) — MCP SDK (FastMCP)
215
+ - [pathspec](https://github.com/cpburnz/python-pathspec) — gitignore wildmatch pattern matching
@@ -0,0 +1,201 @@
1
+ # RepoPack
2
+
3
+ Pack/unpack **any source workspace regardless of technology stack** (Python, Node.js, React, Angular, Vue, Rust, Go, Java, C#, and more) into a portable, structured JSON payload — and restore it faithfully from that payload.
4
+
5
+ ## Features
6
+
7
+ - **Universal ignore engine** — respects root and nested `.gitignore` files plus stack-agnostic defaults (node_modules, __pycache__, .venv, target/, dist/, secrets, lock files, …)
8
+ - **Polyglot stack detection** — auto-detects Node.js, React, TypeScript, Angular, Next.js, Vue, Python, Rust, Go, Java, C# from project sentinel files
9
+ - **Binary safety** — text files encoded as UTF-8; binaries skipped by default or included as Base64 with `--include-binary`
10
+ - **5 MB guard** — files larger than 5 MB are skipped with a warning
11
+ - **Dry-run mode** — preview exactly which files would be packed or unpacked before committing with `--dry-run`
12
+ - **Path traversal shield** — `unpack` validates every path against the destination root before writing anything; blocks `../`, absolute paths, and injection attempts (CWE-22)
13
+ - **Secure PyPI version check** — uses `http.client.HTTPSConnection` (not `urlopen`) to enforce HTTPS at the type level
14
+ - **MCP server** — expose pack/unpack as tools to any MCP-compatible AI client (Claude Desktop, etc.)
15
+ - **Automated security auditing** — weekly `pip-audit` + `bandit` CI scans on all dependencies
16
+
17
+ ## Installation
18
+
19
+ ### From PyPI (recommended)
20
+
21
+ ```bash
22
+ pip install RepoPackPy
23
+ ```
24
+
25
+ Requires Python 3.10+.
26
+
27
+ ### Quick start after install
28
+
29
+ ```bash
30
+ # Verify the install
31
+ repopack --version
32
+ repopack --help
33
+
34
+ # Pack your project
35
+ repopack pack . -o my-workspace.json
36
+
37
+ # Preview what would be packed (no output written)
38
+ repopack pack . --dry-run
39
+
40
+ # Restore it somewhere else
41
+ repopack unpack my-workspace.json -t ./restored
42
+
43
+ # Preview what would be unpacked (nothing written)
44
+ repopack unpack my-workspace.json -t ./restored --dry-run
45
+ ```
46
+
47
+ ### For development
48
+
49
+ ```bash
50
+ git clone https://github.com/ShanKonduru/RepoPack.git
51
+ cd RepoPack
52
+ pip install ".[dev]"
53
+ ```
54
+
55
+ > **Note:** Install without `-e` (editable) so `pip-audit` can audit the package metadata correctly.
56
+
57
+ ## CLI Usage
58
+
59
+ ```
60
+ repopack pack [DIRECTORY] [-o output.json] [--include-binary] [--custom-ignore ".next,dist"] [--dry-run]
61
+ repopack unpack <input.json> [-t TARGET_DIR] [--force] [--dry-run]
62
+ repopack serve
63
+ ```
64
+
65
+ ### Options
66
+
67
+ | Command | Flag | Description |
68
+ |---|---|---|
69
+ | `pack` | `-o / --output` | Write packed JSON to this file (prints to stdout if omitted) |
70
+ | `pack` | `--include-binary` | Include binary files encoded as Base64 |
71
+ | `pack` | `--custom-ignore` | Comma-separated extra ignore patterns |
72
+ | `pack` | `--dry-run` | List files that would be packed — encoding, size, path — without writing anything |
73
+ | `unpack` | `-t / --target` | Destination directory (default: current directory) |
74
+ | `unpack` | `--force` | Overwrite existing files |
75
+ | `unpack` | `--dry-run` | List files that would be extracted or skipped without writing anything |
76
+
77
+ ### Examples
78
+
79
+ ```bash
80
+ # Pack current directory
81
+ repopack pack . -o workspace.json
82
+
83
+ # Dry-run: see what would be packed
84
+ repopack pack . --dry-run
85
+
86
+ # Pack a specific project, include binaries
87
+ repopack pack ~/projects/my-app -o my-app.json --include-binary
88
+
89
+ # Unpack into a new directory
90
+ repopack unpack workspace.json -t ./restored
91
+
92
+ # Dry-run: see what would be unpacked (and what would be skipped)
93
+ repopack unpack workspace.json -t ./restored --dry-run
94
+
95
+ # Unpack and overwrite existing files
96
+ repopack unpack workspace.json -t ./restored --force
97
+ ```
98
+
99
+ #### Sample `--dry-run` output
100
+
101
+ ```
102
+ # pack --dry-run
103
+ Dry run — would pack 42 files (186320 bytes)
104
+ Root : /home/user/my-app
105
+ Stack : Node.js, React, TypeScript
106
+ utf-8 1024 src/App.tsx
107
+ utf-8 512 src/index.tsx
108
+ base64 8192 public/favicon.ico
109
+ ...
110
+
111
+ # unpack --dry-run
112
+ Dry run — destination: /home/user/restored
113
+ Would extract : 40
114
+ Would skip : 2
115
+ create src/App.tsx
116
+ create src/index.tsx
117
+ skip (exists) README.md
118
+ ...
119
+ ```
120
+
121
+ ## JSON Payload Schema
122
+
123
+ ```json
124
+ {
125
+ "version": "1.0",
126
+ "metadata": {
127
+ "created_at": "2026-07-26T12:00:00Z",
128
+ "root_directory_name": "my-app",
129
+ "detected_stack": ["Node.js", "React", "TypeScript"],
130
+ "total_files": 38,
131
+ "total_bytes": 128450
132
+ },
133
+ "files": [
134
+ { "path": "src/App.tsx", "encoding": "utf-8", "content": "..." },
135
+ { "path": "public/favicon.ico", "encoding": "base64", "content": "..." }
136
+ ]
137
+ }
138
+ ```
139
+
140
+ ## MCP Server Tools
141
+
142
+ When running `repopack serve`, two tools are registered via FastMCP:
143
+
144
+ | Tool | Parameters | Description |
145
+ |---|---|---|
146
+ | `export_workspace` | `workspace_path, output_json_path, include_binary, dry_run` | Pack a directory into JSON |
147
+ | `import_workspace` | `json_input, destination_path, overwrite, dry_run` | Unpack JSON into a directory |
148
+
149
+ Set `dry_run=true` on either tool to get a plain-text report without reading file content or writing to disk.
150
+
151
+ ## Security
152
+
153
+ ### Path traversal protection
154
+
155
+ Every path in an incoming JSON payload is validated before the filesystem is touched:
156
+
157
+ - Absolute paths are rejected.
158
+ - Any path component equal to `..` is rejected.
159
+ - The resolved output path is checked with `os.path.commonpath` to confirm it stays inside the destination root.
160
+
161
+ This blocks directory traversal attacks (CWE-22) regardless of how the JSON was produced.
162
+
163
+ ### PyPI version check
164
+
165
+ The `--version` flag checks for newer releases on PyPI using `http.client.HTTPSConnection` directly, which enforces HTTPS at the type level and is not susceptible to `file://` or custom-scheme abuse (bandit B310 / CWE-22).
166
+
167
+ ### CI security scanning
168
+
169
+ Every push and weekly schedule runs:
170
+
171
+ - **`pip-audit --strict`** — checks all third-party dependencies against known CVE databases.
172
+ - **`bandit -r repopack/ -ll -ii`** — static analysis for common Python security issues.
173
+
174
+ ## Project Structure
175
+
176
+ ```
177
+ repopack/
178
+ ├── pyproject.toml
179
+ ├── README.md
180
+ └── repopack/
181
+ ├── __init__.py
182
+ ├── cli.py # Typer CLI (pack / unpack / serve)
183
+ ├── mcp_server.py # FastMCP server
184
+ ├── packer.py # Directory walker & JSON builder
185
+ ├── unpacker.py # JSON extractor & path-safe reconstructor
186
+ └── utils.py # Ignore engine, binary detector, stack detection
187
+ tests/
188
+ └── test_repopack.py
189
+ ```
190
+
191
+ ## Running Tests
192
+
193
+ ```bash
194
+ pytest tests/ -v
195
+ ```
196
+
197
+ ## Dependencies
198
+
199
+ - [typer](https://typer.tiangolo.com/) — CLI framework
200
+ - [mcp](https://github.com/modelcontextprotocol/python-sdk) — MCP SDK (FastMCP)
201
+ - [pathspec](https://github.com/cpburnz/python-pathspec) — gitignore wildmatch pattern matching
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "RepoPackPy"
7
- version = "0.1.8"
7
+ version = "0.1.9"
8
8
  description = "Pack/unpack any source workspace into portable JSON, with MCP server support."
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -0,0 +1 @@
1
+ __version__ = "0.1.9"
repopackpy-0.1.8/PKG-INFO DELETED
@@ -1,153 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: RepoPackPy
3
- Version: 0.1.8
4
- Summary: Pack/unpack any source workspace into portable JSON, with MCP server support.
5
- License: MIT
6
- License-File: LICENSE
7
- Requires-Python: >=3.10
8
- Requires-Dist: mcp[cli]>=1.0
9
- Requires-Dist: pathspec>=0.12
10
- Requires-Dist: typer>=0.12
11
- Provides-Extra: dev
12
- Requires-Dist: pytest>=8; extra == 'dev'
13
- Description-Content-Type: text/markdown
14
-
15
- # RepoPack
16
-
17
- Pack/unpack **any source workspace regardless of technology stack** (Python, Node.js, React, Angular, Vue, Rust, Go, Java, C#, and more) into a portable, structured JSON payload — and restore it faithfully from that payload.
18
-
19
- ## Features
20
-
21
- - **Universal ignore engine** — respects root and nested `.gitignore` files plus stack-agnostic defaults (node_modules, __pycache__, .venv, target/, dist/, secrets, lock files, …)
22
- - **Polyglot stack detection** — auto-detects Node.js, React, TypeScript, Angular, Next.js, Vue, Python, Rust, Go, Java, C# from project sentinel files
23
- - **Binary safety** — text files encoded as UTF-8; binaries skipped by default or included as Base64 with `--include-binary`
24
- - **5 MB guard** — files larger than 5 MB are skipped with a warning
25
- - **Path traversal shield** — `unpack` validates every path against the destination root before writing anything
26
- - **MCP server** — expose pack/unpack as tools to any MCP-compatible AI client (Claude Desktop, etc.)
27
-
28
- ## Installation
29
-
30
- ### From PyPI (recommended)
31
-
32
- Install the latest stable release:
33
-
34
- ```bash
35
- pip install RepoPackPy
36
- ```
37
-
38
- Pin to a specific version:
39
-
40
- ```bash
41
- pip install RepoPackPy==0.1.1
42
- ```
43
-
44
- Requires Python 3.10+.
45
-
46
- ### Quick start after install
47
-
48
- ```bash
49
- # Verify the install
50
- repopack --help
51
-
52
- # Pack your project
53
- repopack pack . -o my-workspace.json
54
-
55
- # Restore it somewhere else
56
- repopack unpack my-workspace.json -t ./restored
57
- ```
58
-
59
- ### For development
60
-
61
- Clone the repo and install in editable mode with test dependencies:
62
-
63
- ```bash
64
- git clone https://github.com/ShanKonduru/RepoPack.git
65
- cd RepoPack
66
- pip install -e ".[dev]"
67
- ```
68
-
69
- ## CLI Usage
70
-
71
- ```bash
72
- # Pack a directory into JSON
73
- repopack pack [DIRECTORY] [-o output.json] [--include-binary] [--custom-ignore ".next,dist"]
74
-
75
- # Unpack JSON back into a directory
76
- repopack unpack <input.json> [-t TARGET_DIR] [--force]
77
-
78
- # Start the MCP server (stdio transport)
79
- repopack serve
80
- ```
81
-
82
- ### Examples
83
-
84
- ```bash
85
- # Pack current directory, write to file
86
- repopack pack . -o workspace.json
87
-
88
- # Pack a specific project, include binaries
89
- repopack pack ~/projects/my-app -o my-app.json --include-binary
90
-
91
- # Unpack into a new directory
92
- repopack unpack workspace.json -t ./restored
93
-
94
- # Unpack and overwrite existing files
95
- repopack unpack workspace.json -t ./restored --force
96
- ```
97
-
98
- ## JSON Payload Schema
99
-
100
- ```json
101
- {
102
- "version": "1.0",
103
- "metadata": {
104
- "created_at": "2026-07-26T12:00:00Z",
105
- "root_directory_name": "my-app",
106
- "detected_stack": ["Node.js", "React", "TypeScript"],
107
- "total_files": 38,
108
- "total_bytes": 128450
109
- },
110
- "files": [
111
- { "path": "src/App.tsx", "encoding": "utf-8", "content": "..." },
112
- { "path": "public/favicon.ico", "encoding": "base64", "content": "..." }
113
- ]
114
- }
115
- ```
116
-
117
- ## MCP Server Tools
118
-
119
- When running `repopack serve`, two tools are registered via FastMCP:
120
-
121
- | Tool | Description |
122
- |---|---|
123
- | `export_workspace(workspace_path, output_json_path, include_binary)` | Pack a directory into JSON |
124
- | `import_workspace(json_input, destination_path, overwrite)` | Unpack JSON into a directory |
125
-
126
- ## Project Structure
127
-
128
- ```
129
- repopack/
130
- ├── pyproject.toml
131
- ├── README.md
132
- └── repopack/
133
- ├── __init__.py
134
- ├── cli.py # Typer CLI (pack / unpack / serve)
135
- ├── mcp_server.py # FastMCP server
136
- ├── packer.py # Directory walker & JSON builder
137
- ├── unpacker.py # JSON extractor & path-safe reconstructor
138
- └── utils.py # Ignore engine, binary detector, stack detection
139
- tests/
140
- └── test_repopack.py # 26-test pytest suite
141
- ```
142
-
143
- ## Running Tests
144
-
145
- ```bash
146
- pytest tests/ -v
147
- ```
148
-
149
- ## Dependencies
150
-
151
- - [typer](https://typer.tiangolo.com/) — CLI framework
152
- - [mcp](https://github.com/modelcontextprotocol/python-sdk) — MCP SDK (FastMCP)
153
- - [pathspec](https://github.com/cpburnz/python-pathspec) — gitignore wildmatch pattern matching
@@ -1,139 +0,0 @@
1
- # RepoPack
2
-
3
- Pack/unpack **any source workspace regardless of technology stack** (Python, Node.js, React, Angular, Vue, Rust, Go, Java, C#, and more) into a portable, structured JSON payload — and restore it faithfully from that payload.
4
-
5
- ## Features
6
-
7
- - **Universal ignore engine** — respects root and nested `.gitignore` files plus stack-agnostic defaults (node_modules, __pycache__, .venv, target/, dist/, secrets, lock files, …)
8
- - **Polyglot stack detection** — auto-detects Node.js, React, TypeScript, Angular, Next.js, Vue, Python, Rust, Go, Java, C# from project sentinel files
9
- - **Binary safety** — text files encoded as UTF-8; binaries skipped by default or included as Base64 with `--include-binary`
10
- - **5 MB guard** — files larger than 5 MB are skipped with a warning
11
- - **Path traversal shield** — `unpack` validates every path against the destination root before writing anything
12
- - **MCP server** — expose pack/unpack as tools to any MCP-compatible AI client (Claude Desktop, etc.)
13
-
14
- ## Installation
15
-
16
- ### From PyPI (recommended)
17
-
18
- Install the latest stable release:
19
-
20
- ```bash
21
- pip install RepoPackPy
22
- ```
23
-
24
- Pin to a specific version:
25
-
26
- ```bash
27
- pip install RepoPackPy==0.1.1
28
- ```
29
-
30
- Requires Python 3.10+.
31
-
32
- ### Quick start after install
33
-
34
- ```bash
35
- # Verify the install
36
- repopack --help
37
-
38
- # Pack your project
39
- repopack pack . -o my-workspace.json
40
-
41
- # Restore it somewhere else
42
- repopack unpack my-workspace.json -t ./restored
43
- ```
44
-
45
- ### For development
46
-
47
- Clone the repo and install in editable mode with test dependencies:
48
-
49
- ```bash
50
- git clone https://github.com/ShanKonduru/RepoPack.git
51
- cd RepoPack
52
- pip install -e ".[dev]"
53
- ```
54
-
55
- ## CLI Usage
56
-
57
- ```bash
58
- # Pack a directory into JSON
59
- repopack pack [DIRECTORY] [-o output.json] [--include-binary] [--custom-ignore ".next,dist"]
60
-
61
- # Unpack JSON back into a directory
62
- repopack unpack <input.json> [-t TARGET_DIR] [--force]
63
-
64
- # Start the MCP server (stdio transport)
65
- repopack serve
66
- ```
67
-
68
- ### Examples
69
-
70
- ```bash
71
- # Pack current directory, write to file
72
- repopack pack . -o workspace.json
73
-
74
- # Pack a specific project, include binaries
75
- repopack pack ~/projects/my-app -o my-app.json --include-binary
76
-
77
- # Unpack into a new directory
78
- repopack unpack workspace.json -t ./restored
79
-
80
- # Unpack and overwrite existing files
81
- repopack unpack workspace.json -t ./restored --force
82
- ```
83
-
84
- ## JSON Payload Schema
85
-
86
- ```json
87
- {
88
- "version": "1.0",
89
- "metadata": {
90
- "created_at": "2026-07-26T12:00:00Z",
91
- "root_directory_name": "my-app",
92
- "detected_stack": ["Node.js", "React", "TypeScript"],
93
- "total_files": 38,
94
- "total_bytes": 128450
95
- },
96
- "files": [
97
- { "path": "src/App.tsx", "encoding": "utf-8", "content": "..." },
98
- { "path": "public/favicon.ico", "encoding": "base64", "content": "..." }
99
- ]
100
- }
101
- ```
102
-
103
- ## MCP Server Tools
104
-
105
- When running `repopack serve`, two tools are registered via FastMCP:
106
-
107
- | Tool | Description |
108
- |---|---|
109
- | `export_workspace(workspace_path, output_json_path, include_binary)` | Pack a directory into JSON |
110
- | `import_workspace(json_input, destination_path, overwrite)` | Unpack JSON into a directory |
111
-
112
- ## Project Structure
113
-
114
- ```
115
- repopack/
116
- ├── pyproject.toml
117
- ├── README.md
118
- └── repopack/
119
- ├── __init__.py
120
- ├── cli.py # Typer CLI (pack / unpack / serve)
121
- ├── mcp_server.py # FastMCP server
122
- ├── packer.py # Directory walker & JSON builder
123
- ├── unpacker.py # JSON extractor & path-safe reconstructor
124
- └── utils.py # Ignore engine, binary detector, stack detection
125
- tests/
126
- └── test_repopack.py # 26-test pytest suite
127
- ```
128
-
129
- ## Running Tests
130
-
131
- ```bash
132
- pytest tests/ -v
133
- ```
134
-
135
- ## Dependencies
136
-
137
- - [typer](https://typer.tiangolo.com/) — CLI framework
138
- - [mcp](https://github.com/modelcontextprotocol/python-sdk) — MCP SDK (FastMCP)
139
- - [pathspec](https://github.com/cpburnz/python-pathspec) — gitignore wildmatch pattern matching
@@ -1 +0,0 @@
1
- __version__ = "0.1.8"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes