gh cybros extension

A GitHub CLI extension that brings Cybros to your terminal via gh cybros .... It's a single Bash script wrapping the REST API with curl + jq, and it shares ~/.cybros/config.toml with the Python cybros CLI — log in with either and both are authenticated.


Requirements

  • gh (GitHub CLI)
  • curl and jq
  • A Cybros API key (cybros_sk_...)

Install

# From the published repo:
gh extension install ayushtenguria/gh-cybros

# Or from a local checkout:
cd clients/gh-cybros && gh extension install .

Verify:

gh cybros help
gh cybros --version

Authenticate

Credentials resolve env → config file (first hit wins):

WhatEnvConfig (~/.cybros/config.toml)
API keyCYBROS_API_KEYapi_key
Base URLCYBROS_API_URLbase_url (default: prod)
gh cybros login                 # verifies the key, writes ~/.cybros/config.toml (0600)
# or, for a session:
export CYBROS_API_KEY=cybros_sk_...

Commands

gh cybros <command> [flags]
CommandDescription
loginStore your API key in ~/.cybros/config.toml.
whoamiShow the authenticated user / org.
scan [--repo NAME]Scan the current (or named) repo, poll, print a summary.
report <scan_id>Print the report for a scan.
findings <scan_id>List findings for a scan (--severity to filter).
auditCompliance overview across frameworks.
ai-review --scan <id>Run / fetch the AI analysis for a scan.
helpShow help.
--versionPrint the extension version.

Flags

FlagApplies toDescription
--jsonall read commandsEmit the raw API response to stdout.
--repo OWNER/NAMEscanTarget repo full name.
--ref REFscanGit ref to scan.
--severity SfindingsFilter by severity.
--scan IDai-reviewScan id to analyze.

Diagnostics go to stderr, so --json keeps stdout clean for piping.

Repo resolution

gh cybros scan figures out which repository to scan by:

  1. --repo OWNER/NAME if provided, else
  2. gh repo view --json nameWithOwner (the current GitHub repo), else
  3. the origin git remote.

It matches that full_name against GET /repositories, calls POST /scans, polls until terminal, and prints a severity summary.

Examples

gh cybros login
gh cybros whoami
gh cybros scan                                   # scan the current repo
gh cybros scan --repo octo-org/api --json | jq '.findings_summary'
gh cybros report scan_123
gh cybros findings scan_123 --severity high
gh cybros audit
gh cybros audit --json | jq '.frameworks[] | {framework, score}'
gh cybros ai-review --scan scan_123

Graceful degradation

  • Missing curl/jq → a clear "X is required" error with an install hint.
  • Missing API key → prompts you to run gh cybros login or set CYBROS_API_KEY.
  • Unreachable API → "network request failed (is the API reachable?)".
  • Missing gh when resolving the repo → falls back to the git origin remote.

See also