README
ΒΆ
ABAPER - POSIX Compliant ABAP Development Tool
A powerful, POSIX-compliant CLI and REST API tool that combines SAP ABAP Development Tools (ADT) REST services.
β¨ Features
π Dual Mode Operation
- CLI Mode: POSIX-compliant command-line interface for developers
- Server Mode: REST API for web applications and integrations
β‘ High Performance
- Connection Caching: 5-10x faster subsequent operations (30min cache)
- Smart Session Management: Automatic connection reuse and cleanup
- Lightweight Ping Tests: Validates cached connections efficiently
π§ SAP ADT Integration
- Connect to SAP systems via ADT REST services
- Retrieve ABAP programs, classes, functions, structures, tables, interfaces
- Search and browse SAP repository
- List packages and objects
- Create and update ABAP objects
β POSIX Compliance
- Standard exit codes (0, 1, 2, 130, 143)
- Proper signal handling (SIGINT, SIGTERM)
- Clean argument parsing
- Consistent error reporting
π Enhanced User Experience
- Quiet Mode Default: Minimal CLI output for clean automation
- File Logging: Comprehensive logging to files with
--log-file
option - Flexible Output Modes: Choose between quiet, normal, and verbose modes
- Environment Variable Support: Configure via
ABAPER_LOG_FILE
and other env vars
π¦ Installation
Homebrew (macOS)
brew install bluefunda/tap/abaper
Docker
# Pull latest image
docker pull bluefunda/abaper:latest
# Run CLI
docker run --rm bluefunda/abaper:latest abaper --version
# Run server
docker run -p 8080:8080 bluefunda/abaper:latest abaper --server
Manual Installation
Download pre-built binaries from the releases page:
Linux
# AMD64
curl -L https://github.com/bluefunda/abaper/releases/latest/download/abaper_Linux_x86_64.tar.gz | tar xz
# ARM64 (e.g., Raspberry Pi 4, AWS Graviton)
curl -L https://github.com/bluefunda/abaper/releases/latest/download/abaper_Linux_arm64.tar.gz | tar xz
# ARMv7 (e.g., Raspberry Pi 3)
curl -L https://github.com/bluefunda/abaper/releases/latest/download/abaper_Linux_armv7.tar.gz | tar xz
macOS
# Intel Macs
curl -L https://github.com/bluefunda/abaper/releases/latest/download/abaper_Darwin_x86_64.tar.gz | tar xz
# Apple Silicon Macs
curl -L https://github.com/bluefunda/abaper/releases/latest/download/abaper_Darwin_arm64.tar.gz | tar xz
Windows
Download abaper_Windows_x86_64.zip
from the releases page and extract.
Linux Packages
# Debian/Ubuntu
wget https://github.com/bluefunda/abaper/releases/latest/download/abaper_amd64.deb
sudo dpkg -i abaper_amd64.deb
# Red Hat/CentOS/Fedora
wget https://github.com/bluefunda/abaper/releases/latest/download/abaper_amd64.rpm
sudo rpm -i abaper_amd64.rpm
# Alpine
wget https://github.com/bluefunda/abaper/releases/latest/download/abaper_amd64.apk
sudo apk add --allow-untrusted abaper_amd64.apk
π Quick Start
Environment Setup
# Required for SAP operations
export SAP_HOST="your-sap-host:8000"
export SAP_CLIENT="100"
export SAP_USERNAME="your-username"
export SAP_PASSWORD="your-password"
# Optional: Default log file
export ABAPER_LOG_FILE="./logs/abaper.log"
Basic Usage
# Test connection (establishes cache)
abaper connect
# Get objects (uses cached connection - fast!)
abaper get program ZTEST
abaper get class ZCL_UTILITY
abaper get function RFC_READ_TABLE SRFC
# Search and discovery
abaper search objects "Z*"
abaper list packages
# Get help
abaper help
abaper help get
Logging Examples
# Default quiet mode (minimal output)
abaper get program ZTEST
# Quiet mode with comprehensive file logging
abaper --log-file=./logs/abaper.log get program ZTEST
# Normal mode with standard CLI output
abaper --normal analyze class ZCL_TEST
# Verbose debugging with file logging
abaper --verbose --log-file=./debug.log connect
# Use environment variable for consistent logging
export ABAPER_LOG_FILE="./logs/abaper-$(date +%Y%m%d).log"
abaper get program ZTEST
π Command Reference
Syntax
abaper [OPTIONS] ACTION TYPE [NAME] [ARGS...]
Actions
get
- Retrieve ABAP object source codesearch
- Search for ABAP objectslist
- List objects (packages, etc.)connect
- Test ADT connectionhelp
- Show help information
Object Types
program
- ABAP program/reportclass
- ABAP classfunction
- ABAP function module (requires function group)include
- ABAP includeinterface
- ABAP interfacestructure
- ABAP structuretable
- ABAP tablepackage
- ABAP package
Options
-h, --help
- Show help message-v, --version
- Show version information-q, --quiet
- Quiet mode (DEFAULT - minimal CLI output)--normal
- Normal mode (show standard output)-V, --verbose
- Enable verbose output with debug info--log-file=FILE
- Log to specified file (auto-creates directory)--server
- Run as REST API server-p, --port PORT
- Port for server mode (default: 8080)--adt-host=HOST
- SAP system host--adt-client=CLIENT
- SAP client--adt-username=USER
- SAP username--adt-password=PASS
- SAP password
Exit Status
0
- Success1
- General error2
- Invalid usage130
- Interrupted by user (Ctrl+C)143
- Terminated by signal
π₯ Performance Features
Connection Caching
- First Command: ~3-5 seconds (authentication + cache)
- Subsequent Commands: ~0.5-1 seconds (uses cache!)
- Cache Duration: 30 minutes
- Smart Validation: Automatic ping tests and cleanup
Typical Workflow
# First command establishes cache
time abaper connect # ~4 seconds
# Subsequent commands are lightning fast
time abaper get program ZTEST # ~0.6 seconds
time abaper get class ZCL_TEST # ~0.5 seconds
time abaper list packages # ~0.5 seconds
Cache Management
- Automatic expiration after 30 minutes
- Config change detection (different SAP system/credentials)
- Connection health monitoring via ping tests
- Graceful cleanup on exit
π Detailed Examples
Object Retrieval
# Programs
abaper get program ZTEST
abaper get program Z_REPORT_SALES
# Classes
abaper get class ZCL_UTILITY_HELPER
abaper get class CL_STANDARD_CLASS
# Functions (requires function group)
abaper get function Z_CALCULATE_TAX Z_TAX_GROUP
abaper get function RFC_READ_TABLE SRFC
# Other objects
abaper get include ZINCLUDE_TOP
abaper get interface ZIF_BUSINESS_LOGIC
abaper get structure ZSTR_CUSTOMER_DATA
abaper get table ZTABLE_PRODUCTS
abaper get package $TMP
Search and Discovery
# Search objects by pattern
abaper search objects "Z*"
abaper search objects "CL_SALES*" class
abaper search objects "*INTEGRATION*" program class
# List packages
abaper list packages
abaper list packages "Z*"
abaper list packages "*DEV*"
System Operations
# Test connection
abaper connect
# Get help
abaper help # General help
abaper help get # Help for 'get' command
abaper help analyze # Help for 'analyze' command
π₯οΈ Server Mode
Start Server
# Default port 8080
abaper --server
# Custom port
abaper --server -p 9000
# Quiet mode with file logging
abaper --server --log-file=./logs/server.log
REST API Endpoints
GET /health
- Health checkGET /version
- Version information
Docker Support
For Docker deployment examples, see examples/docker/
.
# Quick start with published image
docker run -p 8080:8080 \
-e SAP_HOST="your-host:8000" \
-e SAP_USERNAME="your-user" \
-e SAP_PASSWORD="your-password" \
bluefunda/abaper:latest \
abaper --server
π οΈ Development
Building from Source
# Clone repository
git clone https://github.com/bluefunda/abaper
cd abaper
# Build for development
go build -o abaper .
# Run tests
go test ./...
# Format code
go fmt ./...
Testing Release Build
# Test full release build locally (without publishing)
goreleaser build --snapshot --clean
# Test release process (dry run)
goreleaser release --snapshot --clean
Development Workflow
# Quick development builds
go run . --version
go run . connect
# Format and validate
go fmt ./...
go vet ./...
# Run tests
go test ./...
# Build optimized binary
go build -ldflags="-s -w" -o abaper .
π Troubleshooting
Connection Issues
# Test basic connectivity
abaper connect
# Verbose logging to see cache behavior
abaper --verbose --log-file=./debug.log get program ZTEST
# Check credentials
echo $SAP_HOST $SAP_USERNAME
Common Problems
- "ADT host not configured": Set
SAP_HOST
environment variable - "Authentication failed": Verify
SAP_USERNAME
andSAP_PASSWORD
- "SICF services not found": Activate ADT services in transaction SICF
- Cache issues: Cache automatically expires after 30 minutes
Debug Logging
# See detailed logs including cache hits/misses
abaper --verbose --log-file=./debug.log connect
abaper --verbose --log-file=./debug.log get program ZTEST
# Cache status information (in log file)
{"level":"debug","msg":"Using cached ADT client","cache_age":"5m30s"}
{"level":"info","msg":"ADT cache miss","cache_expired":true}
π Release Process
Releases are automated via GitHub Actions and GoReleaser when you push a tag:
# Create and push a new release
git tag v1.0.0
git push origin v1.0.0
# GitHub Actions automatically:
# - Builds for all supported platforms
# - Creates GitHub release with binaries
# - Updates Homebrew formula
# - Publishes Docker images
# - Generates checksums and changelogs
Supported Platforms
- Linux: x86_64, ARM64, ARMv6, ARMv7
- macOS: x86_64 (Intel), ARM64 (Apple Silicon)
- Windows: x86_64
- FreeBSD: x86_64
Package Formats
- Archives: tar.gz (Unix), zip (Windows)
- Linux Packages: DEB, RPM, APK
- Package Managers: Homebrew (macOS)
- Container Images: Multi-architecture Docker images
π Project Structure
abaper/
βββ main.go # Main application entry point
βββ cli.go # Command-line interface handlers
βββ adt_client.go # SAP ADT client implementation
βββ rest/ # REST API server components
βββ .goreleaser.yml # GoReleaser configuration
βββ .github/workflows/ # GitHub Actions CI/CD
β βββ release.yml # Automated release workflow
βββ examples/ # Usage examples
β βββ docker/ # Docker deployment examples
βββ Dockerfile # Container image definition
βββ go.mod # Go module definition
βββ go.sum # Go dependencies
βββ LICENSE # Apache 2.0 license
βββ README.md # This documentation
π€ Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature
- Make your changes following POSIX standards
- Test thoroughly:
go test ./...
- Test builds:
go build -o abaper .
- Commit:
git commit -am 'Add new feature'
- Push:
git push origin feature/new-feature
- Create a Pull Request
Development Guidelines
- Use standard Go tooling (
go build
,go test
,go fmt
) - Ensure POSIX compliance for all new features
- Add appropriate tests and documentation
- Test file logging functionality with
--log-file
option
π License
Copyright (c) 2025 BlueFunda, Inc. All rights reserved.
Licensed under the Apache License, Version 2.0. See LICENSE for details.
π Links
- Repository: https://github.com/bluefunda/abaper
- Releases: https://github.com/bluefunda/abaper/releases
- Docker Images: https://hub.docker.com/r/bluefunda/abaper
- Issues: https://github.com/bluefunda/abaper/issues
- Organization: BlueFunda, Inc.
Built with β€οΈ by BlueFunda, Inc. - Making ABAP development faster, smarter, and more secure.
Documentation
ΒΆ
There is no documentation for this package.
Click to show internal directories.
Click to hide internal directories.