RepoPackPy 0.1.7__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.
- repopackpy-0.1.9/PKG-INFO +215 -0
- repopackpy-0.1.9/README.md +201 -0
- {repopackpy-0.1.7 → repopackpy-0.1.9}/pyproject.toml +1 -1
- repopackpy-0.1.9/repopack/__init__.py +1 -0
- {repopackpy-0.1.7 → repopackpy-0.1.9}/repopack/cli.py +20 -4
- {repopackpy-0.1.7 → repopackpy-0.1.9}/repopack/mcp_server.py +18 -2
- {repopackpy-0.1.7 → repopackpy-0.1.9}/repopack/packer.py +18 -3
- {repopackpy-0.1.7 → repopackpy-0.1.9}/repopack/unpacker.py +24 -1
- repopackpy-0.1.7/PKG-INFO +0 -153
- repopackpy-0.1.7/README.md +0 -139
- repopackpy-0.1.7/repopack/__init__.py +0 -1
- {repopackpy-0.1.7 → repopackpy-0.1.9}/.github/workflows/ci.yml +0 -0
- {repopackpy-0.1.7 → repopackpy-0.1.9}/.github/workflows/publish.yml +0 -0
- {repopackpy-0.1.7 → repopackpy-0.1.9}/.github/workflows/security.yml +0 -0
- {repopackpy-0.1.7 → repopackpy-0.1.9}/.gitignore +0 -0
- {repopackpy-0.1.7 → repopackpy-0.1.9}/CLAUDE.md +0 -0
- {repopackpy-0.1.7 → repopackpy-0.1.9}/LICENSE +0 -0
- {repopackpy-0.1.7 → repopackpy-0.1.9}/repopack/utils.py +0 -0
- {repopackpy-0.1.7 → repopackpy-0.1.9}/system_prompt.txt +0 -0
- {repopackpy-0.1.7 → repopackpy-0.1.9}/tests/test_repopack.py +0 -0
|
@@ -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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.9"
|
|
@@ -60,14 +60,22 @@ def pack(
|
|
|
60
60
|
output: str = typer.Option(None, "-o", "--output", help="Output JSON file path."),
|
|
61
61
|
include_binary: bool = typer.Option(False, "--include-binary", help="Include binary files."),
|
|
62
62
|
custom_ignore: str = typer.Option(None, "--custom-ignore", help="Comma-separated extra ignore patterns."),
|
|
63
|
+
dry_run: bool = typer.Option(False, "--dry-run", help="Report files that would be packed without writing output."),
|
|
63
64
|
):
|
|
64
65
|
try:
|
|
65
|
-
result = pack_workspace(Path(directory), include_binary, custom_ignore)
|
|
66
|
+
result = pack_workspace(Path(directory), include_binary, custom_ignore, dry_run=dry_run)
|
|
67
|
+
if dry_run:
|
|
68
|
+
typer.echo(f"Dry run — would pack {result['total_files']} files ({result['total_bytes']} bytes)")
|
|
69
|
+
typer.echo(f"Root : {result['root_directory']}")
|
|
70
|
+
typer.echo(f"Stack : {', '.join(result['detected_stack']) or 'unknown'}")
|
|
71
|
+
for f in result["files"]:
|
|
72
|
+
typer.echo(f" {f['encoding']:6} {f['size']:>10} {f['path']}")
|
|
73
|
+
return
|
|
66
74
|
if output:
|
|
67
75
|
with open(output, "w", encoding="utf-8") as f:
|
|
68
76
|
json.dump(result, f, indent=2)
|
|
69
|
-
total_files = result.get("total_files", 0)
|
|
70
|
-
total_bytes = result.get("total_bytes", 0)
|
|
77
|
+
total_files = result.get("metadata", {}).get("total_files", 0)
|
|
78
|
+
total_bytes = result.get("metadata", {}).get("total_bytes", 0)
|
|
71
79
|
typer.echo(f"Packed {total_files} files ({total_bytes} bytes) -> {output}", err=True)
|
|
72
80
|
else:
|
|
73
81
|
print(json.dumps(result, indent=2))
|
|
@@ -81,9 +89,17 @@ def unpack(
|
|
|
81
89
|
input: str = typer.Argument(..., help="File path or raw JSON string to unpack."),
|
|
82
90
|
target: str = typer.Option(".", "-t", "--target", help="Output directory."),
|
|
83
91
|
force: bool = typer.Option(False, "--force/--no-force", help="Overwrite existing files."),
|
|
92
|
+
dry_run: bool = typer.Option(False, "--dry-run", help="Report files that would be unpacked without writing anything."),
|
|
84
93
|
):
|
|
85
94
|
try:
|
|
86
|
-
result = unpack_workspace(input, Path(target), overwrite=force)
|
|
95
|
+
result = unpack_workspace(input, Path(target), overwrite=force, dry_run=dry_run)
|
|
96
|
+
if dry_run:
|
|
97
|
+
typer.echo(f"Dry run — destination: {result['destination']}")
|
|
98
|
+
typer.echo(f" Would extract : {result['would_extract']}")
|
|
99
|
+
typer.echo(f" Would skip : {result['would_skip']}")
|
|
100
|
+
for f in result["files"]:
|
|
101
|
+
typer.echo(f" {f['action']:20} {f['path']}")
|
|
102
|
+
return
|
|
87
103
|
extracted = result.get("extracted", 0)
|
|
88
104
|
destination = result.get("destination", target)
|
|
89
105
|
skipped = result.get("skipped", 0)
|
|
@@ -14,8 +14,16 @@ def export_workspace(
|
|
|
14
14
|
workspace_path: str = ".",
|
|
15
15
|
output_json_path: str | None = None,
|
|
16
16
|
include_binary: bool = False,
|
|
17
|
+
dry_run: bool = False,
|
|
17
18
|
) -> str:
|
|
18
|
-
result = pack_workspace(Path(workspace_path), include_binary=include_binary)
|
|
19
|
+
result = pack_workspace(Path(workspace_path), include_binary=include_binary, dry_run=dry_run)
|
|
20
|
+
if dry_run:
|
|
21
|
+
lines = [
|
|
22
|
+
f"Dry run — would pack {result['total_files']} files ({result['total_bytes']} bytes)",
|
|
23
|
+
f"Root : {result['root_directory']}",
|
|
24
|
+
f"Stack : {', '.join(result['detected_stack']) or 'unknown'}",
|
|
25
|
+
] + [f" {f['encoding']:6} {f['size']:>10} {f['path']}" for f in result["files"]]
|
|
26
|
+
return "\n".join(lines)
|
|
19
27
|
if output_json_path is not None:
|
|
20
28
|
with open(output_json_path, "w", encoding="utf-8") as f:
|
|
21
29
|
json.dump(result, f, indent=2)
|
|
@@ -28,8 +36,16 @@ def import_workspace(
|
|
|
28
36
|
json_input: str,
|
|
29
37
|
destination_path: str,
|
|
30
38
|
overwrite: bool = False,
|
|
39
|
+
dry_run: bool = False,
|
|
31
40
|
) -> str:
|
|
32
|
-
summary = unpack_workspace(json_input, Path(destination_path), overwrite=overwrite)
|
|
41
|
+
summary = unpack_workspace(json_input, Path(destination_path), overwrite=overwrite, dry_run=dry_run)
|
|
42
|
+
if dry_run:
|
|
43
|
+
lines = [
|
|
44
|
+
f"Dry run — destination: {summary['destination']}",
|
|
45
|
+
f" Would extract : {summary['would_extract']}",
|
|
46
|
+
f" Would skip : {summary['would_skip']}",
|
|
47
|
+
] + [f" {f['action']:20} {f['path']}" for f in summary["files"]]
|
|
48
|
+
return "\n".join(lines)
|
|
33
49
|
return f"Extracted {summary['extracted']} files to {summary['destination']} ({summary['skipped']} skipped)"
|
|
34
50
|
|
|
35
51
|
|
|
@@ -13,6 +13,7 @@ def pack_workspace(
|
|
|
13
13
|
directory: Path,
|
|
14
14
|
include_binary: bool = False,
|
|
15
15
|
custom_ignore: str | None = None,
|
|
16
|
+
dry_run: bool = False,
|
|
16
17
|
) -> dict:
|
|
17
18
|
directory = directory.resolve()
|
|
18
19
|
|
|
@@ -58,21 +59,25 @@ def pack_workspace(
|
|
|
58
59
|
if binary and not include_binary:
|
|
59
60
|
continue
|
|
60
61
|
|
|
62
|
+
encoding = "base64" if binary else "utf-8"
|
|
63
|
+
total_bytes += file_size
|
|
64
|
+
|
|
65
|
+
if dry_run:
|
|
66
|
+
files.append({"path": rel_path.as_posix(), "encoding": encoding, "size": file_size})
|
|
67
|
+
continue
|
|
68
|
+
|
|
61
69
|
if binary:
|
|
62
70
|
try:
|
|
63
71
|
raw = file_path.read_bytes()
|
|
64
72
|
except OSError:
|
|
65
73
|
continue
|
|
66
74
|
content = base64.b64encode(raw).decode("ascii")
|
|
67
|
-
encoding = "base64"
|
|
68
75
|
else:
|
|
69
76
|
try:
|
|
70
77
|
content = file_path.read_text(encoding="utf-8", errors="replace")
|
|
71
78
|
except OSError:
|
|
72
79
|
continue
|
|
73
|
-
encoding = "utf-8"
|
|
74
80
|
|
|
75
|
-
total_bytes += file_size
|
|
76
81
|
files.append(
|
|
77
82
|
{
|
|
78
83
|
"path": rel_path.as_posix(),
|
|
@@ -83,6 +88,16 @@ def pack_workspace(
|
|
|
83
88
|
|
|
84
89
|
detected_stack = detect_stack(directory)
|
|
85
90
|
|
|
91
|
+
if dry_run:
|
|
92
|
+
return {
|
|
93
|
+
"dry_run": True,
|
|
94
|
+
"root_directory": str(directory),
|
|
95
|
+
"detected_stack": detected_stack,
|
|
96
|
+
"total_files": len(files),
|
|
97
|
+
"total_bytes": total_bytes,
|
|
98
|
+
"files": files,
|
|
99
|
+
}
|
|
100
|
+
|
|
86
101
|
return {
|
|
87
102
|
"version": "1.0",
|
|
88
103
|
"metadata": {
|
|
@@ -11,6 +11,7 @@ def unpack_workspace(
|
|
|
11
11
|
destination_path: Path,
|
|
12
12
|
overwrite: bool = False,
|
|
13
13
|
force: bool = False,
|
|
14
|
+
dry_run: bool = False,
|
|
14
15
|
) -> dict:
|
|
15
16
|
if Path(json_input).is_file():
|
|
16
17
|
with open(json_input, "r", encoding="utf-8") as f:
|
|
@@ -25,6 +26,7 @@ def unpack_workspace(
|
|
|
25
26
|
|
|
26
27
|
extracted = 0
|
|
27
28
|
skipped = 0
|
|
29
|
+
dry_run_files: list[dict] = []
|
|
28
30
|
|
|
29
31
|
for entry in data["files"]:
|
|
30
32
|
rel = entry.get("path", "")
|
|
@@ -40,8 +42,20 @@ def unpack_workspace(
|
|
|
40
42
|
raise ValueError(f"Path traversal detected: {rel}")
|
|
41
43
|
|
|
42
44
|
output_path = destination_path / rel_path
|
|
45
|
+
would_skip = output_path.exists() and not overwrite
|
|
46
|
+
|
|
47
|
+
if dry_run:
|
|
48
|
+
dry_run_files.append({
|
|
49
|
+
"path": rel,
|
|
50
|
+
"action": "skip (exists)" if would_skip else "create",
|
|
51
|
+
})
|
|
52
|
+
if would_skip:
|
|
53
|
+
skipped += 1
|
|
54
|
+
else:
|
|
55
|
+
extracted += 1
|
|
56
|
+
continue
|
|
43
57
|
|
|
44
|
-
if
|
|
58
|
+
if would_skip:
|
|
45
59
|
skipped += 1
|
|
46
60
|
continue
|
|
47
61
|
|
|
@@ -57,4 +71,13 @@ def unpack_workspace(
|
|
|
57
71
|
|
|
58
72
|
extracted += 1
|
|
59
73
|
|
|
74
|
+
if dry_run:
|
|
75
|
+
return {
|
|
76
|
+
"dry_run": True,
|
|
77
|
+
"destination": str(destination_path),
|
|
78
|
+
"would_extract": extracted,
|
|
79
|
+
"would_skip": skipped,
|
|
80
|
+
"files": dry_run_files,
|
|
81
|
+
}
|
|
82
|
+
|
|
60
83
|
return {"extracted": extracted, "skipped": skipped, "destination": str(destination_path)}
|
repopackpy-0.1.7/PKG-INFO
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: RepoPackPy
|
|
3
|
-
Version: 0.1.7
|
|
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
|
repopackpy-0.1.7/README.md
DELETED
|
@@ -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.7"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|