How eliware/codescope works
CodeScope is a read-only CLI for repository reviews, focused suggestions, and token/cost estimates. Users choose a profile or submit an ad hoc prompt; the CLI routes the request, gathers bounded repository evidence, frames it as untrusted input, and runs a provider-backed review or dry run before writing output. The graph preserves documented combined reviews, profiles, and pricing capabilities. Some internal links are omitted or marked unverified because their implementation was not excerpted; README-described behavior is cited where applicable.
Main entry points: review-command.mjs Command handlers · profile-command.mjs Profile command · prompt-routing.mjs Profile routing · run-review-pipeline.mjs Review pipeline
Components 20
CLI workflow
- CLI entry and routing
src/cli/main.mjs - Command handlers
src/cli/review-command.mjs - Profile command
src/cli/profile-command.mjs - Prompt command
src/cli/prompt-command.mjs - Output writer
src/cli/default-writer.mjs
Evidence preparation
- File discovery
src/find/files.mjs - Evidence combination
src/combine/all.mjs - Verified file reads
src/combine/read-verified-file.mjs - Test specifications
src/combine/test-specs.mjs
Review and prompts
- Profile routing
src/profiles/prompt-routing.mjs - Review prompt sources
src/profiles/prompt-sources/review.mjs - Review guidance
src/prompts/policy/review-guidance.mjs - Structured review schema
src/prompts/review-tool.mjs - Review pipeline
src/review/run-review-pipeline.mjs - Evidence attachment
src/review/request/attach-repository-evidence.mjs - Review result
src/review/review-result.mjs
Usage estimates
- Usage pricing
src/pricing/calculator.mjs - Dry-run estimates
src/review/dry-run.mjs
Other components
- CLI user
- OpenAI service
Connections 19
- CLI user → CLI entry and routing: submits command
README.md - CLI entry and routing → Command handlers: dispatches
src/cli/main.mjs - Command handlers → Profile command: routes profiles
src/cli/review-command.mjs - Command handlers → Prompt command: routes prompts
src/cli/review-command.mjs - Profile command → Profile routing: selects prompt
src/cli/profile-command.mjs - Prompt command → Profile routing: selects prompt
- Profile routing → Review prompt sources: loads sources
src/profiles/prompt-routing.mjs - Review prompt sources → Structured review schema: builds schema
src/profiles/prompt-sources/review.mjs - CLI user → File discovery: supplies repository
README.md - File discovery → Evidence combination: provides evidence
- Evidence combination → Test specifications: includes test context
- Review pipeline → Evidence attachment: attaches evidence
- Evidence attachment → Review guidance: frames evidence
src/review/request/attach-repository-evidence.mjs - Review pipeline → OpenAI service: executes request
- OpenAI service → Review result: returns response
- Review result → Output writer: writes result
- Profile command → Dry-run estimates: supports dry run
README.md - Dry-run estimates → Usage pricing: estimates cost
- CLI user → Usage pricing: requests estimate
README.md