contexthub-cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/ch ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env bash
2
+ # ContextHub CLI wrapper — resolves symlinks to find the venv Python
3
+ set -euo pipefail
4
+
5
+ # Resolve symlinks to find the real package directory.
6
+ # npm global install creates: <prefix>/bin/ch -> <prefix>/lib/node_modules/contexthub-cli/bin/ch
7
+ SOURCE="${BASH_SOURCE[0]}"
8
+ while [ -L "$SOURCE" ]; do
9
+ DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
10
+ SOURCE="$(readlink "$SOURCE")"
11
+ # If readlink is relative, resolve it relative to the symlink's dir
12
+ [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE"
13
+ done
14
+ PACKAGE_DIR="$(cd -P "$(dirname "$SOURCE")/.." && pwd)"
15
+
16
+ VENV_PYTHON="$PACKAGE_DIR/.venv/bin/python3"
17
+
18
+ if [ ! -f "$VENV_PYTHON" ]; then
19
+ echo "error: ContextHub venv not found at $PACKAGE_DIR/.venv" >&2
20
+ echo "Try reinstalling: npm install -g contexthub-cli" >&2
21
+ exit 1
22
+ fi
23
+
24
+ export PYTHONPATH="$PACKAGE_DIR${PYTHONPATH:+:$PYTHONPATH}"
25
+ exec "$VENV_PYTHON" -c "from contexthub.cli import cli; cli()" "$@"
@@ -0,0 +1,3 @@
1
+ """ContextHub — intent-first version control layer on top of git."""
2
+
3
+ __version__ = "0.1.0"