{"slug":"sap-adt-cli","title":"sap-adt-cli","summary":"\"Read/write live SAP ABAP source and class parts, review multi-object changes,","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-11-29T00:41:47.49786Z","repo":{"url":"https://github.com/shrek-abaper/sap-watt","stars":51,"forks":19,"license":"MIT","updatedAt":"2026-11-28T12:48:44Z"},"bodyHtml":"<h1>sap-adt-cli</h1>\n<p><strong>Watt — Power your SAP Engineering.</strong> This Skill keeps its existing ID.\nPrefer the <code>sap-watt</code> entry from CLI 1.6.7+ for new Python/npm installations;\ncompatible <code>sap-adt</code> examples and existing configurations remain valid.\nThe deterministic CLI supplies operations; this Skill and its agent supply\nworkflow and interpretation, not a second embedded AI runtime.</p>\n\n\n<p>Online operations need the <code>sap-adt</code> CLI. Compatible legacy CLI range: <code>&gt;=1.5.0,&lt;2.0.0</code>.\nPreferred new entry: <strong>Watt</strong> (<code>sap-watt</code>), range <code>&gt;=1.6.7,&lt;2.0.0</code>. Existing <code>sap-adt</code> examples remain valid; use the installed entry consistently.\nInstall/readiness guide: <a href=\"references/setup.md\"><code>references/setup.md</code></a>.</p>\n\n<p><a href=\"README.md\">English</a> | <a href=\"README.zh-CN.md\">中文</a></p>\n<p>A command-line tool and AI agent skill for reading <strong>and writing</strong> ABAP source code, metadata,\nand transport requests from SAP systems via the <a href=\"https://help.sap.com/docs/abap-cloud/abap-development-tools-user-guide/about-abap-development-tools\">ADT (ABAP Development Tools) REST API</a>.</p>\n<p>Supports programs, classes, function modules, interfaces, includes, CDS views, DDIC objects,\npackages, transactions, SQL queries, where-used analysis, syntax checks, and transport management —\nall from the terminal or from within an AI agent workflow. Write and transport operations require\nexplicit capability flags and per-operation confirmation.</p>\n<p>CLI 1.6.0 adds <strong>ADT diagnostic feeds, per-part object history,\nversion differences and transport object differences</strong>.\nConfirm command availability with <code>sap-adt --help</code>\nand <code>sap-adt transport diff --help</code>. They are read-only and need no write flags.\nSee <a href=\"references/diagnostics-history.md\">diagnostics and change analysis</a> for\ncomparison baselines, evidence gaps and the real-system verification scope.\nCLI 1.6.0 also adds explicit CLI updates: see <a href=\"references/updating.md\">updating</a>.\nThe command never silently changes installation channels.</p>\n<p>CLI 1.6.1 adds <strong>Unit failure evidence, test-include source reads and dump\ndetails</strong>. The Skill connects these primitives into diagnosis, not automatic\nrepair. See <a href=\"references/test-failure-diagnosis.md\">test failure diagnosis</a>.\nAn empty Unit result is not a pass; <code>--require-tests</code> makes it fail the gate.\nUse the same commands with Python or an npm-installed native runtime.</p>\n<p>CLI 1.6.2 makes <strong><code>write-source</code> a verified write</strong>: baseline and upload\nhash binding, in-lock baseline re-check, readback, guaranteed unlock and\noptional activation with active-version readback. Each stage reports\n<code>accepted</code> / <code>verified</code> / <code>failed</code> / <code>unknown</code>; unknown or partial outcomes\nexit non-zero and are never retried or rolled back by writing old source.\n<code>--yes</code> requires <code>--expect-baseline-sha256</code> and skips only the prompt.</p>\n<p>CLI <strong>1.6.6</strong> adds target/environment expectations, enhancement/BAdI/message/lock\nmetadata, bounded impact graphs, Unit gates/coverage evidence and result bundles,\ndiagnosis packages, transport analysis, single-table/view configuration diffs,\nsyntax/ATC/abaplint evidence gates, local Git/TR mappings and requirement delivery\npackages. All commands support explicit JSON; human-readable output remains.\nSee the <a href=\"references/executor.md\">atomic executor guide</a> and\n<a href=\"SKILL.md#command-index\">complete command index</a>.</p>\n<p>Coverage and abaplint are explicitly bound supplied reports, not attested native\nmeasurements. Git exports existing repository files, not invented SAP abapGit\nserialization. Zero tests, unavailable engines and incomplete evidence never\nbecome a passing gate. Packaging does not replay checks or release transports;\nreasoning and multi-agent orchestration stay outside the CLI.</p>\n<hr>\n<h2>Requirements</h2>\n<ul>\n<li>The <code>sap-adt</code> CLI, installed once (see <a href=\"references/setup.md\">references/setup.md</a>):\n<ul>\n<li>npm: <code>npm install -g \"sap-adt-cli@^1.5.0\"</code> (provides the <code>sap-adt</code> command) — Node.js ≥ 18, no Python. npx also works (<code>npx \"sap-adt-cli@^1.5.0\" install</code>) but keeps no PATH command, so prefix later calls with <code>npx \"sap-adt-cli@^1.5.0\"</code></li>\n<li>PyPI: <code>pip install \"sap-adt-cli&gt;=1.5.0,&lt;2.0.0\"</code> — Python ≥ 3.10</li>\n<li>Linux portable archive from the release page (no Python/Node)</li>\n</ul>\n</li>\n<li>A SAP system (on-premise ECC / S/4HANA, or BTP ABAP) with ADT services activated</li>\n<li>A SAP dialog user with the <code>SAP_ADT_BASE</code> role (or equivalent)</li>\n</ul>\n<p>There is <strong>no first-run auto-install</strong> of dependencies. Core runtime dependencies are\n<code>click</code>, <code>requests</code>, <code>urllib3</code>; keystore backends are optional: the <code>keyring</code> extra for\ndesktop OS vaults and the <code>file</code> extra (cryptography) for the encrypted-file fallback\n(WSL2 needs neither — it uses Windows DPAPI directly). See\n<a href=\"#credential-storage-keystore\">Credential storage</a>.</p>\n<hr>\n<h2>Using this skill with an AI agent</h2>\n<p><code>sap-adt-cli</code> is a standard Agent Skill (<code>SKILL.md</code>) folder. Install the CLI from\nthe Requirements section, then load the skill with your agent:</p>\n<table>\n<thead>\n<tr>\n<th>Agent</th>\n<th>How to use it</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Claude Code</td>\n<td>Install the plugin from the <a href=\"https://github.com/shrek-abaper/sap-watt\">repository</a></td>\n</tr>\n<tr>\n<td>Codex</td>\n<td>Copy the complete skill folder into the directory Codex scans</td>\n</tr>\n<tr>\n<td>WorkBuddy</td>\n<td>Same folder copy</td>\n</tr>\n<tr>\n<td>Other <code>SKILL.md</code> agents</td>\n<td>Use the agent's own skill directory or import UI</td>\n</tr>\n</tbody>\n</table>\n<p>The agent drives the workflow; the <code>sap-adt</code> CLI performs the online ADT calls.\nOn Windows x64, CLI 1.5.3 or newer provides an npm runtime, portable ZIP\nand unsigned desktop installer; Python ≥ 3.10 users can also use PyPI.\nCopy the skill folder into your agent's skill directory separately.\nSee the <a href=\"https://github.com/shrek-abaper/sap-watt/blob/main/docs/installation/windows.md\">Windows guide</a>\nfor the verified silent-install scope and remaining GUI/PATH/elevation gaps.\nCLI 1.6.0 adds experimental macOS 15+ npm/portable runtimes for Intel and\nApple Silicon, gated by native CI build/install checks. Personal Macs,\nolder macOS, Keychain, Gatekeeper/signing and live SAP on macOS remain\nunverified; see <a href=\"references/setup.md\">references/setup.md</a>.</p>\n<blockquote>\n<p><strong>Data compliance note:</strong> ABAP source code may contain core business logic and sensitive data.\nBefore sending code to cloud-based AI services, confirm compliance with your organization's\ndata security policy. For sensitive environments, consider an internally-hosted model.</p>\n</blockquote>\n<hr>\n<h2>Quickstart</h2>\n<pre><code># 1. Install the CLI once (pick one channel; details in references/setup.md)\npip install \"sap-adt-cli&gt;=1.5.0,&lt;2.0.0\"            # Python ≥ 3.10\n# or: npm install -g \"sap-adt-cli@^1.5.0\" &amp;&amp; sap-adt install   # Node.js ≥ 18, no Python\n#     (npx: npx \"sap-adt-cli@^1.5.0\" install, then npx \"sap-adt-cli@^1.5.0\" &lt;command&gt;)\n\n# 2. Configure credentials (interactive wizard — password is not echoed and is\n#    saved to the OS keystore; add more systems later with: configure --profile qas / prd)\nsap-adt configure\n\n# 3. Verify the connection\nsap-adt status\n\n# 4. Start reading ABAP objects\nsap-adt get-program SAPMV45A\nsap-adt get-class ZCL_MY_CLASS\nsap-adt get-function BAPI_SALESORDER_CREATEFROMDAT2 --group BAPI_SD_SALESORDER\n</code></pre>\n<hr>\n<h2>Configuration</h2>\n<p>Credential lookup order is:</p>\n<ol>\n<li>Process environment variables</li>\n<li>Dotenv file declared by <code>SAP_ADT_DOTENV</code></li>\n<li>The selected profile in <code>~/.sap-adt-cli/config.json</code> (non-secret fields)\nand its password in the OS keystore — see <a href=\"#credential-storage-keystore\">Credential storage</a></li>\n</ol>\n<h3>Multiple SAP environments (profiles)</h3>\n<p>Each SAP system is stored as a named profile in <code>~/.sap-adt-cli/config.json</code>\n(non-secret fields; the password goes to the keystore). The first <code>configure</code>\nrun creates a profile called <code>default</code>; an old single-connection config is\nmigrated automatically:</p>\n<pre><code>\n\n# Add environments (each saved profile becomes the active one)\nsap-adt configure --profile dev --url \"https://sap-dev:8000\" --username DEV --client 100\nsap-adt credentials set dev                       # then store the password (hidden prompt)\nSAP_PASSWORD=\"...\" sap-adt configure --profile prd --url \"https://sap-prd:8000\" --username PRD --client 200\n                                               # ^ SAP_PASSWORD is moved into the keystore, not left in config.json\n\n# List environments; * marks the active profile\nsap-adt profile list\n\n# Persistent switch\nsap-adt profile use dev\n\n# One-off override: global --profile (before the command) or SAP_PROFILE env var\nsap-adt --profile prd get-program SAPMV45A\nSAP_PROFILE=qas sap-adt status\n\n# Remove an environment (the active profile cannot be removed)\nsap-adt profile remove qas\n</code></pre>\n<p>Profile selection order: <code>--profile</code> &gt; <code>SAP_PROFILE</code> &gt; the active profile set by\n<code>profile use</code>. Write/transport capability flags are <strong>profile-first</strong>, with\nlegacy global fallback only when a profile does not declare them. Debugging and\nexecution require independent capabilities; production refuses risky operations.\nUse <code>status</code> and explicit target expectations before an operation.</p>\n<blockquote>\n<p>A complete set of <code>SAP_URL/USERNAME/PASSWORD/CLIENT</code> environment variables (or a\ndotenv file declared by <code>SAP_ADT_DOTENV</code>) overrides all profiles. Run <code>status</code>\nto see which source is actually used.</p>\n</blockquote>\n<h3>Dotenv file (explicit path, per-environment override)</h3>\n<pre><code># create ~/.config/sap-adt.env from the template in references/setup.md\n# edit it and fill SAP_URL, SAP_USERNAME, SAP_PASSWORD, SAP_CLIENT\nexport SAP_ADT_DOTENV=\"$HOME/.config/sap-adt.env\"\nsap-adt status\n</code></pre>\n<p>The CLI never scans the current directory or the skill folder for a <code>.env</code>;\nonly the file named by <code>SAP_ADT_DOTENV</code> is read. Never commit the real file.</p>\n<h3>Interactive wizard</h3>\n<pre><code>sap-adt configure\n</code></pre>\n<p>Connection fields are saved as a profile (the wizard asks for a profile name) in\n<code>~/.sap-adt-cli/config.json</code> (<code>0600</code>); the password goes to the selected\nkeystore. Re-running the wizard for an existing profile and leaving the\npassword blank keeps the stored password.</p>\n<h3>Credential storage (keystore)</h3>\n<p>Passwords are stored <strong>only</strong> through pluggable keystore backends, selected by\nreal capability probing rather than by operating system. Priority order:</p>\n<table>\n<thead>\n<tr>\n<th>#</th>\n<th>Backend</th>\n<th>Environment</th>\n<th>Setup needed</th>\n<th>One-time configuration</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>1</td>\n<td><code>env</code></td>\n<td>containers / CI / any</td>\n<td>none</td>\n<td><code>export SAP_ADT_&lt;PROFILE&gt;_PASSWORD=...</code> (read-only)</td>\n</tr>\n<tr>\n<td>2</td>\n<td><code>keyring</code></td>\n<td>native Windows, macOS, Linux desktop</td>\n<td><code>pip install keyring</code> (Credential Manager / Keychain / Secret Service)</td>\n<td>none</td>\n</tr>\n<tr>\n<td>3</td>\n<td><code>dpapi</code></td>\n<td><strong>WSL2</strong></td>\n<td>none — uses Windows DPAPI via <code>powershell.exe</code> interop</td>\n<td>none</td>\n</tr>\n<tr>\n<td>4</td>\n<td><code>pass</code></td>\n<td>headless Linux with GPG</td>\n<td><a href=\"https://www.passwordstore.org/\"><code>pass</code></a> initialized (<code>pass init</code>)</td>\n<td>none</td>\n</tr>\n<tr>\n<td>5</td>\n<td><code>file</code></td>\n<td>last-resort fallback, all platforms</td>\n<td><code>pip install cryptography</code></td>\n<td>a master passphrase (prompted, or <code>SAP_ADT_MASTER_PASSPHRASE</code>)</td>\n</tr>\n</tbody>\n</table>\n<p>There is deliberately no <code>credentials export</code> command. Diagnose the active\nbackend with:</p>\n<pre><code>sap-adt credentials doctor\n# force a specific backend (fail-closed: an unavailable choice errors out)\nsap-adt --keystore file credentials status\n</code></pre>\n<p>Manage stored passwords:</p>\n<pre><code>\nsap-adt credentials set dev          # prompts with hidden input + confirmation\nsap-adt credentials status           # configured / not configured per profile — never prints secrets\nsap-adt credentials forget dev       # purge from all writable backends\n</code></pre>\n<blockquote>\n<p><strong>Keystore-bound secrets are not portable.</strong> DPAPI blobs are tied to the\nWindows account and Keychain entries to the macOS login; copying\n<code>secrets.json</code>/the config to another machine or user cannot decrypt them.\nRe-running <code>credentials set</code> on the new machine is expected behavior, not a bug.</p>\n<p><strong>Migration from older versions:</strong> a config that still contains plaintext\npasswords is migrated automatically on first run — the passwords move into\nthe selected keystore, the fields are stripped from <code>config.json</code> (no backup\ncopy is created), and you are advised to change those passwords on the SAP\nside because they previously sat on disk unencrypted.</p>\n</blockquote>\n<h3>Environment variables</h3>\n<p>Useful for CI/CD pipelines or one-off sessions. The complete-connection\nvariables take precedence over both the declared dotenv file (<code>SAP_ADT_DOTENV</code>) and saved profiles.</p>\n<pre><code>export SAP_URL=https://my-sap.example.com:8000\nexport SAP_USERNAME=MYUSER\nexport SAP_PASSWORD=secret          # complete-connection override; prefer over the --password flag\nexport SAP_CLIENT=100\nexport SAP_PROFILE=dev              # optional: select a profile (ignored when SAP_URL..SAP_CLIENT are all set)\nexport SAP_LANGUAGE=EN              # optional, default: EN\nexport SAP_VERIFY_SSL=0             # optional: set 0 for self-signed certificates\nexport SAP_ALLOW_WRITE=0            # optional: set 1 to enable write-source/activate\nexport SAP_ALLOW_TRANSPORT=0        # optional: set 1 to enable create/release transport\nexport SAP_ALLOW_DEBUG=0            # optional: separate debugger capability (CLI 1.6.1+)\nexport SAP_ENVIRONMENT=dev          # required explicitly for env-based debugging\n\n# Per-profile password for the 'env' keystore (profile 'dev' -&gt; variable SAP_ADT_DEV_PASSWORD)\nexport SAP_ADT_DEV_PASSWORD=secret\n# Master passphrase for the 'file' keystore in non-interactive runs\nexport SAP_ADT_MASTER_PASSPHRASE=...\n</code></pre>\n<h3>Capability flags (default: disabled)</h3>\n<p>Separate flags unlock source writes, transport writes and debugger controls.\n<strong>Enable only the capability needed, on the intended profile.</strong> Write/transport\nhave legacy global fallbacks; debug permission never does. <code>environment=prd</code>\nhard-refuses all three. Check <code>status</code> for each effective flag and its source.</p>\n<pre><code># Enable interactively (answer 'y' to the write/transport prompts)\nsap-adt configure --profile dev\n\n# Enable non-interactively\nSAP_PASSWORD=\"secret\" sap-adt configure --profile dev \\\n  --url \"https://sap-dev.example.com:44300\" \\\n  --username \"DEVELOPER\" \\\n  --client \"400\" \\\n  --allow-write \\\n  --no-allow-transport\n</code></pre>\n<table>\n<thead>\n<tr>\n<th>Flag</th>\n<th>Config field (profile scope preferred)</th>\n<th>Default</th>\n<th>Commands unlocked</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>--allow-write</code></td>\n<td><code>allow_write</code></td>\n<td>false</td>\n<td><code>write-source</code>, <code>activate</code></td>\n</tr>\n<tr>\n<td><code>--allow-transport</code></td>\n<td><code>allow_transport</code></td>\n<td>false</td>\n<td><code>create-transport</code>, <code>release-transport</code></td>\n</tr>\n<tr>\n<td><code>--allow-debug</code> (1.6.1+)</td>\n<td><code>allow_debug</code> (profile-only)</td>\n<td>false</td>\n<td><code>debug serve/breakpoint/listen/attach/step/continue</code></td>\n</tr>\n</tbody>\n</table>\n<p>For an existing, approved non-production profile:\n<code>sap-adt configure --profile qas --allow-debug</code> preserves unspecified write/TLS\nsettings. <code>--no-allow-debug</code> disables new controls. Neither <code>allow_write=true</code>\nnor a legacy global switch grants debugging. Complete env/dotenv connections\nuse <code>SAP_ALLOW_DEBUG=true</code> with explicit <code>SAP_ENVIRONMENT=dev|qas</code>.\nThis local flag does not replace SAP-side debug authorization.</p>\n<p><strong>Confirmation policy</strong>: even when flags are enabled, every write/create/release or debug control\noperation shows a change preview and requires explicit <code>[y/N]</code> confirmation.\nThe confirmation applies to the current operation only — it is discarded immediately\nafter use and must be repeated for each subsequent operation.\nDebugging is not a read-only sandbox: step/continue can let application code\nwrite business data even with source writes disabled. Authorized stack/variable\nreads and status/detach/cleanup do not need re-enabling debug permission.\nDisabling a flag does not close an existing owner; clean it up explicitly.</p>\n<h3>Non-interactive flags (agent / automation workflows)</h3>\n<pre><code># Pass password via environment variable to avoid shell history exposure.\n# configure stores it in the keystore; it does not remain in config.json.\nSAP_PASSWORD=\"secret\" sap-adt configure --profile dev \\\n  --url      \"https://my-sap.example.com:8000\" \\\n  --username \"MYUSER\" \\\n  --client   \"100\"\n</code></pre>\n<p>At runtime, CI can instead provide the password per profile via\n<code>SAP_ADT_&lt;PROFILE&gt;_PASSWORD</code> (read-only <code>env</code> backend), or use\n<code>--keystore file</code> together with <code>SAP_ADT_MASTER_PASSPHRASE</code>.</p>\n<hr>\n<h2>Commands</h2>\n<table>\n<thead>\n<tr>\n<th>Command</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>configure [--profile NAME]</code></td>\n<td>Save credentials for one environment profile (wizard or flags)</td>\n</tr>\n<tr>\n<td><code>profile list</code></td>\n<td>List all configured environments (<code>*</code> = active)</td>\n</tr>\n<tr>\n<td><code>profile use &lt;NAME&gt;</code></td>\n<td>Persistently switch the active environment</td>\n</tr>\n<tr>\n<td><code>profile remove &lt;NAME&gt;</code></td>\n<td>Delete an environment (active profile is protected) and purge its password</td>\n</tr>\n<tr>\n<td><code>credentials set &lt;NAME&gt;</code></td>\n<td>Store a profile password in the keystore (hidden prompt)</td>\n</tr>\n<tr>\n<td><code>credentials forget &lt;NAME&gt;</code></td>\n<td>Purge a profile password from writable keystores</td>\n</tr>\n<tr>\n<td><code>credentials status</code></td>\n<td>Show configured/not-configured per profile (never prints passwords)</td>\n</tr>\n<tr>\n<td><code>credentials doctor</code></td>\n<td>Diagnose backends, selected backend, files and entries</td>\n</tr>\n<tr>\n<td><code>status</code></td>\n<td>Show active profile and current connection configuration</td>\n</tr>\n<tr>\n<td><code>update [--check] [--major] [--yes]</code></td>\n<td>Explicit CLI check/update; same-major stable by default; recognized npm-global and pip/pipx only; no SAP connection</td>\n</tr>\n<tr>\n<td><code>--profile NAME &lt;command&gt;</code></td>\n<td>Global option: one-off profile override for a single command</td>\n</tr>\n<tr>\n<td><code>--keystore &lt;env\\|keyring\\|dpapi\\|pass\\|file&gt; &lt;command&gt;</code></td>\n<td>Global option: force the credential backend (fail-closed if unavailable)</td>\n</tr>\n<tr>\n<td><code>-v, --verbose</code></td>\n<td>Verbose logging (secrets are always redacted)</td>\n</tr>\n<tr>\n<td><code>get-program &lt;NAME&gt;</code></td>\n<td>ABAP program / report source code</td>\n</tr>\n<tr>\n<td><code>get-class &lt;NAME&gt;</code></td>\n<td>ABAP class source code</td>\n</tr>\n<tr>\n<td><code>get-function-group &lt;NAME&gt;</code></td>\n<td>Function group top-include source code</td>\n</tr>\n<tr>\n<td><code>get-function &lt;NAME&gt; --group &lt;FG&gt;</code></td>\n<td>Function module source code</td>\n</tr>\n<tr>\n<td><code>get-include &lt;NAME&gt;</code></td>\n<td>ABAP include source code</td>\n</tr>\n<tr>\n<td><code>get-interface &lt;NAME&gt;</code></td>\n<td>ABAP interface source code</td>\n</tr>\n<tr>\n<td><code>get-table &lt;NAME&gt;</code></td>\n<td>DDIC table fields — <code>fields</code> envelope (DDL on S/4)</td>\n</tr>\n<tr>\n<td><code>get-structure &lt;NAME&gt;</code></td>\n<td>DDIC structure fields — <code>fields</code> envelope</td>\n</tr>\n<tr>\n<td><code>get-type-info &lt;NAME&gt;</code></td>\n<td>Domain/data element — <code>scalar</code> envelope (<code>resolved_as</code>)</td>\n</tr>\n<tr>\n<td><code>get-type-group &lt;NAME&gt;</code></td>\n<td>ABAP type group (TYPE POOL) source</td>\n</tr>\n<tr>\n<td><code>get-cds-view &lt;NAME&gt;</code></td>\n<td>CDS View DDL source code</td>\n</tr>\n<tr>\n<td><code>get-package &lt;NAME&gt;</code></td>\n<td>Package objects — <code>objects</code> envelope</td>\n</tr>\n<tr>\n<td><code>get-transaction &lt;NAME&gt;</code></td>\n<td>Transaction properties — <code>scalar</code> envelope</td>\n</tr>\n<tr>\n<td><code>search-object &lt;QUERY&gt; [--max-results N]</code></td>\n<td>Object name search — <code>*</code> wildcard supported</td>\n</tr>\n<tr>\n<td><code>syntax-check &lt;TYPE&gt; &lt;NAME&gt; [--group &lt;FG&gt;]</code></td>\n<td>Syntax check — read-only, no confirmation; <code>--group</code> required when TYPE is <code>function</code></td>\n</tr>\n<tr>\n<td><code>where-used &lt;TYPE&gt; &lt;NAME&gt; [--max-results N] [--group &lt;FG&gt;]</code></td>\n<td>Where-used list — <code>objects</code> envelope; <code>--group</code> required when TYPE is <code>function</code></td>\n</tr>\n<tr>\n<td><code>run-sql \"&lt;SQL&gt;\" [--max-rows N]</code></td>\n<td>Open SQL SELECT → JSON <em>(DML statements blocked)</em>; default 100 rows, max 10 000</td>\n</tr>\n<tr>\n<td><code>write-source &lt;TYPE&gt; &lt;NAME&gt; --file &lt;PATH&gt; [--activate] [--group &lt;FG&gt;] [--transport &lt;TRKORR&gt;] [--dry-run] [--expect-baseline-sha256 &lt;H&gt;] [--expect-content-sha256 &lt;H&gt;] [--yes]</code></td>\n<td>Verified write <em>(allow_write + confirm each time)</em>: diff preview, lock, in-lock baseline re-check, write, readback, unlock; <code>--activate</code> activates and verifies the active version; <code>--dry-run</code> shows the diff and hashes only; <code>--yes</code> requires <code>--expect-baseline-sha256</code> (CLI 1.6.2+); <code>--group</code> required when TYPE is <code>function</code>; <code>--transport</code> pins the transport request</td>\n</tr>\n<tr>\n<td><code>activate &lt;TYPE&gt; &lt;NAME&gt; [--group &lt;FG&gt;]</code></td>\n<td>Activate ABAP object <em>(allow_write + confirm each time)</em>; <code>--group</code> required when TYPE is <code>function</code></td>\n</tr>\n<tr>\n<td><code>list-transports [--user U] [--status D\\|R]</code></td>\n<td>List transport requests (JSON, read-only); default <code>--status D</code> (in development)</td>\n</tr>\n<tr>\n<td><code>list-feeds</code></td>\n<td>Diagnostic feed catalog with FQL attributes and query variants</td>\n</tr>\n<tr>\n<td><code>query-feed &lt;URI&gt; [--query FQL] [--max-results N] [--page-uri URI]</code></td>\n<td>One advertised feed page; default 20, maximum 500; continuation may overlap</td>\n</tr>\n<tr>\n<td><code>get-versions &lt;TYPE&gt; &lt;NAME&gt; [--group FG] [--max-results N]</code></td>\n<td>Per-part object history; default 100 versions per part; partial history exits 1</td>\n</tr>\n<tr>\n<td><code>get-version-source &lt;URI&gt;</code></td>\n<td>Read an opaque historical content URI; plain source by default</td>\n</tr>\n<tr>\n<td><code>diff-versions &lt;FROM_URI&gt; &lt;TO_URI&gt; [--context N]</code></td>\n<td>Compare two version contents locally; <code>--format text</code> for unified patches</td>\n</tr>\n<tr>\n<td><code>get-transport &lt;TRKORR&gt;</code></td>\n<td>Request/task metadata and deduplicated objects</td>\n</tr>\n<tr>\n<td><code>transport diff &lt;TRKORR&gt; [--max-objects N] [--context N]</code></td>\n<td>Object differences; default 50 objects; missing snapshots/baselines are evidence gaps, exit 1</td>\n</tr>\n<tr>\n<td><code>create-transport --package &lt;DEVCLASS&gt; --description \"&lt;DESC&gt;\" --ref &lt;object-uri&gt;</code></td>\n<td>Create transport via CreateCorrectionRequest <em>(allow_transport + confirm each time)</em>; package + object REF required; <code>$TMP</code> creates a local request; real-verified on Basis 7.56 (2026-09-17)</td>\n</tr>\n<tr>\n<td><code>release-transport &lt;TRKORR&gt; [--yes]</code></td>\n<td>Release transport — irreversible <em>(allow_transport + confirm each time)</em></td>\n</tr>\n<tr>\n<td><code>transport ping</code></td>\n<td>ADT connectivity check for transport collection (plain text)</td>\n</tr>\n<tr>\n<td><code>transport collect &lt;TRKORR&gt; [--output-dir DIR] [--verbose]</code></td>\n<td>Read-only collection of a TR's object list + sources into <code>review_package/</code> (<code>manifest.json</code> + <code>sources/</code>); <code>--legacy-config</code> explicitly opts into the deprecated plaintext collector config</td>\n</tr>\n</tbody>\n</table>\n<p>Run any command with <code>--help</code> for full details.\nFor the new read-only commands, see the workflows in\n<a href=\"references/examples.md\">references/examples.md</a>. A modifiable request compares\nactive source, not a frozen transport snapshot. A released request requires\nstored versions attributable to that request; active <code>00000</code> is not a snapshot.\nDo not treat partial output or empty diffs as release approval.</p>\n<hr>\n<h2>Examples</h2>\n<pre><code>\n\n# Source code\nsap-adt get-program SAPMV45A\nsap-adt get-class ZCL_MY_CLASS\nsap-adt get-function BAPI_SALESORDER_CREATEFROMDAT2 --group BAPI_SD_SALESORDER\nsap-adt get-include MV45AFZZ\nsap-adt get-interface ZIF_MY_INTERFACE\n\n# Dictionary objects\nsap-adt get-table VBAK\nsap-adt get-structure VBAKKOM\nsap-adt get-type-info MATNR\nsap-adt get-type-group ICON\n\n# Discovery\nsap-adt search-object \"ZCL_ORDER*\" --max-results 20\nsap-adt get-package ZMYPACKAGE\nsap-adt get-transaction VA01\nsap-adt get-cds-view ZI_INVENTORY_POSITION\n\n# Analysis (read-only)\nsap-adt syntax-check class ZCL_MY_CLASS\nsap-adt where-used class ZCL_PAYMENT_PROCESSOR\nsap-adt run-sql \"SELECT * FROM t001 UP TO 5 ROWS\"\n\n# Write &amp; activate (allow_write + confirm each time)\nsap-adt write-source class ZCL_MY_CLASS --file /tmp/zcl.abap\nsap-adt write-source class ZCL_MY_CLASS --file /tmp/zcl.abap --activate   # write + activate in one step\nsap-adt write-source class ZCL_MY_CLASS --file /tmp/zcl.abap --dry-run    # diff + hashes, nothing written\nsap-adt activate class ZCL_MY_CLASS\n\n# Transport management\nsap-adt list-transports --status D                              # read-only\nsap-adt create-transport --package '$TMP' --description \"My feature\" \\\n  --ref /sap/bc/adt/programs/programs/zmy_feature/source/main        # allow_transport + confirm\nsap-adt release-transport DEVK900001                           # allow_transport + confirm\n</code></pre>\n<hr>\n<h2>SAP Prerequisites</h2>\n<h3>1. Activate ADT services</h3>\n<p>In transaction <code>SICF</code>, activate the following service paths:</p>\n<table>\n<thead>\n<tr>\n<th>Service path</th>\n<th>Required for</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>/sap/bc/adt</code></td>\n<td>All commands</td>\n</tr>\n<tr>\n<td><code>/sap/bc/adt/datapreview</code></td>\n<td><code>run-sql</code> (Open SQL Data Preview)</td>\n</tr>\n</tbody>\n</table>\n<h3>2. Assign user authorization</h3>\n<table>\n<thead>\n<tr>\n<th>Operations</th>\n<th>Required authorization</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>All read commands</td>\n<td>Role <code>SAP_ADT_BASE</code> — or manually: <code>S_ADT_RES</code> (ADT resource access) + <code>S_RFC</code> (ADT function groups)</td>\n</tr>\n<tr>\n<td><code>write-source</code>, <code>activate</code></td>\n<td><code>S_DEVELOP</code> with <code>ACTVT=02</code> on the relevant object types</td>\n</tr>\n<tr>\n<td><code>create-transport</code>, <code>release-transport</code></td>\n<td><code>S_CTS_ADMI</code> or equivalent transport authorization</td>\n</tr>\n<tr>\n<td><code>list-transports</code></td>\n<td>Covered by <code>SAP_ADT_BASE</code> — no additional authorization needed</td>\n</tr>\n</tbody>\n</table>\n<hr>\n<h2>Output contract</h2>\n<p>All read commands emit the JSON envelope documented in <strong>SKILL.md</strong>\n(<code>ok</code>/<code>format_version</code>/<code>command</code>/<code>object</code>/<code>kind</code>/<code>data</code>/<code>meta</code>); source\ncommands default to plain ABAP text and every kind defaults to JSON. Kinds:\n<code>source</code>, <code>fields</code>, <code>objects</code>, <code>rows</code>, <code>records</code>, <code>findings</code>, <code>scalar</code>,\n<code>capabilities</code>, <code>feeds</code>, <code>versions</code>, <code>diff</code>.\n<code>-f/--format json|text|xml</code> (<code>SAP_ADT_FORMAT</code>) selects the format; <code>xml</code>\nreturns the raw ADT payload. Empty results are <code>ok:true,row_count:0,exit 0</code>.\nPartial history/transport diffs instead return <code>meta.partial:true</code> and\n<code>data.evidence_gaps</code> with exit 1, even if <code>ok:true</code>. Aggregated history and\ncomputed diffs do not provide raw XML.</p>\n<p>Errors are JSON envelopes on <strong>stderr</strong> with exit tiers 1 (retryable),\n2 (config/credentials), 3 (safety-policy refusal — no retry), 4 (not found);\n<code>status</code>/<code>profile</code>/<code>credentials</code> remain human-readable text. See SKILL.md for\nall 16 error codes.</p>\n<hr>\n<h2>Error Reference</h2>\n<table>\n<thead>\n<tr>\n<th>Error</th>\n<th>Cause</th>\n<th>Fix</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>Not configured</code></td>\n<td>No credentials saved</td>\n<td>Run <code>configure</code></td>\n</tr>\n<tr>\n<td><code>Profile 'x' not found</code></td>\n<td>Unknown profile on <code>--profile</code> / <code>SAP_PROFILE</code></td>\n<td>Run <code>profile list</code> or <code>configure --profile x</code></td>\n</tr>\n<tr>\n<td><code>is currently active</code> on remove</td>\n<td>Active profile cannot be removed</td>\n<td><code>profile use &lt;other&gt;</code> first</td>\n</tr>\n<tr>\n<td><code>HTTP 401</code></td>\n<td>Wrong username or password</td>\n<td>Re-run <code>configure</code> or <code>credentials set &lt;profile&gt;</code></td>\n</tr>\n<tr>\n<td><code>no password ... in the keystore</code></td>\n<td>Profile has no stored password</td>\n<td><code>credentials set &lt;profile&gt;</code> (or <code>credentials doctor</code>)</td>\n</tr>\n<tr>\n<td><code>HTTP 403</code></td>\n<td>Missing <code>SAP_ADT_BASE</code> role</td>\n<td>Ask Basis to assign authorization</td>\n</tr>\n<tr>\n<td><code>HTTP 404</code></td>\n<td>Object name not found</td>\n<td>Try <code>search-object</code> to find the correct name</td>\n</tr>\n<tr>\n<td><code>HTTP 503</code></td>\n<td><code>/sap/bc/adt</code> not active</td>\n<td>Ask Basis to activate in <code>SICF</code></td>\n</tr>\n<tr>\n<td>SSL error</td>\n<td>Self-signed certificate</td>\n<td>Re-configure with <code>SAP_VERIFY_SSL=0</code></td>\n</tr>\n</tbody>\n</table>\n<hr>\n<h2>Security Considerations</h2>\n<ul>\n<li><strong>Passwords are never stored in plain text.</strong> <code>~/.sap-adt-cli/config.json</code> keeps only\nnon-secret connection fields (URL, username, client, language, TLS flags); the password\nlives in the OS keystore (DPAPI in WSL, Credential Manager, Keychain, Secret Service,\nGPG <code>pass</code>, or the passphrase-encrypted fallback file). Run <code>credentials doctor</code> to see\nwhich backend is active. Old plaintext configs are migrated automatically and stripped.</li>\n<li>DPAPI/Keychain-bound secrets <strong>cannot be copied to another machine or user</strong> — set them\nagain after moving machines. Do not commit <code>secrets.json</code>, <code>secrets.enc</code> or any <code>.env</code>\nfile; the config directory itself should stay on the native filesystem (WSL <code>/mnt/c</code>\nmakes chmod ineffective — <code>credentials doctor</code> warns about this).</li>\n<li>Avoid passing passwords via <code>--password</code> — they appear in shell history and <code>ps</code> output.\nPrefer the interactive <code>configure</code>/<code>credentials set</code> prompts, <code>SAP_ADT_&lt;PROFILE&gt;_PASSWORD</code>\nor the <code>SAP_PASSWORD</code> environment variable.</li>\n<li>Log output (including <code>-v/--verbose</code>) and HTTP error tracebacks redact <code>Authorization</code>\nheaders and password literals; there is no <code>credentials export</code> command by design.</li>\n<li>Write and transport commands require explicit capability flags (<code>allow_write</code>, <code>allow_transport</code>)\nplus per-operation <code>[y/N]</code> confirmation. Never enable on production systems.</li>\n<li>For shared or CI environments, use short-lived credentials and rotate them regularly.</li>\n<li>Optional dependencies stay optional: <code>pip install keyring</code> for desktop vaults,\n<code>pip install cryptography</code> for the encrypted-file fallback (the <code>[file]</code> extra).\nThe core CLI remains dependency-light.</li>\n</ul>\n<hr>\n<h2>Changelog</h2>\n<h3>v1.4.0 — Installable CLI &amp; multichannel distribution</h3>\n<ul>\n<li><strong>The CLI is now installable independently of the skill docs</strong>: <code>src/sap_adt</code> package, <code>sap-adt</code> entry point, npm (<code>sap-adt-cli</code>), PyPI (<code>sap-adt</code>), Linux portable runtime</li>\n<li><strong>No runtime auto-install</strong>: dependencies must be installed once; old skill-local script entry points were removed</li>\n<li><strong>Transport collection in the CLI</strong>: <code>sap-adt transport collect|ping</code> (read-only); the legacy plaintext collector config is read only via explicit <code>--legacy-config</code></li>\n<li><strong>Dotenv is explicit</strong>: <code>SAP_ADT_DOTENV</code> declares the file; the CLI never scans the CWD or skill folder</li>\n<li>Program name <code>sap-adt-cli</code> → <code>sap-adt</code>; all command semantics, the 18 error codes, exit tiers and safety gates unchanged</li>\n</ul>\n<h3>v1.3.0 — Keystore credential storage</h3>\n<ul>\n<li><strong>No more plaintext passwords</strong>: profile passwords move to pluggable OS keystore backends\n(<code>env</code> → <code>keyring</code> → <code>dpapi</code> → <code>pass</code> → <code>file</code>); <code>config.json</code> keeps non-secret fields only</li>\n<li><strong>WSL2</strong>: Windows DPAPI via <code>powershell.exe</code> interop, secret passed over stdin (never argv)</li>\n<li><strong>Automatic one-way migration</strong> of existing plaintext configs on first run, with a\npassword-rotation warning; idempotent and creates no backup copies</li>\n<li><strong>New commands</strong>: <code>credentials set|forget|status|doctor</code>; new global options <code>--keystore</code>, <code>-v/--verbose</code></li>\n<li><strong>Leak hardening</strong>: masked credential/config reprs, redacting log filter, sanitized\nHTTP errors (no Authorization header in tracebacks), per-process decryption cache</li>\n<li>Plaintext <code>keyrings.alt</code> (incl. PlaintextKeyring) and chainer backends are rejected\nas insecure</li>\n</ul>\n<h3>v1.2.0 — Multi-environment profiles</h3>\n<ul>\n<li><strong>Multiple SAP environments in one config</strong>: <code>~/.sap-adt-cli/config.json</code> now stores named profiles (<code>dev</code>, <code>qas</code>, <code>prd</code>, ...); old single-connection configs are migrated automatically to a <code>default</code> profile</li>\n<li><strong>New commands</strong>: <code>configure --profile NAME</code>, <code>profile list</code>, <code>profile use NAME</code> (persistent switch), <code>profile remove NAME</code></li>\n<li><strong>One-off profile override</strong>: global <code>--profile NAME</code> option (before the command name) or <code>SAP_PROFILE</code> env var; selection order is <code>--profile</code> &gt; <code>SAP_PROFILE</code> &gt; active profile</li>\n<li><strong>Capability flags are global</strong>: <code>allow_write</code> / <code>allow_transport</code> now apply to every profile — check <code>status</code> before write operations</li>\n<li><strong>Wizard UX</strong>: prompts for a profile name; re-editing a profile with a blank password keeps the stored password</li>\n<li><code>SAP_ADT_DOTENV</code> / <code>SAP_*</code> environment variables remain a single-environment override layer that wins over all profiles</li>\n</ul>\n<h3>v1.1.1 — <code>run-sql</code> robustness improvements</h3>\n<ul>\n<li><strong>GET → POST fallback</strong>: <code>run-sql</code> now first attempts a <code>GET</code> request; if the server returns HTTP 405 (Method Not Allowed), it automatically retries as a <code>POST</code> with the SQL in the request body — improves compatibility with S/4HANA systems that require <code>POST</code> on the Data Preview endpoint</li>\n<li><strong>Correct XML parser</strong>: <code>_parse_sql_result</code> now reads the proper ADT column structure (<code>&lt;columns&gt;/&lt;metadata name=\"...\"&gt;/&lt;dataSet&gt;/&lt;data&gt;</code>) instead of guessing child element names; the old heuristic is kept as a fallback for older SAP releases</li>\n<li><strong>Typed <code>Accept</code> header</strong>: requests now negotiate <code>application/vnd.sap.adt.datapreview.table.v1+xml</code> for more reliable content handling</li>\n</ul>\n<h3>v1.1.0 — Capability expansion &amp; rename</h3>\n<ul>\n<li><strong>10 new commands</strong>: <code>syntax-check</code>, <code>get-cds-view</code>, <code>get-type-group</code>, <code>write-source</code>, <code>activate</code>, <code>where-used</code>, <code>run-sql</code>, <code>list-transports</code>, <code>create-transport</code>, <code>release-transport</code></li>\n<li><strong>Dual-guard write protection</strong>: capability flags (<code>allow_write</code> / <code>allow_transport</code>) must be enabled in config, AND each destructive operation requires explicit <code>[y/N]</code> confirmation at runtime</li>\n<li><strong>DML-safe SQL</strong>: <code>run-sql</code> accepts only <code>SELECT</code> statements; <code>INSERT</code>, <code>UPDATE</code>, <code>DELETE</code>, <code>MERGE</code>, <code>MODIFY</code>, <code>TRUNCATE</code> are blocked at the CLI layer regardless of system permissions</li>\n<li><strong>Renamed</strong> from <code>sap-abap-cli</code> to <code>sap-adt-cli</code> to better reflect the ADT API scope</li>\n<li><strong>Config directory</strong> migrated from <code>~/.sap-abap-cli/</code> to <code>~/.sap-adt-cli/</code>; automatic migration on first run if old config exists</li>\n</ul>\n<h3>v1.0.0 — Initial release</h3>\n<ul>\n<li>Read-only ADT skill: programs, classes, function modules, function groups, interfaces, includes, DDIC tables/structures/types, packages, transactions, object search</li>\n</ul>\n<hr>\n<h2>License</h2>\n<p><a href=\"https://github.com/shrek-abaper/sap-watt/blob/main/LICENSE\">MIT</a></p>\n","files":[{"path":"evals/evals.json","sizeBytes":20381,"isText":true},{"path":"README.md","sizeBytes":31680,"isText":true},{"path":"README.zh-CN.md","sizeBytes":30383,"isText":true},{"path":"references/adt_api.md","sizeBytes":26601,"isText":true},{"path":"references/core-workflows.md","sizeBytes":15341,"isText":true},{"path":"references/credentials.md","sizeBytes":4487,"isText":true},{"path":"references/debugging.md","sizeBytes":7313,"isText":true},{"path":"references/debug-session.schema.json","sizeBytes":1639,"isText":true},{"path":"references/development.md","sizeBytes":10526,"isText":true},{"path":"references/diagnosis-report.schema.json","sizeBytes":2396,"isText":true},{"path":"references/diagnostics-history.md","sizeBytes":5412,"isText":true},{"path":"references/examples.md","sizeBytes":7033,"isText":true},{"path":"references/execution.md","sizeBytes":6460,"isText":true},{"path":"references/executor.md","sizeBytes":8212,"isText":true},{"path":"references/profiles.md","sizeBytes":3541,"isText":true},{"path":"references/runtime-compatibility.json","sizeBytes":1285,"isText":true},{"path":"references/setup.md","sizeBytes":18424,"isText":true},{"path":"references/test-failure-diagnosis.md","sizeBytes":6554,"isText":true},{"path":"references/updating.md","sizeBytes":5154,"isText":true},{"path":"SKILL.md","sizeBytes":40321,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"notes-only","suspicious":0,"notes":6,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-11-29T00:41:51.839127Z","sha256":"F4C26EBF1F4B935902B8399F78CDF6EEA087A616788C6D05B41495810AFB74B9","sizeBytes":105383},"review":null,"source":{"repositoryUrl":"https://github.com/shrek-abaper/sap-watt","path":"skills/sap-adt-cli","license":"MIT","commit":"d5ccd306a1f5462c6c6e3d1e2d7ee8b16464a556","subtreeSha":"B4E34BDE56EE9A76473BDFCF28A46C70D96B1DC40B8673A53C7F907D61328804","lastSyncedAt":"2026-11-29T00:41:47.351849Z"},"reviewedAt":"2026-11-29T00:41:55.7139Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/shrek-abaper/sap-watt/tree/main/skills/sap-adt-cli"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install shrek-abaper-sap-watt@llmmart"},{"target":"git","command":"git clone https://github.com/shrek-abaper/sap-watt.git"}]}