Skip to main content

bonafide-raas-cli

Command-line client for Bonafide RaaS (retrieval-as-a-service). It returns cited answers from the Bonafide catalog, runs the multi-agent answer path, runs named skills, and calls the MCP tools. The CLI is a thin client over the REST API, so it holds no secrets of its own.

Install

pipx install bonafide-raas-cli          # or: pip install bonafide-raas-cli
raas --help

Add the AWS extra only if you use RAAS_CREDENTIALS_SECRET:

pipx install "bonafide-raas-cli[aws]"

Validate an install

Run these in order. Each line says what a correct result looks like.

raas --version                       # prints raas <version>
raas use qa                          # {"environment": "qa", "source": "saved", ...}
raas doctor                          # JSON; "api_reachable" ok; exit 0 once you have credentials
raas qa health                       # {"status": "ok"}, exit 0 (needs no sign-in)
raas qa login                        # prints a link and code; approve it in the browser
raas qa retrieve "What is check-in time?"   # cited answer, exit 0 (see "If retrieve fails")
raas logout                          # {"profile": "default", "signed_out": true}
raas bogus                           # usage error, exit 2

If retrieve fails

  • 401 AUTHENTICATION_FAILED after a good sign-in: the signed-in person has no api_keys record. An administrator adds one with principal: "person", keyed by your Keycloak sub (see docs/RaaS-Config-Reference.md).
  • 401 unauthorized_client from raas with a credentials secret: the client is not configured for client credentials in Keycloak.
  • A 502 after a long wait: the request ran past the API's time limit. Retry, or ask for a narrower query.

Automated checks

The CLI, skill and REST contract tests run in CI (.github/workflows/ci.yml). The install check runs on macOS, Linux and Windows (.github/workflows/cli-install.yml). The live checks above need a network and, for retrieve, a sign-in.

Windows

Install with the Python launcher, then pipx:

py -m pip install --user pipx
py -m pipx ensurepath          # then open a new terminal
pipx install bonafide-raas-cli
raas --version

Set environment variables in PowerShell with $env:NAME = "value", for example $env:RAAS_TOKEN = "...". The commands are the same on every platform: raas use qa, raas qa login, raas doctor.

The CLI keeps its files under ~/.config/raas on macOS and Linux, and under %APPDATA%\raas on Windows: settings.json for raas use and profiles.json for profiles.

Your sign-in from raas login is stored in the OS keyring (macOS Keychain, Windows Credential Manager, or the Secret Service on Linux). Where no keyring is available, it's stored in a file, <profile>/token.json, which is readable only by you on macOS and Linux and protected by your profile's permissions on Windows. Set RAAS_AUTH_STORAGE=plaintext to use the file deliberately. raas logout forgets the sign-in for a profile, in the keyring and the file.

Check your setup

raas doctor            # report prerequisites and configuration (JSON; exit 0 when all required checks pass)
raas doctor --fix      # also install missing Python packages, asking first
raas doctor --fix --yes   # install without asking

doctor checks the Python version, that raas is on your PATH, the API URL and that it answers, your credentials (a token, client credentials, a cached raas login), the Keycloak issuer, and the boto3 package that RAAS_CREDENTIALS_SECRET needs. --fix installs only boto3, and only when a credentials secret is configured. It never installs Python itself or pipx: doctor reports those with the command to run.

Configure

Set the default environment once per machine:

raas use qa               # QA is the default from now on
raas login                # signs in to QA
raas use                  # shows the current default
raas use --reset          # back to prod

For one command, name the environment first: raas dev health, or raas prod login. RAAS_ENVIRONMENT overrides the saved default for a shell or a CI job. With nothing set, the default is prod. A raas use default is stored in ~/.config/raas/settings.json.

Built-in environments supply the API URL, the Keycloak issuer and the raas-cli client ID. Your credentials secret, environment variables and ~/.config/raas/profiles.json override them, in that order: environment variable, profile, credentials secret, built-in values.

Authentication

The API checks the bearer token at the gateway before any request reaches the service. The token must be a Keycloak access token issued to a client, and it must carry a client_id claim. A token without that claim is rejected with 401 Unauthorized.

Troubleshooting

Symptom Likely cause
401 Unauthorized Token missing, expired, issued by the wrong Keycloak realm, or without a client_id claim. Sign in again, or ask your administrator to check the client's token settings
401 after setting RAAS_TOKEN The value includes Authorization: or Bearer. Set the bare token
Exit code 3 No credentials set. See the table above

Use

raas health                                            # no credentials needed
raas retrieve "Which hotels are in New York City?"     # cited answer
raas retrieve "..." --mode sources                     # full source records
raas agent "..."                                       # multi-agent answer; read misalignment_flags
raas skills list
raas skills run facts "..."
raas mcp tools
raas mcp call retrieval_search --args '{"query": "..."}'
raas job <job_id>

Output is JSON on stdout. Exit codes: 0 success, 1 API error (details on stderr), 2 usage error, 3 missing configuration.

Changes

0.1.3 (release pending): The CLI identifies itself to the API with the X-RaaS-Client header, so usage can be reported by channel. No behaviour change for users.

0.1.2: Added raas --version, which prints the installed version.

0.1.1: The API accepts a bearer token alone. RAAS_API_KEY is optional and no longer required, so existing configurations keep working. Added the Authentication and Troubleshooting sections.

0.1.0: First public release.

Compatibility

The version follows semantic versioning. A breaking change to the API contract is released as a new major version. Before 1.0, minor versions may still include breaking changes; each release notes them.

Support

Report problems with the command, its version (raas --version), and the exit code. Do not send API keys, tokens or secret names.

License

Apache License 2.0. See LICENSE. This license covers the CLI code only; use of the RaaS service and its data is governed by your service agreement.

Metadata

Release files for bonafide-raas-cli 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bonafide-raas-cli 0.1.7
File Size Uploaded Provenance
bonafide_raas_cli-0.1.7.tar.gz 20.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bonafide-raas-cli 0.1.7
File Interpreter ABI Platform
bonafide_raas_cli-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 45.4 kB

Release files / bonafide_raas_cli-0.1.7.tar.gz

Download URL bonafide_raas_cli-0.1.7.tar.gz
Size 20.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9d3b6a8fbb5c8de4a94010c86c4bb18b623988990b572833b9f99feec811b3f9
BLAKE2b-256 checksum
How to use checksums
3184e05298d7bcfa5fdac1b52504187d15dcbd2b73be3274ba2e2397754a8560
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / bonafide_raas_cli-0.1.7-py3-none-any.whl

Download URL bonafide_raas_cli-0.1.7-py3-none-any.whl
Size 24.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c89dd1f825386a3a42989749f561affaca07755b33feccd04b98aef50d6b9c25
BLAKE2b-256 checksum
How to use checksums
f88189e25fd51bbaf25aa2b2a4758c81cfa5c8138fa352b4640488f3f16367d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for bonafide-raas-cli 0.1.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bonafide_raas_cli-0.1.7.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page