Skip to main content

Install Runegraft

Runegraft ships as a normal Python package. Pick the install path that fits your workflow.
pip install runegraft
Run python -m runegraft with no args to drop into the interactive shell immediately.

Build a CLI in 60 seconds

Drop this into cli.py (or any module you prefer) to see the basics:
from runegraft import CLI, opt

cli = CLI("runegraft")

@cli.root
def _root():
    # Running with no args opens the shell.
    return cli.shell()

@cli.command("install <url:url>")
def install(
    url: str,
    optional_flag: int = opt("--optional-flag", "-f", default=0, help="Example integer option"),
):
    print(f"Installing from {url} (optional_flag={optional_flag})")

@cli.command("echo <text:str>")
def echo(text: str, upper: bool = opt("--upper", "-u", default=False, help="Uppercase the text")):
    print(text.upper() if upper else text)

def main():
    raise SystemExit(cli.run())

if __name__ == "__main__":
    main()
Run it however you like:
python -m runegraft

What you just got

  • Flask-like command routes: install <url:url> and typed args.
  • A polished shell: completion, history, aliases, source scripts, and system command passthrough.
  • Friendly errors and help text generated from your function signatures.

Next steps