erpl-adt
SAP ADT REST API的CLI和MCP服务器-一个单独的二进制文件,与Eclipse ADT使用的HTTP端点相同。没有Eclipse,没有SAP NW RFC SDK,没有JVM。

部分 Datazoo ERPL家族。
它做什么
- 搜索和浏览 ABAP对象、包、数据字典表、CDS视图
- 读写 带锁管理和传输集成的源代码
- 运行测试 --从命令行进行ABAP单元和ATC质量检查
- 管理运输 --创建、列出和发布传输请求
- MCP服务器 --通过JSON-RPC向AI代理公开所有功能(MCP 2024-11-05)
每个命令都接受 --json 用于机器可读输出。
快速示例
# Save connection credentials (prompts for password)
erpl-adt login --host sap.example.com --port 44300 --https --user DEVELOPER
# Search for classes matching a pattern
erpl-adt search ZCL_MY_* --type CLAS --max 20
# Read object metadata and source code
erpl-adt object read /sap/bc/adt/oo/classes/zcl_my_class
erpl-adt source read /sap/bc/adt/oo/classes/zcl_my_class/source/main
# Write source code (auto-locks, writes, unlocks)
erpl-adt source write /sap/bc/adt/oo/classes/zcl_my_class/source/main --file impl.abap
# Write and activate in one step
erpl-adt source write /sap/bc/adt/oo/classes/zcl_my_class/source/main --file impl.abap --activate
# Activate an object by name
erpl-adt activate ZCL_MY_CLASS
# Run unit tests and ATC checks (by name or URI)
erpl-adt test ZCL_MY_CLASS
erpl-adt check ZCL_MY_CLASS --variant DEFAULT
# Create a transport request and release it
erpl-adt transport create --desc "Feature XYZ" --package ZPACKAGE
erpl-adt transport release NPLK900042
# Browse packages and data dictionary
erpl-adt package tree ZPACKAGE --type CLAS
erpl-adt ddic table SFLIGHT
erpl-adt ddic cds I_AIRLINE
# Check syntax
erpl-adt source check /sap/bc/adt/oo/classes/zcl_my_class/source/main安装
运行erpl-adt的最快方法——无需下载:
uvx erpl-adt --help或永久安装:
pip install erpl-adt| 平台 | 架构 |
|---|---|
| Linux | x86_64 |
| macOS | arm64,x86_64 |
| Windows | x64 |
全参考
跑 erpl-adt --help 查看完整的命令列表。关键命令:
SEARCH — Search for ABAP objects
search
Search for ABAP objects
--type Object type: CLAS, PROG, TABL, INTF, FUGR
--max Maximum number of results
OBJECT — Read, create, delete, lock/unlock ABAP objects
object create Create an ABAP object
--type, --name, --package (required)
--description, --transport
object delete Delete an ABAP object
object lock Lock an object for editing
object read Read object structure
object run Run an ABAP console class (IF_OO_ADT_CLASSRUN)
object unlock Unlock an object
SOURCE — Read, write, and check ABAP source code
source check Check syntax
source edit Open source in $EDITOR and write back
source read Read source code
--version active or inactive (default: active)
--section
main, localdefinitions, localimplementations, testclasses, all
--color / --no-color ANSI syntax highlighting
source write Write source code
--file
Path to local source file (required)
--activate Activate the object after writing
--optimistic Try lockless write first (pre-7.51 SAP)
ACTIVATE — Activate inactive ABAP objects
activate
TEST / CHECK
test Run ABAP unit tests
check Run ATC quality checks
--variant ATC variant (default: DEFAULT)
TRANSPORT — List, create, and release transports
transport create --desc --package
transport list [--user ]
transport release
DATA DICTIONARY — Tables and CDS views
ddic table Get table definition (fetches lengths + descriptions by default)
--no-resolve-types Skip data-element lookup; show field names and types only
--raw Print raw SAP XML response
ddic cds Get CDS view source
PACKAGE — List contents and check package existence
package exists
package list
package tree Recursive BFS traversal
--type Filter: CLAS, PROG, TABL, INTF, FUGR
--max-depth (default: 50)
GLOBAL FLAGS
--host, --port, --user, --password, --client
--https, --insecure
--json Machine-readable JSON output
--color / --no-color
--timeout
--session-file
Persist session for lock/write/unlock workflows
-v / -vv INFO / DEBUG logging
EXIT CODES
0 Success 1 Connection/auth 2 Not found 5 Activation error
6 Lock conflict 7 Test failure 8 ATC check error 99 Internal errorMCP服务器
erpl-adt包括一个内置的MCP服务器(模型上下文协议,版本2024-11-05),它通过stdin/stdout上的JSON-RPC 2.0将所有adt操作作为工具公开。这使得AI代理可以直接搜索、读取、写入、测试和管理ABAP代码。
erpl-adt mcp --host sap.example.com --port 44300 --https在MCP客户端中配置它(例如,Claude Desktop、Claude Code):
{
"mcpServers": {
"erpl-adt": {
"command": "erpl-adt",
"args": ["mcp", "--host", "sap.example.com", "--port", "44300", "--https"],
"env": {
"SAP_PASSWORD": "your_password"
}
}
}
}部署工作流
erpl-adt还包括原始 deploy 通过YAML配置自动部署abapGit包的工作流程:
cat > config.yaml <<EOF
connection:
host: localhost
port: 50000
use_https: false
client: "001"
user: DEVELOPER
password_env: SAP_PASSWORD
repos:
- name: flight
url: https://github.com/SAP-samples/abap-platform-refscen-flight.git
branch: refs/heads/main
package: /DMO/FLIGHT
activate: true
EOF
export SAP_PASSWORD=your_password
erpl-adt deploy -c config.yaml部署工作流是幂等状态机: discover → create package → clone → pull → activate。每一步都检查先决条件,如果已经满足,则跳过。重新运行是安全的。支持多仓库部署 depends_on 用于拓扑排序。
从源头构建
git clone --recurse-submodules https://github.com/datazooDE/erpl-adt.git
cd erpl-adt
make release需要CMake 3.21+、Ninja和C++17编译器(GCC 13+、Apple Clang 15+或MSVC 17+)。vcpkg作为git子模块包含在内。
要运行测试,请执行以下操作:
make test # Unit tests (offline, no SAP system needed)
make test-integration-py # Integration tests (requires SAP system)码头工人
docker build -t erpl-adt .
docker run --rm -v $(pwd)/config.yaml:/config.yaml \
-e SAP_PASSWORD=your_password \
erpl-adt deploy -c /config.yaml或者使用Docker Compose进行SAP ABAP云开发人员试用版的端到端配置:
docker compose up许可证
Apache许可证2.0 --版权所有2026 Datazoo GmbH
