sapbruno
A terminal UI that runs Bruno collections against a CAP service, fetching an OAuth2 client_credentials token before each run so collections that fail with 401 under bru run work in CI.
Collections that authenticate fine in the Bruno desktop app return 401 under bru run, which breaks them in CI. This fetches the token before each run, writes it into the per-environment .bru file, and adds a local mode using basic auth against a CAP server running on a laptop.
Facts
Where it sits
Who is behind it
In the atlas: maintains 18, contributes to 18@dongitranmaintainer
What it declares
Every artifact
- Type
- CLI
- Origin
- Independently maintained
- Runtime
- build time
As a CLI
- Distributed through
- npm
Connections
Proving a service still does what it did, without a deployment
OAuth server issuing JWTs and holding scopes for BTP apps
Download
Install
npm add sapbrunoDerived from the package name. No recipe recorded; the README has the configuration.
Architecture
Download
README
quoted from dongitran/SAP-Bruno under MIT, readsapbruno
Interactive TUI runner for Bruno collections with OAuth2 client_credentials auto-fetch and pluggable credential providers.
Why
Bruno's GUI handles OAuth2 nicely, but the CLI does not yet trigger OAuth flows — meaning collections that work in the desktop app fail with 401 when run from bru run (which breaks CI pipelines). sapbruno:
- Fetches OAuth2 tokens just-in-time before each
bru run - Writes them into the per-environment
.bruenv file - Wraps everything in a keyboard-driven TUI so you can pick env → service → suite → file without leaving the terminal
- Supports a separate "local" mock-user mode (basic auth) for working against a locally running CAP server
It works with any Bruno collection — there is no hardcoded folder convention or auth scheme. SAP BTP / xsuaa is just one supported credential provider, configurable via plugins.
Install
pnpm add -D sapbruno @usebruno/cli
# or
npm i -D sapbruno @usebruno/cli
Quick start
- Drop a
sapbruno.config.jsonnext to yourcollections/folder. Seeexamples/sapbruno.config.json. - Run
npx sapbruno. - Pick an environment, group, service, and suite. The OAuth token (if needed) is fetched automatically before
bru runis invoked.
Configuration
Minimal config — runs against dev with credentials from environment variables:
{
"collections": "./collections",
"environments": {
"dev": {
"auth": { "type": "oauth2-client-credentials" },
"credentialProvider": {
"type": "env",
"tokenUrl": "DEV_TOKEN_URL",
"clientId": "DEV_CLIENT_ID",
"clientSecret": "DEV_CLIENT_SECRET"
}
}
}
}
Auth types
auth.type | Behavior |
|---|---|
oauth2-client-credentials | Fetch a bearer token via client_credentials grant before each run. |
basic | Inject Basic auth from a local user file (multi-user picker). |
none | Run requests with whatever auth the .bru files already define. |
Built-in credential providers
credentialProvider.type | Source of client_id / client_secret / token_url |
|---|---|
env | Process environment variables (field names configurable). |
file | A local JSON file mapping prefix → credentials. Useful for downloaded service keys. |
manual | Prompts interactively. Good for one-off/dev usage. |
Third-party providers (e.g. SAP CF/BTP) can be published as separate npm packages — see the CredentialProvider interface.
Variable naming convention
For each service, sapbruno writes these vars into the env .bru file:
{prefix}_oauth_token_url
{prefix}_oauth_client_id
{prefix}_oauth_client_secret
{prefix}_auth_header # ← Bearer <token> or Basic <base64>
Reference {{<prefix>_auth_header}} in your Bruno requests' Authorization header.
The prefix is auto-derived: {group}_{service_folder} (lowercased, dashes → underscores). Configure prefixStrip to chop a shared prefix off every service folder.
CLI
sapbruno # interactive TUI (default)
sapbruno run # alias for default
sapbruno token --env dev --prefix <prefix> # fetch token only (planned)
Roadmap
-
tokensubcommand - Authorization Code grant (browser + PKCE)
-
@sapbruno/cf-btpprovider package — pulls xsuaa creds fromcf curl /v3/apps/{guid}/env - Headless
--non-interactivemode for CI
License
MIT
History
Others providing
Compare all 8 on the Testing page →- com.sap.cds:cds-services-bomcom.sap.cds:cds-services-bomThe Maven bill of materials for CAP Java, pinning every com.sap.cds module in a release, from the API and core runtime to the Spring Boot starters and the CQN engine, to the same version.sap official, capMaven bill of materials pinning CAP Java module versionsfrom CAP
- @cap-js/cds-test@cap-js/cds-testTest support for CAP Node.js, installed as a dev dependency: it starts the project's server for the test, hands the test an HTTP client bound to it, and carries the assertions.sap official, capTest support for CAP Node.js: server start, HTTP client, assertionsfrom CAP
- cds-cucumbercds-cucumberBehaviour-driven tests for CAP applications: Gherkin scenarios that drive a running service rather than assertions written against handlers.community org, capGherkin scenarios driving a running CAP servicefrom CAP
- cds-launchpad-plugincds-launchpad-pluginIndexes every SAPUI5 application in a workspace into one sandbox launchpad served by the CDS server, so all of them can be opened from a single page while developing.independent, capSandbox launchpad for all SAPUI5 apps in a CAP workspacefrom CAP
- enforce-export-coverageenforce-export-coverageA static-analysis command line that checks every exported TypeScript function has a corresponding test, without running the test suite.independent, generalStatic check that each exported TypeScript function has a testfrom General
- @sap-ux/fe-mockserver-plugin-cds@sap-ux/fe-mockserver-plugin-cdsLets the Fiori Elements mock server take a CDS file as its metadata source, so a UI is developed against the real model before a service exists.sap official, capFiori Elements mock server plugin taking a CDS file as metadatafrom CAP
- @saptools/bruno@saptools/brunoA command line that runs Bruno collections against XSUAA-protected apps on Cloud Foundry, fetching the app's token and writing it into the selected environment file before each run.independent, btpRunner for Bruno collections against XSUAA-protected CF appsfrom BTP/BAIP
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
History in the atlas
- First seen.
For your agent
- Ref
artifact:dongitran-sapbruno- JSON
- /artifacts/dongitran-sapbruno.json
- MCP
- Connecting an agent