repo-cloak-cli 1.3.1 → 1.3.3

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.
@@ -1,92 +1,92 @@
1
- name: Release & Publish
2
-
3
- on:
4
- # Manual trigger with version bump
5
- workflow_dispatch:
6
- inputs:
7
- version_type:
8
- description: 'Version bump type'
9
- required: true
10
- default: 'patch'
11
- type: choice
12
- options:
13
- - patch
14
- - minor
15
- - major
16
-
17
- # Auto-publish on push (only if version changed)
18
- push:
19
- branches:
20
- - main
21
- - master
22
- paths:
23
- - 'package.json'
24
- - 'src/**'
25
- - 'bin/**'
26
-
27
- jobs:
28
- release:
29
- runs-on: ubuntu-latest
30
-
31
- steps:
32
- - name: 🎭 Checkout repository
33
- uses: actions/checkout@v4
34
- with:
35
- token: ${{ secrets.GITHUB_TOKEN }}
36
- fetch-depth: 0
37
-
38
- - name: đŸ“Ļ Setup Node.js
39
- uses: actions/setup-node@v4
40
- with:
41
- node-version: '20'
42
- registry-url: 'https://registry.npmjs.org'
43
-
44
- - name: 🔧 Configure Git
45
- run: |
46
- git config user.name "github-actions[bot]"
47
- git config user.email "github-actions[bot]@users.noreply.github.com"
48
-
49
- - name: đŸ“Ĩ Install dependencies
50
- run: npm ci
51
-
52
- - name: 📝 Bump version (manual trigger only)
53
- if: github.event_name == 'workflow_dispatch'
54
- run: |
55
- npm version ${{ inputs.version_type }} -m "chore: release v%s"
56
- git push --follow-tags
57
-
58
- - name: 🔍 Check if version exists on npm
59
- id: check_version
60
- run: |
61
- PACKAGE_NAME=$(node -p "require('./package.json').name")
62
- LOCAL_VERSION=$(node -p "require('./package.json').version")
63
-
64
- # Check if this version already exists on npm
65
- NPM_VERSION=$(npm view $PACKAGE_NAME version 2>/dev/null || echo "0.0.0")
66
-
67
- echo "Local version: $LOCAL_VERSION"
68
- echo "npm version: $NPM_VERSION"
69
-
70
- if [ "$LOCAL_VERSION" = "$NPM_VERSION" ]; then
71
- echo "should_publish=false" >> $GITHUB_OUTPUT
72
- echo "â­ī¸ Version $LOCAL_VERSION already exists on npm, skipping publish"
73
- else
74
- echo "should_publish=true" >> $GITHUB_OUTPUT
75
- echo "✅ Version $LOCAL_VERSION is new, will publish"
76
- fi
77
-
78
- - name: 🚀 Publish to npm
79
- if: steps.check_version.outputs.should_publish == 'true'
80
- run: |
81
- npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
82
- npm publish --access public
83
- env:
84
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
85
-
86
- - name: ✅ Done
87
- run: |
88
- if [ "${{ steps.check_version.outputs.should_publish }}" = "true" ]; then
89
- echo "🎉 Published successfully!"
90
- else
91
- echo "â„šī¸ No publish needed - version unchanged"
92
- fi
1
+ name: Release & Publish
2
+
3
+ on:
4
+ # Manual trigger with version bump
5
+ workflow_dispatch:
6
+ inputs:
7
+ version_type:
8
+ description: 'Version bump type'
9
+ required: true
10
+ default: 'patch'
11
+ type: choice
12
+ options:
13
+ - patch
14
+ - minor
15
+ - major
16
+
17
+ # Auto-publish on push (only if version changed)
18
+ push:
19
+ branches:
20
+ - main
21
+ - master
22
+ paths:
23
+ - 'package.json'
24
+ - 'src/**'
25
+ - 'bin/**'
26
+
27
+ jobs:
28
+ release:
29
+ runs-on: ubuntu-latest
30
+
31
+ steps:
32
+ - name: 🎭 Checkout repository
33
+ uses: actions/checkout@v4
34
+ with:
35
+ token: ${{ secrets.GITHUB_TOKEN }}
36
+ fetch-depth: 0
37
+
38
+ - name: đŸ“Ļ Setup Node.js
39
+ uses: actions/setup-node@v4
40
+ with:
41
+ node-version: '20'
42
+ registry-url: 'https://registry.npmjs.org'
43
+
44
+ - name: 🔧 Configure Git
45
+ run: |
46
+ git config user.name "github-actions[bot]"
47
+ git config user.email "github-actions[bot]@users.noreply.github.com"
48
+
49
+ - name: đŸ“Ĩ Install dependencies
50
+ run: npm ci
51
+
52
+ - name: 📝 Bump version (manual trigger only)
53
+ if: github.event_name == 'workflow_dispatch'
54
+ run: |
55
+ npm version ${{ inputs.version_type }} -m "chore: release v%s"
56
+ git push --follow-tags
57
+
58
+ - name: 🔍 Check if version exists on npm
59
+ id: check_version
60
+ run: |
61
+ PACKAGE_NAME=$(node -p "require('./package.json').name")
62
+ LOCAL_VERSION=$(node -p "require('./package.json').version")
63
+
64
+ # Check if this version already exists on npm
65
+ NPM_VERSION=$(npm view $PACKAGE_NAME version 2>/dev/null || echo "0.0.0")
66
+
67
+ echo "Local version: $LOCAL_VERSION"
68
+ echo "npm version: $NPM_VERSION"
69
+
70
+ if [ "$LOCAL_VERSION" = "$NPM_VERSION" ]; then
71
+ echo "should_publish=false" >> $GITHUB_OUTPUT
72
+ echo "â­ī¸ Version $LOCAL_VERSION already exists on npm, skipping publish"
73
+ else
74
+ echo "should_publish=true" >> $GITHUB_OUTPUT
75
+ echo "✅ Version $LOCAL_VERSION is new, will publish"
76
+ fi
77
+
78
+ - name: 🚀 Publish to npm
79
+ if: steps.check_version.outputs.should_publish == 'true'
80
+ run: |
81
+ npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
82
+ npm publish --access public
83
+ env:
84
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
85
+
86
+ - name: ✅ Done
87
+ run: |
88
+ if [ "${{ steps.check_version.outputs.should_publish }}" = "true" ]; then
89
+ echo "🎉 Published successfully!"
90
+ else
91
+ echo "â„šī¸ No publish needed - version unchanged"
92
+ fi
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2024
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,118 +1,138 @@
1
- # repo-cloak 🎭
2
-
3
- > **Selectively extract and anonymize files from repositories**
4
-
5
- Perfect for sharing code with AI agents without exposing proprietary details. Extract specific files, replace sensitive information (company names, project names, etc.), and restore them later.
6
-
7
- [![npm version](https://img.shields.io/npm/v/repo-cloak-cli.svg)](https://www.npmjs.com/package/repo-cloak-cli)
8
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
-
10
- ## ✨ Features
11
-
12
- - 🔍 **Interactive file browser** - Navigate and select files with a beautiful TUI
13
- - 🎭 **Smart anonymization** - Replace sensitive keywords while preserving case
14
- - 📁 **Structure preservation** - Maintains original folder hierarchy
15
- - 🔄 **Push/Pull workflow** - Extract files, work on them, push back with original names
16
- - 💾 **Mapping file** - Tracks all replacements for seamless restoration
17
- - 🌍 **Cross-platform** - Works on Windows, macOS, and Linux
18
-
19
- ## đŸ“Ļ Installation
20
-
21
- ```bash
22
- npm install -g repo-cloak-cli
23
- ```
24
-
25
- Or use directly with npx:
26
-
27
- ```bash
28
- npx repo-cloak-cli
29
- ```
30
-
31
- ## 🚀 Quick Start
32
-
33
- ### Pull (Extract & Anonymize)
34
-
35
- ```bash
36
- # Interactive mode
37
- repo-cloak pull
38
-
39
- # With options
40
- repo-cloak pull --source ./my-project --dest ./extracted
41
- ```
42
-
43
- 1. Select files/folders to extract
44
- 2. Enter destination path
45
- 3. Add keyword replacements (e.g., "Microsoft Corp" → "ACME Inc")
46
- 4. Confirm and extract!
47
-
48
- ### Push (Restore)
49
-
50
- ```bash
51
- # Interactive mode
52
- repo-cloak push
53
-
54
- # With options
55
- repo-cloak push --source ./extracted --dest ./my-project
56
- ```
57
-
58
- Restores all files with original keywords replaced back.
59
-
60
- ## đŸŽ¯ Use Cases
61
-
62
- - **AI Code Review** - Share proprietary code with AI tools by anonymizing company/project names
63
- - **Open Source Templates** - Extract project templates while removing internal references
64
- - **Code Samples** - Create sanitized examples from production code
65
- - **Compliance** - Remove sensitive identifiers before sharing code externally
66
-
67
- ## 📋 Commands
68
-
69
- | Command | Description |
70
- |---------|-------------|
71
- | `repo-cloak` | Interactive menu to choose pull or push |
72
- | `repo-cloak pull` | Extract and anonymize files |
73
- | `repo-cloak push` | Restore files with original names |
74
- | `repo-cloak --help` | Show help |
75
- | `repo-cloak --version` | Show version |
76
-
77
- ## 🔧 Options
78
-
79
- ### Pull Options
80
- - `-s, --source <path>` - Source directory (default: current directory)
81
- - `-d, --dest <path>` - Destination directory
82
- - `-q, --quiet` - Minimal output
83
-
84
- ### Push Options
85
- - `-s, --source <path>` - Cloaked backup directory
86
- - `-d, --dest <path>` - Destination directory
87
- - `-q, --quiet` - Minimal output
88
-
89
- ## 📁 How It Works
90
-
91
- 1. **Pull** creates a `.repo-cloak-map.json` file in the destination that stores:
92
- - Original source path
93
- - All keyword replacements
94
- - File list with mappings
95
- - Timestamp
96
-
97
- 2. **Push** reads this mapping file to:
98
- - Reverse all keyword replacements
99
- - Restore files to original or new location
100
-
101
- ## 🔒 Privacy by Design
102
-
103
- - No data is sent to any external servers
104
- - All processing happens locally
105
- - Binary files are copied without modification
106
- - Hidden files and common ignored directories (node_modules, .git) are skipped
107
-
108
- ## 🤝 Contributing
109
-
110
- Contributions are welcome! Please feel free to submit a Pull Request.
111
-
112
- ## 📄 License
113
-
114
- MIT Š Shazni Shiraz
115
-
116
- ---
117
-
118
- Made with â¤ī¸ for developers who need to share code safely
1
+ # repo-cloak 🎭
2
+
3
+ > **Selectively extract and anonymize files from repositories**
4
+
5
+ Perfect for sharing code with AI agents without exposing proprietary details. Extract specific files, replace sensitive information (company names, project names, etc.), and restore them later.
6
+
7
+ [![npm version](https://img.shields.io/npm/v/repo-cloak-cli.svg)](https://www.npmjs.com/package/repo-cloak-cli)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+
10
+ ## ✨ Features
11
+
12
+ - 🔍 **Interactive file browser** - Navigate and select files with a beautiful TUI
13
+ - 🎭 **Smart anonymization** - Replace sensitive keywords while preserving case
14
+ - 📁 **Structure preservation** - Maintains original folder hierarchy
15
+ - 🔄 **Push/Pull workflow** - Extract files, work on them, push back with original names
16
+ - 💾 **Mapping file** - Tracks all replacements for seamless restoration
17
+ - 🌍 **Cross-platform** - Works on Windows, macOS, and Linux
18
+
19
+ ## đŸ“Ļ Installation
20
+
21
+ ```bash
22
+ npm install -g repo-cloak-cli
23
+ ```
24
+
25
+ ### To install locally
26
+
27
+ ```bash
28
+ npm install D:\Projects\repo-cloak
29
+ ```
30
+
31
+ Or use directly with npx:
32
+
33
+ ```bash
34
+ npx repo-cloak-cli
35
+ ```
36
+
37
+ ## 🚀 Quick Start
38
+
39
+ ### Pull (Extract & Anonymize)
40
+
41
+ ```bash
42
+ # Interactive mode
43
+ repo-cloak pull
44
+
45
+ # With options
46
+ repo-cloak pull --source ./my-project --dest ./extracted
47
+ ```
48
+
49
+ 1. Select files/folders to extract
50
+ 2. Enter destination path
51
+ 3. Add keyword replacements (e.g., "Microsoft Corp" → "ACME Inc")
52
+ 4. Confirm and extract!
53
+
54
+ ### Push (Restore)
55
+
56
+ ```bash
57
+ # Interactive mode
58
+ repo-cloak push
59
+
60
+ # With options
61
+ repo-cloak push --source ./extracted --dest ./my-project
62
+ ```
63
+
64
+ Restores all files with original keywords replaced back.
65
+
66
+ ### Force Update
67
+
68
+ To quickly re-pull or re-push without interactive prompts (useful for scripts):
69
+
70
+ ```bash
71
+ # Update existing cloaked directory from source
72
+ repo-cloak pull --force
73
+
74
+ # Restore cloaked files to original source
75
+ repo-cloak push --force
76
+ ```
77
+
78
+ ## đŸŽ¯ Use Cases
79
+
80
+ - **AI Code Review** - Share proprietary code with AI tools by anonymizing company/project names
81
+ - **Open Source Templates** - Extract project templates while removing internal references
82
+ - **Code Samples** - Create sanitized examples from production code
83
+ - **Compliance** - Remove sensitive identifiers before sharing code externally
84
+
85
+ ## 📋 Commands
86
+
87
+ | Command | Description |
88
+ |---------|-------------|
89
+ | `repo-cloak` | Interactive menu to choose pull or push |
90
+ | `repo-cloak pull` | Extract and anonymize files |
91
+ | `repo-cloak push` | Restore files with original names |
92
+ | `repo-cloak --help` | Show help |
93
+ | `repo-cloak --version` | Show version |
94
+
95
+ ## 🔧 Options
96
+
97
+ ### Pull Options
98
+ - `-s, --source <path>` - Source directory (default: current directory)
99
+ - `-d, --dest <path>` - Destination directory
100
+ - `-f, --force` - Force pull all files (skip prompts, requires existing mapping)
101
+ - `-q, --quiet` - Minimal output
102
+
103
+ ### Push Options
104
+ - `-s, --source <path>` - Cloaked backup directory
105
+ - `-d, --dest <path>` - Destination directory
106
+ - `-f, --force` - Force push/restore all files (skip confirmation)
107
+ - `-q, --quiet` - Minimal output
108
+
109
+ ## 📁 How It Works
110
+
111
+ 1. **Pull** creates a `.repo-cloak-map.json` file in the destination that stores:
112
+ - Original source path
113
+ - All keyword replacements
114
+ - File list with mappings
115
+ - Timestamp
116
+
117
+ 2. **Push** reads this mapping file to:
118
+ - Reverse all keyword replacements
119
+ - Restore files to original or new location
120
+
121
+ ## 🔒 Privacy by Design
122
+
123
+ - No data is sent to any external servers
124
+ - All processing happens locally
125
+ - Binary files are copied without modification
126
+ - Hidden files and common ignored directories (node_modules, .git) are skipped
127
+
128
+ ## 🤝 Contributing
129
+
130
+ Contributions are welcome! Please feel free to submit a Pull Request.
131
+
132
+ ## 📄 License
133
+
134
+ MIT Š Shazni Shiraz
135
+
136
+ ---
137
+
138
+ Made with â¤ī¸ for developers who need to share code safely
package/bin/repo-cloak.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
-
3
- /**
4
- * repo-cloak CLI Entry Point
5
- * 🎭 Selectively extract and anonymize files from repositories
6
- */
7
-
8
- import { run } from '../src/cli.js';
9
-
10
- run();
2
+
3
+ /**
4
+ * repo-cloak CLI Entry Point
5
+ * 🎭 Selectively extract and anonymize files from repositories
6
+ */
7
+
8
+ import { run } from '../src/cli.js';
9
+
10
+ run();
package/package.json CHANGED
@@ -1,51 +1,51 @@
1
- {
2
- "name": "repo-cloak-cli",
3
- "version": "1.3.1",
4
- "description": "🎭 Selectively extract and anonymize files from repositories. Perfect for sharing code with AI agents without exposing proprietary details.",
5
- "main": "src/index.js",
6
- "type": "module",
7
- "bin": {
8
- "repo-cloak": "./bin/repo-cloak.js",
9
- "cloak": "./bin/repo-cloak.js"
10
- },
11
- "scripts": {
12
- "start": "node bin/repo-cloak.js",
13
- "test": "vitest run",
14
- "test:watch": "vitest",
15
- "lint": "eslint src/"
16
- },
17
- "keywords": [
18
- "cli",
19
- "anonymize",
20
- "extract",
21
- "repository",
22
- "code",
23
- "privacy",
24
- "ai",
25
- "llm",
26
- "obfuscate",
27
- "cloak",
28
- "mask",
29
- "sanitize"
30
- ],
31
- "author": "",
32
- "license": "MIT",
33
- "repository": {
34
- "type": "git",
35
- "url": ""
36
- },
37
- "engines": {
38
- "node": ">=18.0.0"
39
- },
40
- "dependencies": {
41
- "chalk": "^5.3.0",
42
- "commander": "^12.1.0",
43
- "figlet": "^1.7.0",
44
- "glob": "^10.3.10",
45
- "inquirer": "^9.2.12",
46
- "ora": "^8.0.1"
47
- },
48
- "devDependencies": {
49
- "vitest": "^4.0.18"
50
- }
51
- }
1
+ {
2
+ "name": "repo-cloak-cli",
3
+ "version": "1.3.3",
4
+ "description": "🎭 Selectively extract and anonymize files from repositories. Perfect for sharing code with AI agents without exposing proprietary details.",
5
+ "main": "src/index.js",
6
+ "type": "module",
7
+ "bin": {
8
+ "repo-cloak": "bin/repo-cloak.js",
9
+ "cloak": "bin/repo-cloak.js"
10
+ },
11
+ "scripts": {
12
+ "start": "node bin/repo-cloak.js",
13
+ "test": "vitest run",
14
+ "test:watch": "vitest",
15
+ "lint": "eslint src/"
16
+ },
17
+ "keywords": [
18
+ "cli",
19
+ "anonymize",
20
+ "extract",
21
+ "repository",
22
+ "code",
23
+ "privacy",
24
+ "ai",
25
+ "llm",
26
+ "obfuscate",
27
+ "cloak",
28
+ "mask",
29
+ "sanitize"
30
+ ],
31
+ "author": "iamshz97",
32
+ "license": "MIT",
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/iamshz97/repo-cloak.git"
36
+ },
37
+ "engines": {
38
+ "node": ">=18.0.0"
39
+ },
40
+ "dependencies": {
41
+ "chalk": "^5.3.0",
42
+ "commander": "^12.1.0",
43
+ "figlet": "^1.7.0",
44
+ "glob": "^10.3.10",
45
+ "inquirer": "^9.2.12",
46
+ "ora": "^8.0.1"
47
+ },
48
+ "devDependencies": {
49
+ "vitest": "^4.0.18"
50
+ }
51
+ }