No project description provided
Project description
PortHub
PortHub is a local-first CLI tool for storing and retrieving Markdown context by hierarchical keys.
MVP Scope
- Local filesystem storage only (default:
~/.porthub; configurable viaPORTHUB_HOMEor--root). - CLI-only workflows.
- Four commands:
set,get,search,list. - Exact match for
get. - Case-insensitive substring match for
search(with optional key-only/content-only modes).
Install
Install the CLI tool:
uv tool install -U porthub
Or run directly without installation:
uvx porthub --help
For local development in this repository:
uv sync
You can run commands either through uv:
uv run porthub --help
Or through the installed script:
porthub --help
Usage
Set Markdown content from an inline string:
porthub set python/typer "# Typer\nCLI framework for Python"
Set Markdown content from a file:
porthub set python/typer --file ./notes/typer.md
Set Markdown content from stdin:
cat ./notes/typer.md | porthub set python/typer --stdin
Get content by exact key:
porthub get python/typer
Search by key or content (case-insensitive):
porthub search typer
Search by key only:
porthub search typer --key-only
Search by content only:
porthub search typer --content-only
Limit search results:
porthub search typer --limit 10
List all keys:
porthub list
Use a custom storage root for any command:
porthub --help
porthub list --root ./tmp-porthub
porthub get python/typer --root ./tmp-porthub
Or set a default storage root via environment variable:
export PORTHUB_HOME=./tmp-porthub
porthub list
Skills
This repository includes a local skill for package-documentation retrieval workflows:
- Install (method 1):
npx skills add narumiruna/porthub
- Install (method 2):
npx ctx7 skills install narumiruna/porthub
- Skill source:
skills/porthub/SKILL.md
Key Rules
A key is valid only when all rules pass:
- It is not empty after trimming spaces.
- It does not start or end with
/. - It does not contain
//. - It does not contain
... - It does not end with
.md.
Error Behavior
- Validation failures return non-zero exit code.
getreturns non-zero when a key is not found.searchreturns empty output with exit code0when no match exists.searchreturns non-zero when--key-onlyand--content-onlyare both provided.searchreturns non-zero when--limitis not greater than0.setreturns non-zero unless exactly one content source is provided:- positional
value --file--stdin
- positional
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
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 porthub-0.0.4.tar.gz.
File metadata
- Download URL: porthub-0.0.4.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae62d72e468caecfed7fb0ca8e39efd84f4bbf50997e5f7cb7fe09c3dc651bfb
|
|
| MD5 |
31b85e18ec0dfb7290c1abd046322a62
|
|
| BLAKE2b-256 |
3edc94d4a8d2ddd3104c2f1c5ff6051cf91b525e51a0e273852c50308154fd85
|
File details
Details for the file porthub-0.0.4-py3-none-any.whl.
File metadata
- Download URL: porthub-0.0.4-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36b1d6432e5f8d2fe439966a9f42ca68d16c174667c2b7b8a205e6aea49464f3
|
|
| MD5 |
406829a6460b344a66949e61f66af95f
|
|
| BLAKE2b-256 |
c3a15b6339cb7878ea60aa650781e07a420f187fbc485cf8d640acbf94a779b7
|