Skip to content

Add CLI command 'bibra run' for server mode - #107

Open
juhoinkinen wants to merge 1 commit into
mainfrom
issue103-CLI-command-to-run-server-mode
Open

Add CLI command 'bibra run' for server mode#107
juhoinkinen wants to merge 1 commit into
mainfrom
issue103-CLI-command-to-run-server-mode

Conversation

@juhoinkinen

Copy link
Copy Markdown
Member

Reasons for creating this PR

A dedicated command to serve the API and web UI is handy.

Link to relevant issue(s), if any

Description of the changes in this PR

  • Adds the command to cli.py, usage is uv run bibra run or just bibra run when in venv.
  • Add unit tests for the new command.
  • Updates README instruction to start BIBRA API server by running the new command instead of uv run uvicorn bibra.main:app.

Instructions how to test this PR

Run uv run bibra run with various flags.

Known problems or uncertainties in this PR

What should the name of the command be?

Now the usage is bibra run, but would bibra serve be better? Especially uv run bibra run is a bit awkward.

Checklist

  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

Disclosure of AI Tool Usage

Please indicate AI use by choosing the most suitable TLP:AI category below and removing the irrelevant categories from the list. AI:ORANGE is the minimum level for merging.

  • 🟡 AI:AMBER AI-generated, fully reviewed line by line. Author can explain every part.

Describe the AI tool(s) you used:

Zoo Code with Qwen3.8-27B

@juhoinkinen juhoinkinen added this to the 0.2 milestone Aug 25, 2026
@juhoinkinen juhoinkinen added enhancement New feature or request UI labels Aug 25, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.52%. Comparing base (2a14380) to head (3d475f4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #107      +/-   ##
==========================================
+ Coverage   98.50%   98.52%   +0.01%     
==========================================
  Files          13       13              
  Lines         536      543       +7     
==========================================
+ Hits          528      535       +7     
  Misses          8        8              
Flag Coverage Δ
unittests 98.52% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a first-class CLI entry point for running BIBRA in “server mode” (API + Web UI), replacing the previously documented direct uvicorn invocation and aligning with the request in issue #103.

Changes:

  • Add a new bibra run Click subcommand that starts uvicorn with configurable host/port and optional --reload.
  • Add unit tests verifying the new command’s help output and that it forwards options to uvicorn.run.
  • Update README usage instructions to start the server via uv run bibra run.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
bibra/cli.py Introduces the run CLI subcommand that starts bibra.main:app via uvicorn.run.
tests/test_cli.py Adds coverage for the new run command and updates CLI help assertions.
README.md Updates server startup instructions to use bibra run (with --reload guidance).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI command to run server mode

3 participants