๐ง CLI Study Hub v5.0 โ Slash-Command Study Companion
CLI Study Hub is a terminal-first, community-driven study notebook. Every
command is a /slash-command with a live, Claude-Code-style autocomplete menu
โ start typing and matching commands pop up as you go. Notes live in this
GitHub repo, so anyone with push access gets automatic, hassle-free syncing.
A welcome banner, spinners during sync/network calls, and small emoji
celebrations for milestones (first subject, first post, streaks) make the
terminal experience feel alive โ all of it degrades to plain, instant output
when the CLI isn't attached to a real terminal (e.g. scripted/piped use), so
nothing here ever blocks automation.
๐ Install (no manual dependency wrangling)
The recommended way to run CLI Study Hub is with pipx
or uvx, which install the app
into its own isolated environment and pull in every dependency for you โ
there's nothing else to install by hand.
# one-time install, then just run `study-hub` any time
pipx install study-cli-hub
# or run it without installing anything permanently
uvx study-cli-hub
๐ฆ Not on PyPI yet? Until the maintainer publishes the first release (see Publishing a release below), install straight from this repo:
pipx install "git+https://github.com/govindmehta15/study-cli-hub.git"
Run it
Your notes are stored as files in this repo's subjects/ folder, so clone
the repo first, cd into it, then launch the app from there:
git clone https://github.com/govindmehta15/study-cli-hub.git
cd study-cli-hub
study-hub
โจ๏ธ Slash Commands & Autocomplete
Every command starts with /. As soon as you type /, a live menu of
matching commands (with a one-line description of each) appears and narrows
down as you keep typing โ just like Claude Code's slash menu. Press Tab /
Enter to accept a suggestion.
๐ Main menu
| Command | Action |
|---|---|
/study <name|number> |
Open a subject |
/create-subject |
Add a new subject with a description |
/list |
Refresh the subjects list |
/switch-user |
Switch user folder or global mode |
/explore |
Explore other users' study content (read-only) |
/search <term> |
Full-text search your and others' notes |
/stats |
Show your subjects/notes/streak dashboard |
/leaderboard |
Rank all known users by streak/activity |
/digest |
See what's new since your last visit |
/feed |
Browse the global knowledge feed |
/chat <username> |
Open an async chat with another user |
/login |
Connect your GitHub account |
/logout |
Disconnect your GitHub account |
/whoami |
Show the connected GitHub account |
/sync |
Pull + push notes with GitHub right now |
/help |
Show this command list |
/exit |
Exit (auto-syncs with GitHub) |
๐ Inside a subject
| Command | Action |
|---|---|
/read <note|number> |
Open a note in the interactive reader |
/edit <note|number> |
Edit a note with reason tracking + backup |
/new-note |
Create a new note file |
/upload |
Upload a file via the interactive file browser |
/repair <path> |
Diagnose a Word document's issues |
/help |
Show this command list |
/back |
Return to the subjects menu |
๐ Inside the interactive reader / document viewers
โ/โork/jโ scroll line by linePgUp/PgDnoru/dโ jump multiple linesSPACE/hโ highlight/unhighlight the current line/โ search within the filen/pโ next/previous search resulttโ toggle paragraphs/tables (DOCX only)qโ quit back to the subject menu
๐ Community: explore, feed, comments, and chat
These features solve a different problem than the git-synced subjects/
notes: no collaborator permissions, and no merge conflicts. Instead of
writing shared files, they read/write GitHub Discussions
on this repo. Any GitHub account can post or comment on a public repo's
Discussions without being added as a collaborator, and there's no file to
merge โ GitHub's API is the single source of truth, so two people posting at
the same time can never conflict.
/exploreโ browse other users'subjects/folders read-only (no GitHub login needed; it just reads the files already synced into this repo)./search <term>โ full-text search across your own notes, every "global" subject, and (read-only) everyone else's notes โ no login needed, it's pure local file search./feedโ a global text feed./postto share something,/comment <number> <text>to reply to someone else's post,/react <number> <emoji>to react with ๐โค๏ธ๐๐๐๐๐ (e.g./react 2 heart, or/react 2.1 laughto react to comment 1 on post 2). Requires/login./chat <username>โ an async 1:1 thread with another GitHub user, one canonical thread per pair regardless of who starts it. It's not real-time โ run/chat <username>or/refreshagain later to pick up replies, same as checking a GitHub Discussion for new comments./react <number> <emoji>works on messages too. Requires/login./digestโ "what's new since your last visit": new feed posts/comments and new chat messages. Compares against a timestamp stored locally on your own machine (~/.config/study-cli-hub/state.json) โ deliberately not synced to the repo, since your read-receipts aren't anyone else's business and syncing them would just create pointless git noise. Requires/login.
These need GitHub Discussions enabled on this repo (Settings โ General โ Features โ Discussions). The CLI looks for categories named "Feed" and "Chat"; if they don't exist yet it falls back to whatever category is available (e.g. "General"), so there's nothing else to configure to get started โ creating those two categories is optional polish for keeping the Discussions tab organized.
๐ Stats, streaks & the leaderboard
/stats shows your subject/note counts and your daily activity streak โ
computed entirely from git log on your own subjects/<username>/ folder,
not from a separate tracking file. That means it can't drift from reality,
gives you retroactive credit for history already in the repo, and needs
zero GitHub API calls for /leaderboard to rank every known user by the
same numbers.
Two honest limitations:
/statsand/leaderboardneed a personal user folder (/switch-userto one) โ Global mode has no identity to attach a streak to.- The streak reflects commit dates in your local clone's history, so it
needs a normal (non-shallow)
git cloneโ exactly what this README's clone instructions already do. It's also not tamper-proof (nothing stops backdating a commit), which is fine for a casual gamification feature, not a strict requirement.
๐ Connect your GitHub account
Run /login once. It starts GitHub's Device Flow:
- The CLI shows a one-time code and a URL (
github.com/login/device). - Open the URL in any browser (phone or laptop) and enter the code.
- Approve access โ the CLI picks up the token automatically and stores it
locally at
~/.config/study-cli-hub/credentials.json(readable only by you).
From then on, /sync and the automatic pull-on-start/push-on-exit use your
GitHub login instead of relying on locally configured SSH keys or cached
credentials โ so any collaborator can clone the repo and start syncing
immediately after /login, with no extra git configuration.
Using the app is auto-approved for anyone โ changing the app's code is not. These are two different things and the CLI treats them differently:
- Using the app (creating subjects, notes, feed posts) only ever touches
files under
subjects/<your-username>/. If you're a collaborator,/syncpushes those changes straight tomain. If you're not a collaborator,/syncautomatically forks this repo under your own GitHub account, pushes your notes there, and opens a pull request back here โ no need to ask anyone for access first. A GitHub Action (.github/workflows/auto-merge-data-prs.yml) checks that the PR only touchessubjects/**and auto-approves + auto-merges it. You'll never see a pending-review screen just for adding your own notes. - Changing the app's code (anything under
study_cli_hub/,pyproject.toml, workflows, this README) always requires a real pull request reviewed by a maintainer โ enforced by branch protection onmainplus.github/CODEOWNERS. The auto-merge Action above only fires for PRs that are 100%subjects/**; anything touching code is left for manual review, full stop.
Hassle-free with many users pushing at once: if two people run /sync
around the same time, the second push gets rejected (git's normal
non-fast-forward check). The CLI handles this automatically โ it pulls with
--rebase and retries the push (up to 3 times) without you doing anything.
Because every user only ever writes inside their own subjects/<username>/
folder, this almost always resolves cleanly on its own. The one case it
can't: two people editing the exact same lines of the exact same file โ that
surfaces a clear "needs a human" message with the exact git commands to
resolve it, instead of silently discarding anyone's work.
Use /whoami to check who's connected and /logout to disconnect.
๐งโ๐ป Maintainer setup: enabling /login
/login needs a GitHub OAuth App with Device Flow enabled. This is a
one-time setup only the repo owner needs to do:
- Go to github.com/settings/developers โ OAuth Apps โ New OAuth App.
- Any homepage URL works (device flow doesn't use a callback URL). Save it.
- Open the app's settings and check "Enable Device Flow".
- Copy the Client ID (no client secret is needed for device flow).
- Set it wherever
study-hubruns:export STUDY_HUB_GITHUB_CLIENT_ID=Iv1.xxxxxxxxxxxxxxxx
Since a device-flow Client ID is a public identifier (not a secret), it's also safe to bake intostudy_cli_hub/github_auth.pydirectly if you'd rather ship it as a default so users don't need the env var at all.
Until this is configured, /login prints setup instructions instead of
failing silently.
๐ก๏ธ Maintainer setup: branch protection on main
This repo's main branch requires a pull request for every change, including
the maintainer's own โ enforced via GitHub branch protection with
.github/CODEOWNERS requiring review on code paths. Data-only PRs
(subjects/**) skip human review entirely via the auto-merge Action above;
everything else needs a real review.
One unavoidable GitHub limitation to know about: with a single collaborator on the repo, there's nobody else who can approve your own code PRs. GitHub's answer to this is the same for every solo-maintainer OSS project โ repo admins get a "merge without waiting for requirements" button on their own PRs (a deliberate bypass, not a silent one: you have to click it, and GitHub logs that it happened). The rule still does its job of blocking direct pushes and blocking everyone else's code changes from merging without review; add a second collaborator as a code owner if you want actual second-person review on your own changes too.
๐ฆ Publishing a release (maintainers)
This repo ships a .github/workflows/publish.yml that builds and uploads
the package to PyPI whenever you publish a GitHub Release, using
PyPI Trusted Publishing (no
API tokens to store as secrets):
- Create the project once on PyPI (
pip install build twine, thenpython -m build && twine upload dist/*for the very first upload โ or reserve the name via PyPI's UI). - On the PyPI project's Settings โ Publishing, add a trusted publisher
pointing at this GitHub repo, workflow file
publish.yml, and environmentpypi. - From then on, cutting a GitHub Release automatically publishes the new
version โ
pipx install study-cli-hubpicks it up immediately.
๐งฉ Project Layout
study-cli-hub/
โโโ pyproject.toml # Package metadata + `study-hub` console script
โโโ study_cli_hub/
โ โโโ cli.py # Slash-command REPL (main entry point)
โ โโโ completer.py # Live '/' autocomplete menu
โ โโโ github_auth.py # Device Flow login + token-authenticated git sync
โ โโโ community.py # Feed/comments/chat/reactions via GitHub Discussions (permission-less, conflict-free)
โ โโโ search.py # Full-text search across your and others' notes
โ โโโ stats.py # git-log-derived streak/leaderboard stats (zero API calls)
โ โโโ local_state.py # Personal, per-device "last seen" markers for /digest (not git-synced)
โ โโโ animations.py # Typewriter/spinner/celebration primitives (degrade to plain output non-interactively)
โ โโโ contribute.py # Fork + auto-PR fallback for non-collaborators (hassle-free app usage)
โ โโโ file_viewer.py # Scrollable viewers (text/PDF/DOCX/CSV) with highlighting
โ โโโ file_uploader.py # Interactive file browser + upload
โ โโโ doc_repair.py # Word document diagnostics
โ โโโ error_handler.py # Centralized error logging
โ โโโ paths.py # Subject/user folder path helpers
โโโ subjects/ # All study notes (synced to GitHub)
โ โโโ GlobalSubject/
โ โ โโโ description_GlobalSubject.txt
โ โ โโโ note1.txt
โ โโโ <username>/
โ โโโ <Subject>/
โโโ .github/workflows/publish.yml
๐ฅ Contribution Guide
Adding study notes โ no setup beyond /login:
git clone https://github.com/govindmehta15/study-cli-hub.git && cd study-cli-hubpipx install study-cli-hub(orpipx install -e .for a live-editable install), thenstudy-hub/loginonce, then add subjects/notes as usual./syncor/exitโ auto-commits, and auto-forks + opens a PR for you if you're not a collaborator. Either way, notes-only changes auto-merge with no wait.
Changing the app's code โ needs an actual review, so use the normal GitHub flow:
- Fork the repository.
- Clone your fork and run
pipx install -e .for a live-editable install. - Make your change, commit, push to your fork.
- Open a Pull Request โ a maintainer (per
.github/CODEOWNERS) will review it.
๐ For Non-CLI Users
Browse all study notes directly on GitHub under /subjects โ
each subject has a description file and notes in readable formats, viewable
on desktop or mobile without installing anything.
๐งฐ Requirements
- Python โฅ 3.9
- Git (for cloning & syncing)
- A terminal โ
pipx/uvxhandle every Python dependency automatically
โค๏ธ About the Project
CLI Study Hub is an open-source educational project for technical learners: structured, subject-wise notes, studied efficiently from the terminal, kept in sync on GitHub, and easy to contribute to.
๐ Built for learners, by learners โ one note at a time.
๐ง Author & Community
Created by: Govind Mehta ๐ India ๐ฎ๐ณ
โญ Star on GitHub and share with your study community!
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file study_cli_hub-5.0.0.tar.gz.
File metadata
- Download URL: study_cli_hub-5.0.0.tar.gz
- Upload date:
- Size: 45.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f6dc4e853c440db084db24f5f75ecdf91209900a2639f17f017a2ffc2bbe65f
|
|
| MD5 |
e3179ae78ac6dce311252725958e2ee0
|
|
| BLAKE2b-256 |
442aaef48fe683d7594d6db9a656c01d7c3d27f7486a61f24d26d70c3cdc1410
|
Provenance
The following attestation bundles were made for study_cli_hub-5.0.0.tar.gz:
Publisher:
publish.yml on govindmehta15/study-cli-hub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
study_cli_hub-5.0.0.tar.gz -
Subject digest:
2f6dc4e853c440db084db24f5f75ecdf91209900a2639f17f017a2ffc2bbe65f - Sigstore transparency entry: 2307837559
- Sigstore integration time:
-
Permalink:
govindmehta15/study-cli-hub@58bf0fc04c169c825f952b478c1acf0d24da5eeb -
Branch / Tag:
refs/tags/v5.0.0 - Owner: https://github.com/govindmehta15
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@58bf0fc04c169c825f952b478c1acf0d24da5eeb -
Trigger Event:
release
-
Statement type:
File details
Details for the file study_cli_hub-5.0.0-py3-none-any.whl.
File metadata
- Download URL: study_cli_hub-5.0.0-py3-none-any.whl
- Upload date:
- Size: 44.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fea896199f21c17c8251c8469c40e500e7ebd9f48ca5c22b9e835b6284ce3df
|
|
| MD5 |
146143386c398328108628d52dc42ec9
|
|
| BLAKE2b-256 |
86ae1e493e7644df9f8008ac6d1ba3ec1ccd5799244756e6480f18bd874b316e
|
Provenance
The following attestation bundles were made for study_cli_hub-5.0.0-py3-none-any.whl:
Publisher:
publish.yml on govindmehta15/study-cli-hub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
study_cli_hub-5.0.0-py3-none-any.whl -
Subject digest:
4fea896199f21c17c8251c8469c40e500e7ebd9f48ca5c22b9e835b6284ce3df - Sigstore transparency entry: 2307837743
- Sigstore integration time:
-
Permalink:
govindmehta15/study-cli-hub@58bf0fc04c169c825f952b478c1acf0d24da5eeb -
Branch / Tag:
refs/tags/v5.0.0 - Owner: https://github.com/govindmehta15
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@58bf0fc04c169c825f952b478c1acf0d24da5eeb -
Trigger Event:
release
-
Statement type: