S1-6: CLI on a shared core (#11) #48
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
epic:E1-foundation
epic:E2-correct-metrics
epic:E3-fast-jobs
epic:E4-cli
epic:E5-web-ui
epic:E6-history
good first issue
help wanted
invalid
question
sprint-tracking
story
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ckreidl/screener!48
Loading…
Reference in a new issue
No description provided.
Delete branch "11-cli"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
🤖 Claude: Closes #11
The CLI (built with
@clack/prompts, which Chris asked for)bun cli.tsasks which steps to run. The multiselect has all four steps preselected, and each step's hint shows its current state: when the SEC data was last downloaded, how many companies are in the DB, how many companies enrich will price and about how long it will take, and when the CSV was last written. Ctrl-C exits with "Nothing run."bun cli.ts analyze rankruns the named steps without asking. Steps always run in pipeline order. An unknown step, or no steps without a terminal (e.g. in CI), prints usage and exits 1.--helpprints usage.Structure
src/(refresh,analyze,enrich,rank). It reports progress through a smallReporterinterface (src/report.ts) and returns a result, such as counts or the ranked list. Onlycli.tsprints anything. Tests passsilent.src/(git shows renames), and the analyze loop joinedanalyzeCompanyinsrc/analyze.ts.package.jsonscripts call the CLI;bun run exportis nowbun run rank.src/db.ts. The SEC request headers now live once insrc/sec.ts. Ranking is split into the purerankCompaniesandtoCsv.bun fmton the whole repo. The only content-free changes are in the oldrefresh-data.tsand.github/workflows/claude-code-review.yml(quote style).@clack/[email protected].No change to the data or the ranking is intended.
Definition of Done
refresh | analyze | enrich | rank, each a thin wrapper oversrc/package.jsonpoints to the CLIbun cli.ts analyze rankgives amagic_formula_ranked.csv(1,391 companies) that is byte-identical to the oldanalyze.ts+export-ranking.tsrun on the same data. The database was also identical after the first commit's run.bun checkandbun fmt --check .pass on the whole repobun testpasses; new logic has tests: 204 pass, 0 fail. New:test/rank.test.ts(rank order, ties, eligibility filter, CSV escaping, live-market-cap EY from a DB),test/db.test.ts(migrating an old table),test/cli.test.ts(help, unknown step, no terminal), and analyze-step tests over the fixtures (upsert keeps the enrichment columns; stale filings are skipped; an unreadable file is reported but doesn't stop the run)bun checkis clean andbun fmt --checkpasses: no type errors in 25 files; all 35 files are formatted🤖 Generated with Claude Code
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
Security
View full report