Skip to main content

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 via PORTHUB_HOME or --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:

  1. It is not empty after trimming spaces.
  2. It does not start or end with /.
  3. It does not contain //.
  4. It does not contain ...
  5. It does not end with .md.

Error Behavior

  • Validation failures return non-zero exit code.
  • get returns non-zero when a key is not found.
  • search returns empty output with exit code 0 when no match exists.
  • search returns non-zero when --key-only and --content-only are both provided.
  • search returns non-zero when --limit is not greater than 0.
  • set returns non-zero unless exactly one content source is provided:
    • positional value
    • --file
    • --stdin

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

porthub-0.0.4.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

porthub-0.0.4-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

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

Hashes for porthub-0.0.4.tar.gz
Algorithm Hash digest
SHA256 ae62d72e468caecfed7fb0ca8e39efd84f4bbf50997e5f7cb7fe09c3dc651bfb
MD5 31b85e18ec0dfb7290c1abd046322a62
BLAKE2b-256 3edc94d4a8d2ddd3104c2f1c5ff6051cf91b525e51a0e273852c50308154fd85

See more details on using hashes here.

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

Hashes for porthub-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 36b1d6432e5f8d2fe439966a9f42ca68d16c174667c2b7b8a205e6aea49464f3
MD5 406829a6460b344a66949e61f66af95f
BLAKE2b-256 c3a15b6339cb7878ea60aa650781e07a420f187fbc485cf8d640acbf94a779b7

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