Skip to content

dongitran/saptools

Repository files navigation

🧰 saptools

A focused monorepo for SAP BTP Cloud Foundry tooling.

GitHub Repo GitHub Stars Node.js pnpm

Utilities in this repository are designed to make SAP BTP Cloud Foundry workflows easier to automate, easier to script, and easier to reuse across local developer tools.


✨ What This Repo Contains

This repository is organized as a monorepo under packages/.

Package Purpose npm
@saptools/cf-sync Sync region → org → space → app from SAP BTP CF into ~/.saptools/cf-structure.json npm
@saptools/cf-xsuaa Fetch XSUAA credentials and cached OAuth2 tokens for any CF app npm
@saptools/cf-debugger Open an SSH debug tunnel to any CF Node.js app from your terminal npm
@saptools/cf-explorer Explore deployed CF app files with safe, read-only SSH workflows npm
@saptools/cf-inspector Capture breakpoints, logpoints, and expression results from CF Node.js apps via CDP npm
@saptools/cf-live-trace Inject a runtime HTTP trace hook into CF Node.js apps and stream request/response events from the CLI npm
@saptools/cf-logs Fetch, stream, parse, and redact SAP BTP CF app logs from one CLI and typed Node.js API npm
@saptools/cf-tail Tail every CF app in a space at once: parallel snapshots, multiplexed live stream, chronological merge, and cross-app filters npm
@saptools/bruno Smart runner for Bruno collections with CF-aware env metadata and automatic XSUAA token injection npm
@saptools/sqltools Export SAP HANA service bindings (VCAP_SERVICES) into VS Code SQLTools connections npm
@saptools/cf-hana Run SQL (SELECT/DML/DDL) against SAP HANA Cloud databases bound to a CF app by region/org/space/app selector npm
@saptools/sharepoint-excel Create, read, append, and update SharePoint-hosted Excel workbooks with app-only Microsoft Graph access npm
@saptools/gitport Port a GitLab source MR into a destination Draft MR with sequential cherry-picks npm
@saptools/jira Jira Cloud CLI and typed API that reuse the JiraOps OAuth token store npm

🚀 Package Focus

☁️ @saptools/cf-sync

Reads the CF topology once, so every downstream tool can skip the cf target dance.

  • 🌍 SAP BTP CF region discovery
  • 🏢 org / space / app traversal
  • 💾 structured JSON output for local tooling
  • 🛠️ both a CLI and a reusable TypeScript API

Docs → packages/cf-sync/README.md

🔐 @saptools/cf-xsuaa

Turns explicit CF app coordinates into a usable bearer token.

  • 🔑 zero-config OAuth2 client_credentials from the app's XSUAA binding
  • 🌍 region-key based CF API resolution via @saptools/cf-sync
  • 💾 disk-cached tokens with automatic expiry handling
  • 🧩 CLI (cf-xsuaa get-token-cached ...) and ergonomic Node API

Docs → packages/cf-xsuaa/README.md

🐛 @saptools/cf-debugger

Open an SSH debug tunnel to any Cloud Foundry Node.js app from your terminal — no IDE required.

  • 🚇 cf ssh-based tunnel to the app's Node inspector
  • 🔁 session lifecycle handling (start, wait, cleanup)
  • 🧰 CLI-first, usable from any shell or editor

Docs → packages/cf-debugger/README.md

🛰️ @saptools/cf-explorer

Explore deployed Cloud Foundry app containers without opening a manual SSH shell.

  • 🔎 read-only roots, ls, find, grep, and view
  • ⚡ reusable SSH-backed sessions for repeated inspection
  • 🧭 file/line candidates for scripts, agents, and debugging tools

Docs → packages/cf-explorer/README.md

🔍 @saptools/cf-inspector

Drive Node.js inspector sessions over the Chrome DevTools Protocol from CLI or TypeScript.

  • 🎯 breakpoint snapshots with conditional captures
  • 📡 non-pausing logpoints and expression evaluation
  • 🔁 automatic CF tunnel composition via @saptools/cf-debugger

Docs → packages/cf-inspector/README.md

🧪 @saptools/cf-live-trace

Injects a bounded HTTP trace hook into a running CF Node.js app, then streams request/response events from a plain CLI.

  • 🚇 robust CF SSH tunnel setup for a selected app instance
  • 🧠 Node inspector startup via /proc process discovery and SIGUSR1
  • 📡 runtime http/https request capture with body preview limits and NDJSON output

Docs → packages/cf-live-trace/README.md

📜 @saptools/cf-logs

Turn raw CF logs into a reusable engine — snapshot, stream, parse, and persist without coupling to any IDE.

  • 📥 recent snapshots and live streams with batched reconnect
  • 🧠 normalized rows from JSON, plain text, and router access logs
  • 🔐 credential redaction plus a bounded, atomic local store

