Skip to content

align CLI/UI payloads, export APIs, and fix beginner run docs#12

Merged
rad1092 merged 1 commit into
mainfrom
codex/provide-step-by-step-execution-guide
Feb 13, 2026
Merged

align CLI/UI payloads, export APIs, and fix beginner run docs#12
rad1092 merged 1 commit into
mainfrom
codex/provide-step-by-step-execution-guide

Conversation

@rad1092
Copy link
Copy Markdown
Owner

@rad1092 rad1092 commented Feb 13, 2026

Motivation

  • Make the CLI match the beginner docs and provide a consistent bitnet-analyze UX with analyze and ui subcommands so newcomers can follow end-to-end instructions.
  • Reuse prompt/payload generation between the CLI and the web UI so inline CSV from the UI is supported without duplicating logic.
  • Export the actual public analysis helpers to avoid import-time issues and make functions available to tests and consumers.
  • Clarify beginner docs to remove an unsupported --timeout example and provide a minimal, working run sequence.

Description

  • Add subcommands and parsing helpers by introducing _build_parser() and main(argv: ...) in bitnet_tools.cli, and route legacy bare-CSV invocations into the analyze subcommand.
  • Factor prompt construction into build_prompt(summary, question) and add build_analysis_payload_from_csv_text in bitnet_tools.analysis to support inline CSV analysis for the UI.
  • Update bitnet_tools.__init__ to export build_analysis_payload, build_analysis_payload_from_csv_text, build_prompt, and summarize_rows.
  • Wire the UI (bitnet_tools.web / ui/*) to call build_analysis_payload_from_csv_text and keep run_ollama error handling consistent.
  • Update documentation files (BEGINNER_README.md, README.md) to remove the unsupported --timeout example, add minimal project install steps, and align troubleshooting with current CLI/UI behavior.
  • Add/extend tests: new tests/test_cli.py and extended tests/test_analysis.py to cover legacy CLI invocation, UI serve routing (monkeypatched), and inline-CSV payload generation.

Testing

  • Ran PYTHONPATH=. pytest -q and all tests passed (5 passed).
  • Ran PYTHONPATH=. python -m bitnet_tools.cli --help which printed the CLI help for analyze and ui and exited successfully.
  • CLI unit tests exercise the legacy-mode analyze routing and the ui serve hook (the serve call is monkeypatched in tests), and they passed as part of the test run.

Codex Task

@rad1092 rad1092 merged commit 4e6eec3 into main Feb 13, 2026
0 of 4 checks passed
@rad1092 rad1092 deleted the codex/provide-step-by-step-execution-guide branch February 13, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant