improvements to the home screen of the tui

This commit is contained in:
rajeevrajeshuni 2025-11-29 09:38:14 +05:30
parent 40b8f2b501
commit c57d1a9b82

View file

@ -1,11 +1,9 @@
import argparse import argparse
from typing import List
from cognee.cli import SupportsCliCommand from cognee.cli import SupportsCliCommand
from cognee.cli.config import DEFAULT_DOCS_URL from cognee.cli.config import DEFAULT_DOCS_URL
import cognee.cli.echo as fmt import cognee.cli.echo as fmt
from cognee.cli.exceptions import CliCommandException from cognee.cli.exceptions import CliCommandException
from cognee.version import get_cognee_version
class TuiCommand(SupportsCliCommand): class TuiCommand(SupportsCliCommand):
@property @property
@ -66,12 +64,20 @@ class TuiCommand(SupportsCliCommand):
background: $surface; background: $surface;
padding: 1; padding: 1;
} }
#title-wrapper {
width: 100%;
height: auto;
align: center middle;
}
#title { #title {
text-align: center; text-align: center;
width: auto;
color: $accent; color: $accent;
text-style: bold; text-style: bold;
padding: 1; padding: 0 3;
border: solid $accent;
margin-bottom: 2;
} }
ListView { ListView {
@ -118,10 +124,12 @@ class TuiCommand(SupportsCliCommand):
] ]
def compose(self) -> ComposeResult: def compose(self) -> ComposeResult:
yield Static("🧠 cognee v1.0.0", id="header") version = get_cognee_version()
yield Static(f"🧠 cognee v{version}", id="header")
with Container(id="main-container"): with Container(id="main-container"):
yield Static("Select Command", id="title") with Container(id="title-wrapper"):
yield Static("Select Command", id="title")
yield ListView( yield ListView(
ListItem(CommandItem("📥", "add", "Add data to cognee")), ListItem(CommandItem("📥", "add", "Add data to cognee")),
ListItem(CommandItem("🔍", "search", "Search data in cognee")), ListItem(CommandItem("🔍", "search", "Search data in cognee")),