abap-kit
v1.2.0
Published
ABAP development CLI for scaffolding and validating ABAP projects, with an AI-assisted workflow
Maintainers
Readme
abap-kit
A lightweight CLI tool for scaffolding ABAP development projects quickly — and for validating ABAP code generated by AI assistants.
Features
- Creates a complete ABAP project structure in seconds
- Generates starter ABAP objects in abapGit file format (deployable to a real SAP system): a program, a sample interface and a class implementing it, with ABAP Unit tests
- Sets up abaplint and transpiler configuration with the full open-abap library set
- Validates a single ABAP object end-to-end (
abap-kit test): lint, then transpile + ABAP Unit - Prints an AI-friendly project snapshot (
abap-kit context) and machine-readable object lists (abap-kit list --json) - Cross-platform
npm run exec/npm run unit/npm testscripts (Windows, macOS, Linux) - Adds VS Code recommendations for ABAP development
- Creates a ready-to-use README and project skeleton
- Self-updates via
abap-kit update
Installation
Install globally with npm:
npm install -g abap-kitUsage
Create a new project:
abap-kit create my-abap-projectSkip dependency installation (run npm install later), overwrite an existing directory, or scaffold without the sample ABAP objects:
abap-kit create my-abap-project --no-install
abap-kit create my-abap-project --force
abap-kit create my-abap-project --empty--empty skips the sample program/interface/class — ideal when you are starting from a blank src/ and generating all ABAP code (for example with an AI assistant). The harness (configs, scripts, src/) is still scaffolded.
Then run:
cd my-abap-project
npm run execList objects, optionally filtered by type (the type is the raw abapGit file extension — clas, intf, prog, fugr, dtel, doma, ...), or as machine-readable JSON:
abap-kit list
abap-kit list --type clas
abap-kit list --jsonValidate a single ABAP object — fast structural pre-checks, a targeted abaplint pass, then the full transpile + ABAP Unit pipeline:
abap-kit test zcl_demo
abap-kit test zcl_demo --lint-onlyPrint an AI-friendly project snapshot (dependencies, transpiler config, object inventory with test status, npm scripts):
abap-kit context
abap-kit context --jsonKeep the @abaplint npm dependencies and transpiler libs up to date:
abap-kit sync
abap-kit sync --no-installCommands
abap-kit create <project-name>– Create a new project (--force,--no-install,--emptyoptions)abap-kit init– Scaffold a project in the current directory (--force,--no-install,--emptyoptions)abap-kit list– List ABAP objects insrc/(--type <ext>filters by the raw file extension, e.g.clas,dtel;--jsonprints a{name, type, hasTest}array)abap-kit test <object>– Validate a single ABAP object: a targeted abaplint pass, then the full transpile + ABAP Unit pipeline (--lint-onlystops before transpiling)abap-kit context– Print an AI-friendly project snapshot: dependencies, transpiler config, objects with test status, npm scripts (--jsonfor structured output)abap-kit sync– Update @abaplint dependencies and transpiler libs (--no-installskips npm install)abap-kit clean– Run abap-cleaner onsrc/. The binary path is required via--bin <path>or theABAP_CLEANER_PATHenvironment variable. The--releaseargument is passed automatically from the numericsyntax.versioninabaplint.json(e.g.v752→--release 752); if no numeric release is found, the cleaner runs with its default version:abap-kit clean --bin /path/to/abap-cleaner ABAP_CLEANER_PATH=/path/to/abap-cleaner abap-kit cleanabap-kit ci– Generate a GitHub Actions workflow in the current projectabap-kit update– Update abap-kit to the latest version (npm install -g abap-kit@latest)abap-kit help <command>– Show detailed help for a specific commandabap-kit --help– Show helpabap-kit --version– Show installed version
Project Structure
The generated project includes:
src/for ABAP source files in abapGit file format (sample program + interface + class with unit tests).abapgit.xmlfor abapGit repository configuration (ready to link to a SAP system).gitmodulesfor git submodule tracking of open-abap librariesdeps/for git submodule dependenciesscripts/clean.mjsoutput-purge helperscripts/setup.mjsfor runtime setupscripts/run.mjscross-platform program runnerabaplint-transpiler.jsonfor transpilation configabaplint.jsonfor linting config.vscode/extensions.jsonfor editor recommendations
AI-assisted development
abap-kit is designed to close the loop when an AI assistant writes ABAP for you:
- Give the assistant context — paste the output of
abap-kit contextso it knows the project's objects, test status and configuration. - Let it generate files — AI-produced ABAP goes straight into
src/in abapGit file format. Follow the abapGit conventions:- main source in
<name>.<type>.abap(e.g.zcl_demo.clas.abap) - test classes in a separate
<name>.clas.testclasses.abapfile — the transpiler rejectsFOR TESTINGclasses in the main source file (Unexpected CLASSDEFINITION) - class/interface metadata in
<name>.clas.xml/<name>.intf.xml
- main source in
- Validate fast —
abap-kit test <object> --lint-onlyruns a targeted abaplint pass on the object's files without the heavy transpile. Structural problems (test class in the wrong file, missing XML) are abaplint's job, and it reports them directly. - Run the real tests —
abap-kit test <object>transpiles the project with the open-abap libraries and executes the ABAP Unit tests for real (this clones the open-abap libs, so it is slower).
The same pipeline is what npm run unit runs for the whole project, and what the generated CI workflow runs on every push.
CI
When you run the CLI with the CI option, it generates a GitHub Actions workflow for the created project.
Example:
abap-kit ciThis creates a workflow file at:
.github/workflows/lint.yml
The generated workflow runs on pushes and pull requests and executes:
npm cinpm test(lint + transpiled unit tests)
License
MIT
