{"id":41703016,"url":"https://github.com/aioue/pilfer","last_synced_at":"2026-04-01T22:21:46.068Z","repository":{"id":150646916,"uuid":"147849544","full_name":"aioue/pilfer","owner":"aioue","description":"Bulk decrypt all ansible-vault files recursively for search/editing, then re-encrypt them.","archived":false,"fork":false,"pushed_at":"2026-03-21T22:11:10.000Z","size":76,"stargazers_count":4,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-22T10:49:04.153Z","etag":null,"topics":["ansible","ansible-vault","bulk","decrypt","encrypt"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aioue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-09-07T16:35:48.000Z","updated_at":"2026-03-21T22:11:13.000Z","dependencies_parsed_at":"2023-06-12T05:00:23.562Z","dependency_job_id":null,"html_url":"https://github.com/aioue/pilfer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/aioue/pilfer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aioue%2Fpilfer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aioue%2Fpilfer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aioue%2Fpilfer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aioue%2Fpilfer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aioue","download_url":"https://codeload.github.com/aioue/pilfer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aioue%2Fpilfer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-vault","bulk","decrypt","encrypt"],"created_at":"2026-01-24T21:03:11.911Z","updated_at":"2026-04-01T22:21:46.061Z","avatar_url":"https://github.com/aioue.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pilfer\n\n[![CI](https://github.com/aioue/pilfer/workflows/CI/badge.svg)](https://github.com/aioue/pilfer/actions)\n[![Test Suite](https://github.com/aioue/pilfer/workflows/Test%20Suite/badge.svg)](https://github.com/aioue/pilfer/actions)\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\nDecrypt *all* ansible vault files in a project recursively for search/editing, then re-encrypt them all at once when you're done.\n\nBorrows heavily from the excellent, but no longer supported [Ansible Toolkit](https://github.com/dellis23/ansible-toolkit).\n\n**Updated for Python 3 compatibility with modern features and ansible.cfg integration.**\n\nTested with Ansible v2.18.x and Python 3.12.x\n\n## Features\n\n- **Python 3 compatible** - Modernized for current Python versions\n- **ansible.cfg integration** - Automatically reads `vault_password_file` from your ansible.cfg\n- **Change detection** - Only re-encrypts files that were actually modified (using SHA256)\n- **Safe operation** - Preserves original encrypted content for unchanged files\n- **No third-party dependencies** - Uses Ansible's official vault implementation directly\n- **Binary data preservation** - Preserves exact line endings and formatting (critical for certificates)\n\n## Usage\n```\npilfer [open|close] [-p VAULT_PASSWORD_FILE]\n```\n\n### Basic Usage\n\n**Option 1: Standalone Script (No Installation)**\n- Download `pilfer.py` and place it in your Ansible project directory\n- Run `python pilfer.py open` to decrypt all vaulted files recursively\n- Edit/search plaintext as needed\n- Run `python pilfer.py close` to re-encrypt any changed files\n\n**Option 2: Installed via pipx (Recommended)**\n- Install pilfer via pipx: `pipx install pilfer`\n- Run `pilfer open` to decrypt all vaulted files recursively\n- Edit/search plaintext as needed\n- Run `pilfer close` to re-encrypt any changed files\n\nAny unchanged files will be returned to their original state.\n\n### Vault Password File Detection\n\nThe script automatically detects your vault password file in this order:\n\n1. **Command line argument**: `-p /path/to/vault/file`\n2. **ansible.cfg**: Reads `vault_password_file` from `[defaults]` section\n3. **Common locations**: \n   - `~/.ansible-vault/.vault-file`\n   - `../../vault_password_file` \n   - `.vault_password`\n   - `vault_password_file`\n\n### Examples\n\n**Using the installed version:**\n```bash\n# Use ansible.cfg vault_password_file setting (recommended)\npilfer open\n\n# Specify custom vault password file\npilfer open -p ~/.my-vault-password\n\n# Close and re-encrypt modified files\npilfer close\n```\n\n**Using the standalone script:**\n```bash\n# Use ansible.cfg vault_password_file setting (recommended)\npython pilfer.py open\n\n# Specify custom vault password file\npython pilfer.py open -p ~/.my-vault-password\n\n# Close and re-encrypt modified files\npython pilfer.py close\n```\n\n## Installation\n\n### Option 1: Standalone Script (No Installation Required)\n\nDownload and use the standalone script directly:\n\n```bash\n# Download the standalone script\ncurl -O https://raw.githubusercontent.com/aioue/pilfer/main/pilfer.py\n\n# Make it executable (required for ./pilfer.py usage)\nchmod +x pilfer.py\n\n# Use it directly\n./pilfer.py open\n# OR\npython pilfer.py open\n```\n\n### Option 2: Install via pipx (Recommended for Regular Use)\n\n**Python 3.6+** is required. Install pilfer using pipx for isolated CLI tool management:\n\n```bash\n# Install pilfer via pipx (recommended)\npipx install pilfer\n\n# Verify installation\npilfer --help\n```\n\n### Alternative Installation Methods\n\nIf you prefer other installation methods:\n\n```bash\n# Install from source (in development mode)\ngit clone https://github.com/aioue/pilfer.git\ncd pilfer\npip install -e .\n\n# Direct pip installation (not recommended for CLI tools)\npip install pilfer\n```\n\n### Requirements\n\nPilfer requires **Ansible** to be available. If not already installed:\n\n```bash\n# Using pipx (recommended for CLI tools)\npipx install ansible\n\n# Using pip\npip install ansible\n\n# System package manager\n# Ubuntu/Debian:\nsudo apt update \u0026\u0026 sudo apt install ansible\n\n# RHEL/CentOS/Fedora:\nsudo dnf install ansible\n\n# macOS:\nbrew install ansible\n```\n\n### ansible.cfg Setup (Recommended)\n\nAdd to your `ansible.cfg`:\n```ini\n[defaults]\nvault_password_file = ~/.ansible-vault/.vault-file\n```\n\nThis eliminates the need to manually configure vault password paths.\n\n## Development and Publishing\n\n### For Developers\n\nTo set up for development:\n\n```bash\n# Clone the repository\ngit clone https://github.com/aioue/pilfer.git\ncd pilfer\n\n# Install in development mode\npip install -e .\n\n# Make changes and test\npilfer --help\n```\n\n### Publishing to PyPI\n\nPrerequisites:\n```bash\n# Install build tools\npip install build twine\n\n# Configure PyPI credentials\n# ~/.pypirc or use environment variables\n```\n\nBuild and publish:\n```bash\n# Make the script executable\nchmod +x build_and_publish.sh\n\n# Publish to TestPyPI first\n./build_and_publish.sh test\n\n# After testing, publish to production PyPI\n./build_and_publish.sh prod\n```\n\nThe build script will:\n1. Clean previous builds\n2. Build the package using modern Python packaging\n3. Upload to PyPI/TestPyPI using twine\n4. Provide installation instructions\n\n## License\n\nThis project is licensed under the GNU General Public License v3 or later (GPLv3+). See the [LICENSE](../LICENSE) file for the complete license text from the [official GNU website](https://www.gnu.org/licenses/gpl-3.0.txt).\n\n### Packaging Note\n\nDue to a compatibility issue between modern setuptools (which supports SPDX license expressions) and PyPI's current metadata validation (which doesn't yet support the new format), the license file is renamed to `PILFER_LICENSE.txt` during packaging to avoid auto-detection issues. This is a temporary workaround until PyPI updates its metadata validation to support the newer standards.\n\nThis package heavily borrows from the excellent, but no longer supported [Ansible Toolkit](https://github.com/dellis23/ansible-toolkit).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faioue%2Fpilfer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faioue%2Fpilfer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faioue%2Fpilfer/lists"}