@jishankai/solid-cli
v1.0.2
Published
MacOS System & Security Analysis Agent CLI with LLM-powered insights
Maintainers
Readme
macOS System & Security Analysis Agent CLI (solid-cli)
A local-first macOS security and performance analysis CLI. It runs a unified, adaptive set of analysis agents on your machine and can (optionally) use an LLM (Claude or OpenAI) to generate structured recommendations.
Note: LLM use is optional. When enabled, the CLI applies prompt sanitization and will abort AI analysis if sensitive patterns are detected.
快速开始(Quick Start)
# Run once (no install)
npx solid-cli
# Or install globally
npm install -g solid-cli
solid-cli
# Show help
solid-cli --helpOptional (enable AI analysis):
export ANTHROPIC_API_KEY=sk-ant-...
# or
export OPENAI_API_KEY=sk-...
solid-cliReports are written to ./reports/<YYYY>/<Month>/ by default.
Features
- Unified Adaptive Analysis: runs a core set of agents every time, then conditionally expands analysis (e.g. blockchain/DeFi) when indicators are detected.
- Core Security Coverage:
- System integrity checks (SIP, Gatekeeper, updates)
- Persistence mechanism detection (LaunchAgents/LaunchDaemons, Login Items, crontab)
- Process analysis for suspicious activity
- Network connection analysis (optionally enriched with IP geolocation)
- Privacy permission auditing
- Blockchain/DeFi Safety Add-on (adaptive): triggers wallet/DeFi threat checks only when crypto indicators are found.
- Privacy-protected AI insights (optional):
- Provider auto-detection (Claude preferred when both keys exist)
- Prompt sanitization + sensitive-pattern blocking
- Threshold-based skipping when findings are below configured triggers
- Professional Reports: Markdown and/or PDF (Puppeteer) with templates.
- Structured Logging: operational logs under
./logs/.
Architecture
┌─────────────┐
│ CLI UI │ inquirer + chalk
└─────┬───────┘
│
┌─────▼────────────────────┐
│ Orchestrator (Unified) │ Phase 1 core + Phase 2 adaptive
└─────┬────────────────────┘
│
┌────▼────┐ ┌───────────────▼───────────────┐
│ Core │ │ Adaptive Agents (conditional) │
│ Agents │ │ Blockchain / DeFi │
└────┬────┘ └───────────────┬───────────────┘
│ │
┌─────▼───────────┐ ┌─────▼───────────┐
│ LLM Analyzer │ │ Report Manager │
│ (optional) │ │ Markdown / PDF │
└──────────────────┘ └─────────────────┘Requirements
- macOS 10.15 or later
- Node.js 20.0 or later
- API Keys (optional): Anthropic Claude and/or OpenAI
Installation
Install from npm
npm install -g solid-cli
solid-cliRun once without installing:
npx solid-cliLocal development
npm install
npm startOptional: make the entry executable:
chmod +x src/index.jsUsage
Run the interactive CLI:
solid-cli
# or, in this repo
npm startShow help:
solid-cli --help
# or
npm start -- --helpWhat the CLI will ask (current flow)
- LLM auto-detection (no manual provider picker)
- If
ANTHROPIC_API_KEYis present, the CLI uses Claude. - Else if
OPENAI_API_KEYis present, it uses OpenAI. - Else it runs report-only.
- If
- AI analysis option: you can still choose AI analysis or report-only.
- Report format: PDF or Markdown.
- IP geolocation: controlled by config (
security.enableGeoLookup) and shown in the run summary. - Analysis starts automatically (no extra confirmation prompt).
Report output
- Default output root:
./reports(configurable viareports.outputDir). - Directory layout:
./reports/<YYYY>/<Month>/ - Filenames:
Security-Report-<REPORT_ID>.mdSecurity-Report-<REPORT_ID>.pdfmetadata-<YYYY-MM-DD>.json
Example run (illustrative)
$ solid-cli
✅ Claude (Anthropic) - API key detected
? 🤖 AI Analysis Option: (Use arrow keys)
🧠 Use AI Analysis (CLAUDE) - Enhanced insights & recommendations
📋 Generate Security Report Only - Maximum privacy protection
? Select report format: PDF (.pdf)
✅ IP geolocation enabled
🔍 Starting unified adaptive analysis...
Phase 1: Core Security Analysis
✓ ResourceAgent completed - Risk: LOW
✓ SystemAgent completed - Risk: MEDIUM
...
Phase 2: Adaptive Analysis
No blockchain indicators detected - skipping blockchain analysis
📁 Saved Reports:
📑 Pdf: reports/2025/December/Security-Report-RPT-XXXXXX.pdfAgents
Core agents (always run)
ResourceAgent: CPU/memory/process resource usage heuristics.SystemAgent: SIP/Gatekeeper/updates and other system posture checks.PersistenceAgent: LaunchAgents/LaunchDaemons/Login Items/crontab.ProcessAgent: suspicious process patterns (paths, elevation, obfuscation).NetworkAgent: network connections and listening ports; optional IP geolocation enrichment.PermissionAgent: privacy permission auditing.
Adaptive agents (only run when indicators are detected)
BlockchainAgent: wallet processes/files, wallet-like browser extensions, mining indicators, and blockchain/DeFi network patterns.DeFiSecurityAgent: DeFi scam indicators (processes/download metadata/network) with privacy-protective behavior (no clipboard or browser-history content extraction).
Configuration
This project uses the config (node-config) package.
- Defaults ship in
config/default.json. - You can override settings by providing your own config directory in one of these ways:
- Create
./config/local.jsonin the directory where you runsolid-cli. - Or set
NODE_CONFIG_DIRto a custom config folder.
- Create
Common settings:
reports.outputDir: report output directory (default./reports).analysis.parallelExecutionandanalysis.maxParallelAgents: speed vs. load tradeoff.security.enableGeoLookupandsecurity.geoLookupLimit: IP geolocation enrichment behavior.llm.mode: prompt mode (summary/full).llm.minHighRiskFindings,llm.minTotalFindings,llm.skipWhenBelowThreshold: when AI analysis should run.
AI / LLM behavior (privacy-protected)
- Provider auto-detection priority: Claude → OpenAI → none.
- Before any LLM call, the CLI:
- builds a prompt from analysis results,
- runs a sensitive pattern scan,
- and skips AI analysis (and records details into report metadata) if sensitive patterns are detected.
- When AI analysis runs, request/response payloads are logged under
./logs/llm-requests/.
Security Considerations
- No Root Required: checks run with user permissions.
- Local-First: analysis runs locally; AI is optional.
- Read-only: the tool does not modify system settings.
- LLM Safety: sensitive pattern detection can prevent accidental leakage of keys/tokens.
Troubleshooting
Permission prompts / incomplete results
Some checks may be limited without:
- Full Disk Access (e.g. some system databases)
- Accessibility (some process visibility)
PDF generation fails
PDF uses Puppeteer. If Chromium cannot launch:
- reinstall dependencies so Puppeteer can fetch Chromium, or
- set
PUPPETEER_EXECUTABLE_PATHto a local Chrome/Chromium.
Development
Project Structure
solid-cli/
├── config/
│ └── default.json # node-config defaults
├── src/
│ ├── agents/ # analysis agents
│ ├── config/ConfigManager.js # config access/validation
│ ├── llm/LLMAnalyzer.js # LLM prompt building + safety checks
│ ├── logging/Logger.js # structured logging
│ ├── report/ # report generation (Handlebars + Puppeteer)
│ ├── utils/ # shell helpers, signatures, etc.
│ ├── Orchestrator.js # unified adaptive runner
│ └── index.js # CLI entry point
├── reports/ # generated reports (gitignored typically)
├── logs/ # generated logs (gitignored typically)
└── README.mdAdding custom agents
- Create a new agent extending
BaseAgentand implementanalyze(). - Register it in
src/Orchestrator.js(core or conditional).
Publishing to npm (maintainers)
- Update
package.jsonmetadata (name/scope, version, repository, bugs, homepage). - Clean artifacts: remove generated
logs/andreports/before packing. - Verify package contents:
npm pack --dry-run. - Smoke tests (non-interactive helpers):
node src/index.js --helpnode test-llm-choice.jsnode test-llm-blocking.jsnode test-llm-privacy.jsnode test-blockchain.js
- Publish:
npm publish --access public.
License
MIT License - see LICENSE.
Disclaimer
This tool is for legitimate security analysis and system auditing only. Users are responsible for compliance with applicable laws and regulations. The authors assume no liability for misuse.
