Skip to content
This repository was archived by the owner on Jul 3, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,24 @@ Installation Guide for gitx
> [!NOTE]
> For further information about poetry and managing environments refer to the [poetry docs](https://python-poetry.org/docs/managing-environments/).

5. To install and run the `gitx` package, run the following commands:

```sh
# Install the package in development mode
poetry install

# Run the app using the entry point
poetry run gitxtui # or simply `gitxtui` if already in poetry environment
```

6. To build the package, run:

```sh
poetry build

# This will create dist/gitxtui-<version>.tar.gz and dist/gitxtui-<version>-none-any.whl
```

## Running Tests

Run the test suite using pytest:
Expand Down
15 changes: 12 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ theme:
# Dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: indigo
accent: indigo
primary: black
accent: black
toggle:
icon: material/brightness-4
icon: material/brightness-5
name: Switch to light mode
features:
- navigation.instant
Expand All @@ -32,10 +32,19 @@ theme:
- navigation.footer
- content.code.copy
- toc.follow
- navigation.tabs
# - navigation.tabs.sticky
- navigation.sections
- navigation.path
- toc.integrate
# - navigation.expand

extra_css:
- stylesheets/extra.css

extra_javascript:
- javascripts/textual-theme.js

markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
Expand Down
10 changes: 5 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 44 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,51 @@ authors = [
license = { text = "LICENSE" }
readme = "README.md"
requires-python = ">=3.9, <4.0"
dependencies = ["textual (>=2.1.2,<3.0.0)"]
dependencies = ["textual>=2.1.2,<3.0.0"]
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Version Control :: Git",
]

[project.scripts]
gitxtui = "gitx.main:main"

[project.urls]
Homepage = "https://github.com/gitxtui/gitx"
Documentation = "https://gitxtui.github.io/gitx/"
Issues = "https://github.com/gitxtui/gitx/issues"

[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "gitxtui"
version = "0.1.0-a1"
description = "TUI based git helper"
authors = [
"Ayush <mail@ayuch.dev>",
"Ashmit Singh <ashmit9955@gmail.com>",
"Anmol Puri <anmolpuri954@gmail.com>",
"Anmol Kakkar <anmolarora0014@gmail.com>",
]
readme = "README.md"
packages = [{ include = "gitx", from = "src" }]

[tool.poetry.scripts]
gitxtui = "gitx.main:main"

# [tool.poetry]
# package-mode = false
[tool.poetry.dependencies]
python = ">=3.9,<4.0"
textual = ">=2.1.2,<3.0.0"

[tool.poetry.group.dev.dependencies]
pytest = "^8.3.5"
Expand All @@ -27,7 +68,3 @@ mkdocs-material = "^9.6.9"
materialx = "^1.39.3"
pymdown-extensions = "^10.14.3"
material = "^0.1"

[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
5 changes: 5 additions & 0 deletions src/gitx/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
gitx - A TUI Git helper built with Textual
"""

__version__ = "0.1.0-a1"
42 changes: 42 additions & 0 deletions src/gitx/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from textual.app import App, ComposeResult
from textual.binding import Binding
from textual.containers import Container
from textual.widgets import Header, Footer, Static


class GitxApp(App):
"""A TUI Git client built with Textual."""

CSS_PATH = "css/app.tcss"

BINDINGS = [
Binding(key="q", action="quit", description="Quit"),
Binding(key="t", action="toggle_dark", description="Toggle dark mode"),
]

def compose(self) -> ComposeResult:
"""Compose the app layout using the welcome screen."""
self.theme = "flexoki" # Default theme
yield Header(show_clock=True)
yield Container(
Static("Welcome to gitx!", classes="welcome-title"),
Static("A Terminal User Interface for Git", classes="welcome-text"),
Static("Press 't' to toggle theme or 'q' to quit", classes="welcome-text"),
classes="welcome"
)
yield Footer()

def action_toggle_dark(self) -> None:
"""Toggle between light and dark theme."""
self.theme = (
"flexoki" if self.theme == "catppuccin-latte" else "catppuccin-latte"
)

def main() -> None:
"""Run the app."""
app = GitxApp()
app.run()


if __name__ == "__main__":
main()
39 changes: 39 additions & 0 deletions src/gitx/css/app.tcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* Base application styles */
Screen {
background: $surface;
color: $text;
layout: vertical;
}

Header {
dock: top;
height: 1;
}

Footer {
dock: bottom;
height: 1;
}

/* Common styles that apply to the whole app */
.welcome {
width: 100%;
height: 100%;
align: center middle;
background: $surface;
}

.welcome-title {
text-style: bold;
text-align: center;
margin-bottom: 1;
color: $accent;
width: 100%;
height: 1;
}

.welcome-text {
text-align: center;
margin-bottom: 1;
width: 100%;
}
Empty file added src/gitx/css/welcome.tcss
Empty file.
6 changes: 6 additions & 0 deletions src/gitx/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env python3

from gitx.app import main

if __name__ == "__main__":
main()
25 changes: 25 additions & 0 deletions src/gitx/screens/welcome.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Welcome screen for gitx."""

from textual.app import ComposeResult
from textual.containers import Container
from textual.screen import Screen
from textual.widgets import Header, Footer, Static


class WelcomeScreen(Screen):
"""Welcome screen displayed when the application starts."""

def compose(self) -> ComposeResult:
"""Compose the welcome screen layout."""
yield Header(show_clock=True)
yield Container(classes="welcome")
yield Footer()

def on_mount(self) -> None:
"""Called when the screen is mounted."""
welcome_container = self.query_one(".welcome", Container)
welcome_container.mount(
Static("gitx", classes="welcome-title"),
Static("A Terminal User Interface for Git", classes="welcome-text"),
Static("Press 't' to toggle theme or 'q' to quit", classes="welcome-text"),
)