Инструмент командной строки для работы с файлами .bpt (шаблоны бизнес-процессов Bitrix)
Есть простая веб-версия для работы с файлами *.bpt 👉 Веб-версия
CLI-утилита для работы с файлами .bpt (шаблоны бизнес-процессов Bitrix):
- 📤 Извлечение содержимого (
dump) - 📦 Сборка обратно из текста (
build) - i️ Просмотр информации о файле (
info)
- gzip (gzencode)
- zlib (gzcompress)
- deflate (gzdeflate)
- plain (без сжатия)
📋 Готовые сборки (Windows/Linux/macOS):
👉 Releases · bitrix-bpt-tool
git clone https://github.com/bslie/bitrix-bpt-tool.git
cd bitrix-bpt-tool
dotnet buildТребования: .NET 9.0 SDK или новее
# Основная выгрузка dotnet run -- dump bp-179.bpt -o bp-179.txt # Человекочитаемый вывод (unserialize + дерево) dotnet run -- dump bp-179.bpt --pretty
# gzip (gzencode) dotnet run -- build bp-179.txt -o bp-179.bpt --gzip # zlib (gzcompress) dotnet run -- build bp-179.txt -o bp-179.bpt --zlib # deflate (gzdeflate) dotnet run -- build bp-179.txt -o bp-179.bpt --deflate # без сжатия dotnet run -- build bp-179.txt -o bp-179.bpt --plain
⚠️ Важно:bp-179.txtдолжен содержать сырой PHP-serialized текст (результатdumpбез--pretty).
Не изменяйте содержимое внутриs:<len>:"..."— длины должны точно совпадать по байтам.
# Базовая информация dotnet run -- info bp-179.bpt # С предпросмотром содержимого dotnet run -- info bp-179.bpt --peek 200
Поддерживаются stdin/stdout для конвейерной обработки:
# Цепочка команд через pipe dotnet run -- dump data/bp-179.bpt -o - | \ dotnet run -- build - --out out/bp-179-deflate.bpt --deflate # Автосоздание директорий dotnet run -- build data/bp-179.txt --out out/rebuilt/bp-179.bpt --zlib
Альтернативные флаги:
--in <path>и--out <path>(эквивалентны позиционным аргументам и-o)
Чтобы правильно пересобрать файл, сначала определите формат исходного .bpt:
dotnet run -- info bp-179.bpt
Обратите внимание на:
- Заголовок — магические байты
- Фактический формат — что сработало при распаковке
Используйте соответствующий флаг: --gzip, --zlib, --deflate или --plain
- Настройки → Инструменты → Бизнес-процессы
- Шаблоны бизнес-процессов
- Меню действий нужного шаблона → Экспорт
- CRM → Настройки CRM → Бизнес-процессы или Списки → Бизнес-процессы
- Найдите шаблон → меню действий → Экспорт
CLI utility for working with .bpt files (Bitrix business process templates):
- 📤 Extract content (
dump) - 📦 Build back from text (
build) - i️ Display file information (
info)
- gzip (gzencode)
- zlib (gzcompress)
- deflate (gzdeflate)
- plain (uncompressed)
📋 Pre-built binaries (Windows/Linux/macOS):
👉 Releases · bitrix-bpt-tool
git clone https://github.com/bslie/bitrix-bpt-tool.git
cd bitrix-bpt-tool
dotnet buildRequirements: .NET 9.0 SDK or later
# Basic extraction dotnet run -- dump bp-179.bpt -o bp-179.txt # Human-readable output (unserialized + tree structure) dotnet run -- dump bp-179.bpt --pretty
# gzip (gzencode) dotnet run -- build bp-179.txt -o bp-179.bpt --gzip # zlib (gzcompress) dotnet run -- build bp-179.txt -o bp-179.bpt --zlib # deflate (gzdeflate) dotnet run -- build bp-179.txt -o bp-179.bpt --deflate # plain (uncompressed) dotnet run -- build bp-179.txt -o bp-179.bpt --plain
⚠️ Important:bp-179.txtmust contain raw PHP-serialized text (result ofdumpwithout--pretty).
Don't modify content insides:<len>:"..."— lengths must match exactly by bytes.
# Basic information dotnet run -- info bp-179.bpt # With content preview dotnet run -- info bp-179.bpt --peek 200
Support for stdin/stdout for pipeline processing:
# Command chaining via pipe dotnet run -- dump data/bp-179.bpt -o - | \ dotnet run -- build - --out out/bp-179-deflate.bpt --deflate # Auto-create directories dotnet run -- build data/bp-179.txt --out out/rebuilt/bp-179.bpt --zlib
Alternative flags:
--in <path>and--out <path>(equivalent to positional arguments and-o)
To properly rebuild a file, first determine the original .bpt format:
dotnet run -- info bp-179.bpt
Pay attention to:
- Header — magic bytes detection
- Actual format — what worked during unpacking
Use the corresponding flag: --gzip, --zlib, --deflate, or --plain
- Settings → Tools → Business Processes
- Business Process Templates
- Template action menu → Export
- CRM → CRM Settings → Business Processes or Lists → Business Processes
- Find template → action menu → Export
MIT License - see LICENSE.txt for details