@sunasteriskrnd/sdo-cli
v0.1.0
Published
sdo — Sun* SDO platform CLI. Umbrella binary for SDO services (nyx, ...).
Maintainers
Readme
@sunasteriskrnd/sdo-cli
sdo — Sun* SDO platform CLI. An umbrella binary that wraps SDO services. First service: Nyx (security vulnerability + EOL lookups).
Install
npm i -g @sunasteriskrnd/sdo-cli
# or run once
npx @sunasteriskrnd/sdo-cli nyx lookup vuln --helpRequires Node.js >= 20.
Quick start
# 1. Drop your API key in a config file (or use NYX_API_KEY env var)
mkdir -p ~/.config/sdo
cat > ~/.config/sdo/config.yaml <<EOF
nyx:
apiKey: nyx_xxxxxxxxxxxxxxxxxxxx
EOF
# 2. Look up CVEs for inline items
sdo nyx lookup vuln [email protected]:techstack [email protected]
# 3. Check EOL status from a file
sdo nyx lookup eol --file deps.yaml
# 4. Pipe JSON from stdin
cat deps.json | sdo nyx lookup vuln -Commands
sdo nyx lookup vuln [items...]— CVE lookup viaPOST /lookup/vulnssdo nyx lookup eol [items...]— EOL status viaPOST /lookup/eolsdo nyx doctor— diagnose config resolution (API key redacted)
See docs/cli.md for the full CLI reference and docs/nyx.md for Nyx-specific notes.
Configuration
Resolution order (lowest precedence first):
- Built-in defaults (
baseUrl: https://nyx.sun-asterisk.vn,timeout: 30000) - User config:
~/.config/sdo/config.yaml(or$XDG_CONFIG_HOME/sdo/config.yaml) - Project config:
./sdo.config.yamlin CWD - Environment variables (
NYX_BASE_URL,NYX_API_KEY,NYX_TIMEOUT,SDO_OUTPUT,NO_COLOR) - CLI flags (
--api-key,--base-url,--timeout,--json,--no-color)
Example sdo.config.yaml:
defaults:
output: table
nyx:
baseUrl: https://nyx.sun-asterisk.vn
apiKey: nyx_xxxxxxxxxxxxxxxxxxxx
timeout: 30000Develop
bun install
bun run dev nyx lookup vuln --help
bun test # unit tests (mocked HTTP, fast)
bun run test:e2e # live API hits — requires NYX_API_KEY in env or config
bun run build
node dist/bin/sdo.js --versionE2E test suite
tests/e2e/nyx-lookup.e2e.test.ts exercises the real Nyx API. Gated by NYX_E2E=1 so the default bun test and CI never trigger network calls. Credentials resolve through the same layered chain as the CLI (env → user config → project config), so once you can run sdo nyx doctor successfully, e2e tests will work too.
bun run test:e2e # NYX_E2E=1 bun test tests/e2e
bun run test:all # unit + e2e in one goRun e2e locally before cutting a release. Add an issue to the repo if a test fails for reasons unrelated to your change — server-side response drift can break the strict schema assertion (see cvssScore note in src/services/nyx/types.ts).
License
UNLICENSED (proprietary, Sun* internal).
