Skip to content

Fix mypy error and pre-commit hook fixes#21

Open
pearsonkyle wants to merge 8 commits intomainfrom
feature/cli-tool-and-docs
Open

Fix mypy error and pre-commit hook fixes#21
pearsonkyle wants to merge 8 commits intomainfrom
feature/cli-tool-and-docs

Conversation

@pearsonkyle
Copy link
Owner

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a docbuddy command intended to launch DocBuddy’s standalone /docs webpage locally (to support local LLM usage), and updates documentation/UI copy to promote that workflow.

Changes:

  • Introduces a Python CLI entry point (docbuddy) that starts a local http.server and opens the standalone docs page.
  • Updates README and the standalone docs/index.html landing content with CLI-based “run locally” instructions.
  • Bumps package version to 0.6.0 and removes some repo automation/config files.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/docbuddy/cli.py New CLI entry point to serve the standalone docs page locally.
README.md Documents the new CLI-based standalone workflow.
pyproject.toml Bumps version and registers docbuddy = docbuddy.cli:main console script.
docs/index.html Adds “Run locally with CLI” instructions to the landing/install section.
.github/workflows/release.yml Removes the previous release workflow.
.clineignore Removes the ignore file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +36 to +51
# Use importlib.resources to find the docs directory
docbuddy_pkg = files("docbuddy")

# The docs directory is at the project root, one level up from src/docbuddy
# When installed, it's in site-packages/docbuddy/../..
docs_path = docbuddy_pkg.parent.parent / "docs"

if not docs_path.exists():
print(f"Error: Could not find 'docs' directory at {docs_path}", file=sys.stderr)
sys.exit(1)

# Serve from the project root (parent of docs) so static files are accessible
# The index.html uses paths like /src/docbuddy/static/core.js which need the parent
os.chdir(docs_path.parent)

url = f"http://{args.host}:{args.port}/docs/index.html"
Comment on lines +47 to +50
# Serve from the project root (parent of docs) so static files are accessible
# The index.html uses paths like /src/docbuddy/static/core.js which need the parent
os.chdir(docs_path.parent)

Comment on lines +13 to +16
def main():
"""Launch DocBuddy standalone webpage on port 8008."""
parser = argparse.ArgumentParser(
prog="docbuddy",
README.md Outdated
Comment on lines +58 to +68
### Option 1: Using the CLI (Recommended)

After installing DocBuddy, use the `docbuddy` command to launch the standalone webpage:

```bash
pip install docbuddy
docbuddy
```

This starts a local server on port **8008** and opens your browser to [http://localhost:8008/docs/index.html](http://localhost:8008/docs/index.html).

docs/index.html Outdated
<span class="copy-hint">Click to copy</span>
</div>
<p style="font-size: 12px; color: var(--theme-text-secondary); margin-top: 8px;">
Opens at <code>http://localhost:8008/docs/index.html</code>
@pearsonkyle
Copy link
Owner Author

@copilot apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Mar 13, 2026

@pearsonkyle I've opened a new pull request, #22, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 6 commits March 12, 2026 22:30
… add tests (#22)

* Initial plan

* Fix CLI: package standalone.html, use directory= instead of os.chdir, add tests, fix hardcoded URLs

Co-authored-by: pearsonkyle <4556546+pearsonkyle@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pearsonkyle <4556546+pearsonkyle@users.noreply.github.com>
@pearsonkyle
Copy link
Owner Author

@copilot review this branch and help me consolidate some of the code. After I pip install this, if I go to my home directory and then run the command docbuddy I'm getting a 404 on the webpage that opens up. It opens to something like http://localhost:9999/standalone.html and it isn't there.

Copy link
Contributor

Copilot AI commented Mar 13, 2026

@pearsonkyle I've opened a new pull request, #23, to work on those changes. Once the pull request is ready, I'll request review from you.

…_ for package directory resolution (#23)

* Initial plan

* Fix CLI: use pathlib.__file__ instead of importlib.resources.files() to resolve package directory

Co-authored-by: pearsonkyle <4556546+pearsonkyle@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pearsonkyle <4556546+pearsonkyle@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants