@sunasteriskrnd/sdo-cli
v0.2.0
Published
sdo — Sun* DevOps platform (SDO) CLI. Umbrella binary for SDO services (nyx, clio).
Downloads
33
Readme
@sunasteriskrnd/sdo-cli
sdo — Sun* DevOps platform (SDO) CLI. An umbrella binary that wraps SDO services. Current services: Nyx (security vulnerability + EOL lookups) and Clio (knowledge-graph queries + project artifact uploads).
Install
npm i -g @sunasteriskrnd/sdo-cli
# or run once
npx @sunasteriskrnd/sdo-cli nyx lookup vuln --helpRequires Node.js >= 20.
Quick start — Nyx
# 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 -Quick start — Clio
The CLI does not accept the Clio API key as a flag. Use env var or config file. Shell history is treated as untrusted.
# 1. Configure — API key MUST come from env or config file (never argv)
cat >> ~/.config/sdo/config.yaml <<EOF
clio:
apiKey: clio_xxxxxxxxxxxxxxxxxxxx
EOF
# Or via env:
# export CLIO_API_KEY=clio_xxxxxxxxxxxxxxxxxxxx
# 2. Query the knowledge graph
sdo clio --project 42 query "What's the auth model?"
# 3. Upload a pre-rendered proposal (in-place replace; idempotent)
sdo clio --project 42 artifacts upload --type proposal-slide ./deck.pptx
# 4. Upload a project profile xlsx
sdo clio --project 42 artifacts upload --type project-profile ./profile.xlsx
# 5. Single-step multipart asset upload (document or slide-content)
sdo clio --project 42 assets put --type document ./report.pdf
# 6. Diagnose
sdo clio doctorCommands
Nyx
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)
Clio
sdo clio --project <id> query <query>— knowledge-graph querysdo clio --project <id> artifacts upload --type <kind> <file>— 2-step presigned upload (proposal-slide / project-profile)sdo clio --project <id> assets put --type <kind> <file>— 1-step multipart upload (document / slide-content)sdo clio doctor— diagnose config resolution (API key redacted, no network)
See docs/cli.md for the full CLI reference, docs/nyx.md for Nyx-specific notes, and docs/clio.md for Clio-specific notes.
Configuration
Resolution order (lowest precedence first):
- Built-in defaults
- Nyx:
baseUrl: https://nyx.sun-asterisk.vn,timeout: 30000 - Clio:
baseUrl: https://clio.sun-asterisk.vn,requestTimeout: 60000,uploadTimeout: 300000
- Nyx:
- User config:
~/.config/sdo/config.yaml(or$XDG_CONFIG_HOME/sdo/config.yaml) - Project config:
./sdo.config.yamlin CWD - Environment variables
- Nyx:
NYX_BASE_URL,NYX_API_KEY,NYX_TIMEOUT - Clio:
CLIO_BASE_URL,CLIO_API_KEY,CLIO_REQUEST_TIMEOUT,CLIO_UPLOAD_TIMEOUT - Shared:
SDO_OUTPUT,NO_COLOR
- Nyx:
- CLI flags
- Root (shared):
--json,--no-color - Nyx (on
nyxgroup):--base-url,--api-key,--timeout - Clio (on
cliogroup):--base-url,--request-timeout,--upload-timeout,--project - No
--api-keyflag for Clio — env or config file only
- Root (shared):
Example sdo.config.yaml:
defaults:
output: table
nyx:
baseUrl: https://nyx.sun-asterisk.vn
apiKey: nyx_xxxxxxxxxxxxxxxxxxxx
timeout: 30000
clio:
baseUrl: https://clio.sun-asterisk.vn
apiKey: clio_xxxxxxxxxxxxxxxxxxxx
requestTimeout: 60000
uploadTimeout: 300000Develop
bun install
bun run dev nyx lookup vuln --help
bun run dev clio doctor
bun test # unit tests (mocked HTTP, fast)
bun run test:e2e # live API hits — requires NYX_API_KEY + CLIO_API_KEY in env or config
bun run build
node dist/bin/sdo.js --versionE2E test suite
tests/e2e/nyx-lookup.e2e.test.ts— Nyx, gated byNYX_E2E=1.tests/e2e/clio-query.e2e.test.ts— Clio query, gated byCLIO_E2E=1+CLIO_E2E_PROJECT_ID.tests/e2e/clio-upload.e2e.test.ts— Clio upload, deferred: gated byCLIO_UPLOAD_E2E=1+CLIO_E2E_PROJECT_ID. Refuses to run without an explicit sandbox project ID.
bun run test:e2e # NYX_E2E=1 CLIO_E2E=1 bun test tests/e2e
bun run test:clio-e2e # clio query only
bun run test:all # unit + e2eRun 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).
