Skip to content

wronai/text2dsl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

text2dsl 🎀

GΕ‚osowa nawigacja CLI z kontekstowym wsparciem

Framework do gΕ‚osowej i tekstowej interakcji z narzΔ™dziami deweloperskimi (make, shell, git, docker, python) poprzez warstwΔ™ DSL z inteligentnymi sugestiami.

🌍 ObsΕ‚ugiwane jΔ™zyki

JΔ™zyk Kod TTS Voice PrzykΕ‚ad
πŸ‡΅πŸ‡± Polski pl pl-PL-MarekNeural "zbuduj projekt"
πŸ‡©πŸ‡ͺ Deutsch de de-DE-ConradNeural "bauen Projekt"
πŸ‡¬πŸ‡§ English en en-US-GuyNeural "build project"

πŸ— Architektura

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    UΕΌytkownik                               β”‚
β”‚              (gΕ‚os / tekst / terminal)                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Voice Layer (TTS/STT)                          β”‚
β”‚         Whisper / Edge-TTS / pyttsx3                        β”‚
β”‚              πŸ‡΅πŸ‡± PL  |  πŸ‡©πŸ‡ͺ DE  |  πŸ‡¬πŸ‡§ EN                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 text2DSL Parser                             β”‚
β”‚     WielojΔ™zyczne rozpoznawanie intencji + kontekst         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚           β”‚            β”‚           β”‚             β”‚
β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”
β”‚ text2 β”‚  β”‚ text2   β”‚  β”‚ text2  β”‚  β”‚  text2   β”‚  β”‚  text2   β”‚
β”‚ make  β”‚  β”‚ shell   β”‚  β”‚ git    β”‚  β”‚  docker  β”‚  β”‚  python  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Instalacja

# Podstawowa instalacja
pip install -e .

# Z obsΕ‚ugΔ… gΕ‚osu
pip install -e ".[voice]"

# PeΕ‚na instalacja (voice + dev tools)
pip install -e ".[all]"

πŸ“– UΕΌycie

Tryb interaktywny

# Polski (domyΕ›lny)
text2dsl

# Niemiecki
text2dsl --lang de

# Angielski  
text2dsl --lang en

Pojedyncze polecenie

# Polski
text2dsl "zbuduj projekt"
text2dsl "uruchom testy"
text2dsl "wypchnij zmiany"

# Niemiecki
text2dsl --lang de "bauen"
text2dsl --lang de "Tests ausfΓΌhren"

# Angielski
text2dsl --lang en "build project"
text2dsl --lang en "run tests"

Tryb gΕ‚osowy

# GΕ‚osowy tryb w polskim
text2dsl --voice --lang pl

# GΕ‚osowy tryb w niemieckim
text2dsl --voice --lang de

# GΕ‚osowy tryb w angielskim
text2dsl --voice --lang en

Eksport projektu

# Eksport do ZIP
text2dsl --export

# Eksport do TAR.GZ
text2dsl --export --format tar.gz

# Eksport z wΕ‚asnΔ… nazwΔ…
text2dsl --export -o moj_projekt.zip

# Lista plikΓ³w w projekcie
text2dsl --list-files

W kodzie Python

from text2dsl import (
    Text2DSLOrchestrator, 
    OrchestratorConfig,
    VoiceConfig,
    get_language_config
)

# Konfiguracja dla jΔ™zyka niemieckiego
lang_config = get_language_config("de")
voice_config = VoiceConfig(
    language="de",
    voice_name=lang_config.edge_tts_voice
)

config = OrchestratorConfig(
    voice_enabled=True,
    voice_config=voice_config,
    language="de"
)

orchestrator = Text2DSLOrchestrator(config)

# Wykonaj polecenie po niemiecku
response = orchestrator.process("bauen")  # β†’ make build
print(response.message)

# ZmieΕ„ jΔ™zyk na polski
orchestrator.parser.set_language("pl")
response = orchestrator.process("zbuduj")  # β†’ make build

πŸ—£ PrzykΕ‚ady poleceΕ„ w rΓ³ΕΌnych jΔ™zykach

Make

Polski Deutsch English Komenda
zbuduj bauen build make all
testy tests tests make test
wyczyΕ›Δ‡ sΓ€ubern clean make clean
zainstaluj installieren install make install

