Skip to content

Commit

Permalink
fix: added ncgptme and gptme-nc script entrypoints for ncurses tui
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Oct 20, 2024
1 parent 942996c commit 7b19b76
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions gptme/ncurses.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def _role_color(role: str) -> int:
)


def main(stdscr, use_color: bool):
def _main(stdscr, use_color: bool):
app = MessageApp(stdscr, use_color)
app.add_message("Welcome to the Message App!")
app.add_message(
Expand All @@ -262,11 +262,15 @@ def main(stdscr, use_color: bool):
app.run()


if __name__ == "__main__":
def main():
parser = argparse.ArgumentParser(
description="Message App with optional color support"
)
parser.add_argument("--no-color", action="store_true", help="Disable color output")
args = parser.parse_args()

curses.wrapper(lambda stdscr: main(stdscr, not args.no_color))
curses.wrapper(lambda stdscr: _main(stdscr, not args.no_color))


if __name__ == "__main__":
main()
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ include = ["gptme/server/static/**/*", "media/logo.png"]
gptme = "gptme.cli:main"
gptme-server = "gptme.server.cli:main"
gptme-eval = "gptme.eval.main:main"
gptme-nc = "gptme.ncurses:main"
ncgptme = "gptme.ncurses:main"

[tool.poetry.dependencies]
python = "^3.10"
Expand Down

0 comments on commit 7b19b76

Please sign in to comment.