3d00a93655
- Introduced README.md for plugin overview and installation instructions. - Added hooks configuration in hooks.json for auto-save and pre-compact functionality. - Implemented stop and pre-compact hooks in bash scripts for memory management. - Created marketplace.json and plugin.json for plugin metadata and versioning. - Developed skills and instructions for help, init, mine, search, and status functionalities. - Added CLI commands for executing hooks and displaying skill instructions. - Implemented hooks_cli.py for handling hook logic and JSON input/output. - Enhanced instruction files for user guidance on setup and usage. - Updated .gitignore to exclude additional files. - Created GitHub Actions workflow for syncing plugin version on push.
29 lines
845 B
Python
29 lines
845 B
Python
"""
|
|
Instruction text output for MemPalace CLI commands.
|
|
|
|
Each instruction lives as a .md file in the instructions/ directory
|
|
inside the package. The CLI reads and prints the file content.
|
|
"""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
INSTRUCTIONS_DIR = Path(__file__).parent / "instructions"
|
|
|
|
AVAILABLE = ["init", "search", "mine", "help", "status"]
|
|
|
|
|
|
def run_instructions(name: str):
|
|
"""Read and print the instruction .md file for the given name."""
|
|
if name not in AVAILABLE:
|
|
print(f"Unknown instructions: {name}", file=sys.stderr)
|
|
print(f"Available: {', '.join(sorted(AVAILABLE))}", file=sys.stderr)
|
|
sys.exit(1)
|
|
|
|
md_path = INSTRUCTIONS_DIR / f"{name}.md"
|
|
if not md_path.is_file():
|
|
print(f"Instructions file not found: {md_path}", file=sys.stderr)
|
|
sys.exit(1)
|
|
|
|
print(md_path.read_text())
|