Git

Polski Deutsch English Komenda
status status status git status
zatwierdΕΊ bestΓ€tigen commit git commit
wypchnij hochladen push git push
pobierz herunterladen pull git pull
gaΕ‚Δ…ΕΊ zweig branch git branch

Docker

Polski Deutsch English Komenda
kontenery container containers docker ps
zbuduj obraz image bauen build image docker build
uruchom serwisy services starten start services compose up

Kontekstowe

Polski Deutsch English Akcja
dalej weiter next nastΔ™pna sugestia
powtΓ³rz wiederholen repeat powtΓ³rz komendΔ™
cofnij zurΓΌck back cofnij
tak ja yes potwierdΕΊ
nie nein no anuluj

πŸ“¦ Eksport i pobieranie

from text2dsl import ArchiveManager

# UtwΓ³rz menedΕΌera archiwum
manager = ArchiveManager("/path/to/project")

# Eksportuj do ZIP
result = manager.export_zip("backup.zip")
print(f"Utworzono: {result.path}")
print(f"PlikΓ³w: {result.files_count}")
print(f"Rozmiar: {manager.format_size(result.size_bytes)}")

# Eksportuj do TAR.GZ
result = manager.export_tar("backup.tar.gz", compression="gz")

# Eksportuj wybrane pliki
result = manager.export_files(
    files=["src/", "Makefile", "README.md"],
    output_path="partial.zip"
)

# Lista plikΓ³w
files = manager.list_files()
for f in files:
    print(f)

πŸ”§ Konfiguracja gΕ‚osu

from text2dsl import VoiceConfig, VoiceBackend, VoiceLayer

# PeΕ‚na konfiguracja
config = VoiceConfig(
    stt_backend=VoiceBackend.WHISPER,    # STT: Whisper
    tts_backend=VoiceBackend.EDGE_TTS,   # TTS: Microsoft Edge
    language="pl",                        # JΔ™zyk
    auto_detect_language=True,           # Automatyczne wykrywanie
    speech_rate=150,                      # SzybkoΕ›Δ‡ mowy
    volume=1.0,                           # GΕ‚oΕ›noΕ›Δ‡
)

voice = VoiceLayer(config)

# MΓ³w po polsku
voice.speak("Witaj!")

# ZmieΕ„ na niemiecki
voice.set_language("de", gender="female")
voice.speak("Willkommen!")

# ZmieΕ„ na angielski
voice.set_language("en", gender="male")
voice.speak("Welcome!")

# Pobierz komunikat systemowy
msg = voice.get_message("listening")  # β†’ "SΕ‚ucham..." / "Ich hΓΆre..." / "Listening..."

πŸ“ Struktura projektu

text2dsl/
β”œβ”€β”€ text2dsl/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ __main__.py              # CLI
β”‚   β”œβ”€β”€ orchestrator.py          # GΕ‚Γ³wny koordynator
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ dsl_parser.py        # Parser wielojΔ™zyczny
β”‚   β”‚   β”œβ”€β”€ context_manager.py   # ZarzΔ…dzanie kontekstem
β”‚   β”‚   └── suggestion_engine.py # Silnik sugestii
β”‚   β”œβ”€β”€ layers/
β”‚   β”‚   β”œβ”€β”€ voice_layer.py       # TTS/STT (PL/DE/EN)
β”‚   β”‚   β”œβ”€β”€ text2make.py
β”‚   β”‚   β”œβ”€β”€ text2shell.py
β”‚   β”‚   β”œβ”€β”€ text2git.py
β”‚   β”‚   β”œβ”€β”€ text2docker.py
β”‚   β”‚   └── text2python.py
β”‚   └── utils/
β”‚       └── archive.py           # Eksport/archiwizacja
β”œβ”€β”€ tests/
β”œβ”€β”€ examples/
β”œβ”€β”€ pyproject.toml
β”œβ”€β”€ Makefile
└── README.md

πŸ§ͺ Testy

# Uruchom testy
make test

# Z pokryciem
make test-cov

# Lint
make lint

# Formatowanie
make format

πŸ“„ Licencja

Apache 2

πŸ‘€ Autor

Softreck - softreck.dev

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published