Gira โ CLI-First Project Structure¶
A modern, CLI-first rewrite of Gira with a focus on agentic AI integration, Git-backed storage, and clean architecture. This project avoids early TUI/GUI complexity and emphasizes modular design, testability, and automation support.
๐ Suggested Project Structure¶
gira/
โโโ cli/ # Typer command groups (ticket, epic, sprint, etc.)
โ โโโ ticket.py
โ โโโ epic.py
โ โโโ __init__.py
โโโ core/ # File system + data manipulation logic
โ โโโ ticket_manager.py
โ โโโ epic_manager.py
โ โโโ jira_mapper.py
โ โโโ config.py
โโโ models/ # Pydantic models for tickets, config, etc.
โ โโโ ticket.py
โ โโโ epic.py
โ โโโ config.py
โ โโโ base.py
โโโ services/ # Jira client, validation, schema helpers
โ โโโ jira_client.py
โ โโโ validator.py
tests/ # Pytest suite
gira.py # Typer entry point
๐งฑ Tech Stack¶
| Layer | Tool / Library | Purpose |
|---|---|---|
| CLI | Typer | Declarative CLI building |
| Output | Rich | Terminal tables, formatting, progress |
| Models | Pydantic v1 | Strongly typed ticket/config schemas |
| API Client | httpx | Jira REST API integration |
| Git I/O | GitPython | Git commits, status, hooks |
| JSON Schema | jsonschema | Validating external inputs and config |
| Jira SDK | jira | Jira Cloud/Server API wrapper |
| Serialization | orjson | High-performance JSON handling |
| Logging | loguru | Structured, colorized logging |
| Progress Bars | tqdm | Visual feedback for batch operations |
| Env Variables | python-dotenv | Environment-based secrets loading |
| Packaging | Hatch or Poetry | Dependency and version management |
| Testing | Pytest, pytest-mock | CLI and core logic unit/integration tests |
| Linting/Style | Ruff, Black, isort, mypy, pre-commit | Static analysis, formatting, and CI hygiene |
๐ Key Directories¶
cli/โ Command-line interface groups, one file per entity (e.g.ticket.py)core/โ Business logic and file I/O (move tickets, resolve status)models/โ Shared Pydantic schemas across CLI and coreservices/โ Integrations (e.g., Jira), validators, index builderstests/โ Comprehensive test coverage using Pytest
โ๏ธ Planned Features (Phased)¶
- MVP CLI for ticket, epic, sprint management
- Git-integrated
.gira/filesystem tracker - CLI commands with full
--jsonand scriptable options - Comments, attachments, backlog, board support
- Import/export from Jira via REST API
- Agentic CLI: AI-friendly I/O, machine-readable reports
- Optional: Web and TUI frontends later
๐ ๏ธ Example CLI Invocation¶
gira ticket create --title "Fix crash" --assignee alice --priority high
gira epic view EPIC-1 --json
gira jira import --project ACME
๐ Git Recommendations¶
-
.gira/should be Git-tracked except: -
jira.config.json(add to.gitignore) .index.json(optional, can be rebuilt).trash/(up to team policy)
๐ฆ Suggested Dependencies (pyproject.toml)¶
[tool.poetry.dependencies]
python = "^3.9"
typer = "^0.9"
rich = "^13.5"
pydantic = "^1.10"
httpx = "^0.27"
gitpython = "^3.1"
jira = "^3.10"
orjson = "^3.8"
loguru = "^0.7"
tqdm = "^4.65"
python-dotenv = "^1.0"
jsonschema = "^4.20"
[tool.poetry.dev-dependencies]
pytest = "^7.2"
pytest-mock = "^3.11"
black = "^24.4"
isort = "^5.12"
ruff = "^0.4"
pre-commit = "^2.21"
mypy = "^1.8"
๐งช Testing Strategy¶
- Use pytest for all CLI, core, and integration logic
- Organize tests by module:
tests/test_ticket.py,tests/test_epic.py, etc. - Use Typer's CLI runner (
CliRunner) to test CLI behavior with assertions -
Include:
-
CLI command tests with output parsing
- JSON output verification for
--jsonflags - File system side effects (e.g., ticket creation)
- Validation errors and edge cases
- Use pytest-mock to mock Git, HTTPX, or file I/O as needed
- Add CI integration with GitHub Actions or Hatch hooks
๐งฉ Modular Architecture (Long-Term)¶
To support long-term scalability and interface diversity, Gira will adopt a modular monorepo architecture:
gira/
โโโ cli/ # Typer CLI (primary dev interface)
โโโ tui/ # Optional terminal UI using Textual
โโโ web/ # Local FastAPI/Flask web UI alternative to TUI
โโโ mcp/ # Message-based command processor for AI agents
โโโ ai/ # Ollama/OpenAI-powered project manager and ticket generator
โโโ core/ # Shared file handling, Git ops, status logic
โโโ models/ # Shared Pydantic data models
โโโ services/ # Jira client, indexers, AI interface wrappers
โโโ tests/ # All unit/integration tests
pyproject.toml
Why modular?¶
- Shared logic stays DRY and clean
- CLI remains the truth, but other UIs and AI modules can evolve independently
- Makes it easier to test, deploy, and reason about each interface or integration
- Enables feature-parallelism (e.g., AI team can ship ticket auto-tagging while CLI evolves separately)
Future Optional Interfaces¶
- โ
gira tuifor dashboards and non-linear workflows - โ
gira webfor stakeholders who prefer a browser - โ
gira mcpfor long-running AI integration via HTTP or socket - โ
gira aitools for summarization, ticket classification, etc.
๐ Next Steps¶
*