Docs → packages/cf-logs/README.md

🛰️ @saptools/cf-tail

Tail every started app in a CF space at once. A higher-level orchestrator built on top of cf-logs.

  • 🚀 parallel snapshots and a multiplexed live stream across every matching app
  • 🧬 chronological row merge with appName tagging and per-app coloring
  • 🎯 strong selection (--apps, --include-regex, --exclude-regex) and row filters (level, search, source, tenant, status, time)
  • 🔁 auto-rediscovery of new/stopped apps for long-running streams
  • 📊 summary and errors shortcuts for whole-space triage

Docs → packages/cf-tail/README.md

🎯 @saptools/bruno

Runs Bruno collections against XSUAA-protected CF services with zero token juggling.

  • 🏗️ interactive setup-app scaffolds a CF-aware folder tree with seeded __cf_* metadata
  • 🧭 shorthand region/org/space/app path resolution
  • 🔐 automatic XSUAA token injection via @saptools/cf-xsuaa
  • 🎯 pin a default CF context with use, then run with zero args

Docs → packages/bruno/README.md

🗄️ @saptools/sqltools

Exports SAP HANA service bindings from VCAP_SERVICES into VS Code SQLTools connections — from a file, stdin, or a live CF app.

  • 📦 parse VCAP_SERVICES JSON and extract HANA credentials
  • 🔌 write .vscode/settings.json with sqltools.connections ready to use
  • ☁️ from-app pulls VCAP directly from a running CF app via @saptools/cf-sync
  • 🔁 merge mode preserves existing unrelated connections

Docs → packages/sqltools/README.md

🗄️ @saptools/cf-hana

Runs SQL straight against the SAP HANA Cloud database bound to a CF app — pass only a region/org/space/app selector and query.

  • 🎯 selector-based connect; credentials resolved automatically via @saptools/cf-sync
  • ⚡ pooled connections and cache-first credentials for fast repeat queries
  • 🛡️ parameterized queries, transactions, read-only mode, and a destructive-statement guard
  • 🧭 table/column introspection, query-builder shorthands, and a cf-hana CLI

Docs → packages/cf-hana/README.md

📊 @saptools/sharepoint-excel

Automates SharePoint-hosted .xlsx files without relying on delegated-only Graph workbook APIs.

  • 🔐 local profiles with OS credential-vault secret storage by default
  • 🆕 create workbooks without overwriting existing SharePoint files
  • ➕ append JSON records, update A1 cells, add sheets, and read sheets/ranges
  • 🛡️ ETag-protected uploads to avoid silently replacing concurrent edits

Docs → packages/sharepoint-excel/README.md

🔁 @saptools/gitport

Ports one GitLab source MR into another repository as a Draft MR, preserving review context for clean ports and incoming auto-resolved conflicts.

  • 🔗 source MR URL input, including GitLab tab URLs like /diffs
  • 🍒 sequential git cherry-pick -x replay into a destination branch
  • 📝 Draft MR creation with conflict excerpts for review

Docs → packages/gitport/README.md

🧭 @saptools/jira

Turns the JiraOps OAuth session into a scriptable Jira Cloud CLI and TypeScript API.

  • 🔁 shared ~/.jira-oauth/tokens.json token store with JiraOps and jira-oauth-client
  • 🎫 assigned issue reads, issue details, remote links, transitions, and worklogs
  • 📝 issue description, summary, and comment writes with raw ADF retrieval for image-safe round-trip edits
  • 🧪 fake-backed E2E tests that avoid real Atlassian network calls

Docs → packages/jira/README.md


🧱 Monorepo Tooling

The workspace uses:

  • pnpm for package management
  • turbo for task orchestration
  • TypeScript + ESLint across packages

Common root commands:

pnpm install
pnpm build
pnpm typecheck
pnpm test:unit
pnpm test:e2e

Run a command for one package only:

pnpm --filter @saptools/cf-sync build
pnpm --filter @saptools/cf-sync test:unit

🗂️ Repository Layout

.
├── packages/
│   ├── cf-sync/
│   ├── cf-xsuaa/
│   ├── cf-debugger/
│   ├── cf-explorer/
│   ├── cf-inspector/
│   ├── cf-live-trace/
│   ├── cf-logs/
│   ├── cf-tail/
│   ├── bruno/
│   ├── sqltools/
│   ├── cf-hana/
│   ├── sharepoint-excel/
│   ├── gitport/
│   └── jira/
├── package.json
├── pnpm-workspace.yaml
└── turbo.json

👨‍💻 Author

dongtran

📄 License

MIT


Made with ❤️ to make your work life easier!

About

⚡ SAP BTP Cloud Foundry developer tools and CLI packages

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors