Skip to main content

A note-taking tool integrated with GitHub issues

Project description

Notehub

Using Github issues as general notes.

Requirements

User Setup

1. Install GitHub CLI

Install the GitHub CLI (gh) if you haven't already:

Windows: Download the MSI installer from https://cli.github.com/ (avoid MS Store version - use the official installer)

macOS:

brew install gh

Linux: See https://github.com/cli/cli/blob/trunk/docs/install_linux.md

2. Authenticate with GitHub CLI

For public GitHub:

gh auth login

Follow the prompts to authenticate.

For GitHub Enterprise:

gh auth login --hostname <your-enterprise-github-hostname>

Note: Notehub uses gh for all GitHub API authentication. Make sure this step completes successfully.

3. Install Notehub

pip install lm-notehub

4. Create Your Notehub Repository

Create a GitHub repository to store your notes as issues. The recommended name is notehub.default:

For public GitHub:

  • Go to https://github.com/new
  • Create a repository named notehub.default
  • Make it private (recommended for personal notes)

For GitHub Enterprise:

5. Configure Notehub Settings

Set your default configuration using git config:

For public GitHub (using default repo name):

git config --global notehub.host github.com
git config --global notehub.org <your-github-username>
git config --global notehub.repo notehub.default

For GitHub Enterprise:

git config --global notehub.host <your-enterprise-github-hostname>
git config --global notehub.org <your-org-or-username>
git config --global notehub.repo notehub.default

Example for enterprise:

git config --global notehub.host github.enterprise.com
git config --global notehub.org jsmith
git config --global notehub.repo notehub.default

Configure editor (Windows):

By default, notehub uses vi for editing. To use VS Code instead:

[System.Environment]::SetEnvironmentVariable('EDITOR', 'code --wait', 'User')

Restart your terminal after setting this. The --wait flag ensures VS Code blocks until you close the editor tab.

This configures the editor for both notehub add and notehub edit commands.

Optional: Token environment variables

While gh auth login handles authentication, you can also set token environment variables for additional flexibility:

  • GH_ENTERPRISE_TOKEN_2 - Preferred for enterprise
  • GH_ENTERPRISE_TOKEN - Alternative for enterprise
  • GITHUB_TOKEN - For public GitHub

These are checked in order and used to populate the environment when calling gh.

6. Verify Setup

Test that notehub can access your repository:

notehub status

You should see your configured host/org/repo. You're ready to start using notehub!

Development Setup

1. Install Python (Windows)

  • Install the python.org edition of Python3.x, stay away from MS Store
  • Installer should add to the PATH:
C:\Users\<username>\AppData\Local\Programs\Python\Python313\Scripts
C:\Users\<username>\AppData\Local\Programs\Python\Python313
C:\Users\<username>\AppData\Local\Programs\Python\Launcher

2. Install in Development Mode

Install notehub with development dependencies:

python -m pip install -e .[dev]

This installs:

  • pytest - Testing framework
  • pytest-cov - Code coverage
  • pytest-mock - Mocking utilities
  • pre-commit - Git hooks framework

Note: Don't use --user flag. On Windows, --user puts packages in AppData\Roaming instead of AppData\Local, but since you own the latter there's no reason to use --user.

3. Set Up Pre-commit Hooks

Install the git hooks:

pre-commit install

This will automatically run on every commit:

  • Trailing whitespace removal
  • End-of-file fixes
  • YAML validation
  • Large file checks
  • Merge conflict detection
  • Unit tests with 20% minimum coverage

4. Configure GitHub Token

For public GitHub: Set GITHUB_TOKEN environment variable with a personal access token.

Within the corp wall: Set GH_ENTERPRISE_TOKEN_2 environment variable (add to Windows environment variables).

5. Running Tests

Run all tests:

pytest

Run only unit tests:

pytest tests/unit/

Run with coverage report:

pytest --cov=src/notehub --cov-report=term-missing

6. Publishing to PyPI (Maintainers Only)

To publish a new version to PyPI, you need a PyPI API token. Set it as an environment variable:

Windows (PowerShell):

[System.Environment]::SetEnvironmentVariable('LM_NOTEHUB_PYPI_TOKEN', 'your_pypi_token_here', 'User')

Restart your terminal, then run the publish script:

bash build-and-publish.sh

This will build the distribution and upload it to PyPI.

Usage

After installation, the notehub command will be available:

notehub --help

Virtual Environments (Optional)

Many developers recommend using virtual environments (venv, conda, etc.) to isolate project dependencies. While this is a best practice for production and complex projects with conflicting dependencies, it adds complexity and can be skipped for simpler projects or solo development. If you want to use one:

python -m venv .venv
.venv\Scripts\activate  # Windows
source .venv/bin/activate  # Unix/macOS

Then proceed with the installation steps above.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lm_notehub-0.2.0.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lm_notehub-0.2.0-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file lm_notehub-0.2.0.tar.gz.

File metadata

  • Download URL: lm_notehub-0.2.0.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for lm_notehub-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0acd133a2df67fe75b2aa8a8261cf40bb997ccc2d1dbda208ddb6682cc637254
MD5 0a2e1b80c1378ab1ddb1b5166c225856
BLAKE2b-256 429b752e18ba6a1e3f91d913cdfa2773d384b90155ece5acedae9902d5103795

See more details on using hashes here.

File details

Details for the file lm_notehub-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: lm_notehub-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for lm_notehub-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10af97679d6742aa5120c13010dbef07aa88d7317c155bbe903633236414447d
MD5 5eb18e7a1f975cb8f013cff858e31fe5
BLAKE2b-256 f51d3e11ffcc18843d34c55d86b2180d103ad8b37f88d3073bebb4a179dc4808

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page