Skip to content

Latest commit

 

History

History
1350 lines (1048 loc) · 115 KB

File metadata and controls

1350 lines (1048 loc) · 115 KB

fixOS — API Reference

75 modules | 379 functions | 66 classes

Contents

Core

fixos source

Class Methods Description Source
AgentReport 1 source
AutonomousSession 1 Self-directed autonomous diagnostic and repair session. source
FixAction 0 source
CmdResult 0 source
HITLSession 3 Interactive Human-in-the-Loop diagnostic and repair session. source
NaturalLanguageGroup 1 Click group that routes unknown commands to 'ask' command. source
FixOsConfig 3 source
DiskAnalyzer 6 Analyzes disk usage and provides cleanup suggestions source
FlatpakAnalyzer 2 Advanced analyzer for Flatpak cleanup decisions source
FlatpakItemInfo 1 Detailed info about a Flatpak item (app, runtime, or data) source
FlatpakItemType 0 source
ServiceCleaner 6 Plans and executes cleanup of service data. source
ServiceDetailsProvider 1 Provides detailed information about service data. source
ServiceDataInfo 0 Information about service data. source
ServiceDataScanner 4 Scans for large service data directories and allows cleanup. source
ServiceType 0 Service types that can be scanned and cleaned. source
SystemDetector 1 Detects system parameters. source
SystemInfo 0 Complete system information snapshot. source
AuditResult 3 Result of feature audit - what's installed, what's missing. source
FeatureAuditor 1 Compares installed packages with profile requirements. source
PackageCatalog 4 Manages the package database. source
PackageCategory 0 A category of packages (e.g., core_utils, dev_tools). source
PackageInfo 2 Information about a single package. source
FeatureInstaller 2 Safely installs packages using native package manager or other backends. source
UserProfile 4 A user profile defining what packages/features they want. source
FeatureRenderer 3 Renders audit results for terminal display. source
CleanupAction 0 Represents a cleanup action source
CleanupPlanner 4 Interactive cleanup planning and grouping system source
CleanupType 0 source
Priority 0 source
CommandExecutor 6 Bezpieczny executor komend z: source
CommandTimeoutError 0 source
DangerousCommandError 0 source
ExecutionResult 2 source
Problem 2 source
ProblemGraph 7 DAG problemów systemowych z topological sort do wyznaczania kolejności napraw. source
FixOrchestrator 4 Orkiestrator napraw systemowych. source
RollbackEntry 0 Single recorded operation with its rollback command. source
RollbackSession 5 A session of recorded operations that can be rolled back. source
DiagnosticPlugin 3 Bazowa klasa dla pluginów diagnostycznych fixOS. source
DiagnosticResult 1 Result of a diagnostic plugin run. source
Finding 0 Single finding from a diagnostic plugin. source
Severity 0 Severity level for diagnostic findings. source
Plugin 1 source
Plugin 1 source
Plugin 1 source
Plugin 1 source
Plugin 1 source
Plugin 1 source
PluginRegistry 6 Registry for diagnostic plugins with autodiscovery. source
Profile 3 Profil diagnostyczny z zestawem modułów i progów. source
LLMClient 5 Wrapper nad openai.OpenAI kompatybilny z wieloma providerami. source
LLMError 0 Błąd komunikacji z LLM. source
LLMAnalysis 0 Result of LLM analysis source
LLMAnalyzer 4 Uses LLM to analyze disk issues when heuristics aren't sufficient source
CommandValidation 0 Wynik walidacji komendy przez LLM. source
FixSuggestion 0 Pojedyncza sugestia naprawy od LLM. source
LLMDiagnosticResponse 0 Strukturalna odpowiedź LLM na dane diagnostyczne. source
NLPIntent 0 Rozpoznana intencja z polecenia NLP. source
RiskLevel 0 source
AnonymizationReport 2 Raport anonimizacji – co zostało zmaskowane. source
SessionTimeout 0 Wyjątek rzucany po przekroczeniu limitu czasu sesji. source
SearchResult 0 source
WatchDaemon 2 Daemon wykonujący cykliczną diagnostykę z powiadomieniami. source

HITLSession methods:

  • remaining() — Get remaining session time in seconds.
  • fmt_time(s) — Format seconds as HH:MM:SS.
  • run() — Run the HITL session.

FixOsConfig methods:

  • load(cls) — Tworzy konfigurację z połączonych źródeł.
  • validate() — Zwraca listę błędów walidacji (pusta = OK).
  • summary() — Krótkie podsumowanie konfiguracji (bez klucza API).

DiskAnalyzer methods:

  • analyze_disk_usage(path) — Comprehensive disk usage analysis
  • get_large_files(path, min_size_mb, max_files) — Find large files
  • get_cache_dirs(path, max_dirs) — Find cache directories
  • get_log_dirs(path, max_dirs) — Find log directories
  • get_temp_dirs(path, max_dirs) — Find temporary directories
  • suggest_cleanup_actions(path) — Generate cleanup suggestions using heuristics

FlatpakAnalyzer methods:

  • analyze() — Run full Flatpak analysis
  • get_cleanup_summary() — Get human-readable summary of cleanup opportunities

ServiceCleaner methods:

  • get_cleanup_plan(selected_services) — Generate cleanup plan for services.
  • cleanup_service(service_type, dry_run) — Execute cleanup for a specific service.
  • is_safe_cleanup(service_type) — Determine if cleanup is generally safe (cache-only, not user data).
  • get_service_description(service_type) — Get description for service type.
  • get_cleanup_command(service_type, path) — Get cleanup command for service.
  • get_preview_command(service_type, path) — Get preview command for service.

ServiceDataScanner methods:

  • scan_all_services() — Scan all known services for data above threshold.
  • scan_service(service_type) — Scan specific service type for data.
  • get_cleanup_plan(selected_services) — Generate cleanup plan for services.
  • cleanup_service(service_type, dry_run) — Execute cleanup for a specific service.

PackageCatalog methods:

  • load(cls, data_dir) — Load package catalog from YAML files.
  • get_package(pkg_id) — Get package by ID.
  • get_packages_by_category(category) — Get all packages in a category.
  • list_categories() — List all category IDs.

PackageInfo methods:

  • get_distro_name(distro) — Get package name for specific distro.
  • is_available_on(distro) — Check if package is available on given distro.

FeatureInstaller methods:

  • install(packages) — Install a list of packages.
  • get_rollback_commands(installed_packages) — Generate rollback commands for installed packages.

UserProfile methods:

  • load(cls, profile_name, data_dir) — Load a profile from YAML file.
  • list_available(cls, data_dir) — List available profile names.
  • resolve_packages(catalog, system_info) — Resolve all packages for this profile based on system.
  • to_dict() — Convert to dictionary.

FeatureRenderer methods:

  • render_audit(result) — Render complete audit results.
  • render_package_list(packages, title) — Render a list of packages.
  • render_system_info(system) — Render system information.

CleanupPlanner methods:

  • group_by_category(suggestions) — Group cleanup suggestions by category
  • prioritize_actions(grouped_actions) — Create prioritized list of all actions
  • create_cleanup_plan(suggestions) — Create comprehensive cleanup plan
  • interactive_selection(plan) — Interactive selection process (simulated for now)

CommandExecutor methods:

  • is_dangerous(command) — Sprawdza czy komenda jest potencjalnie destruktywna.
  • needs_sudo(command)
  • add_sudo(command)
  • check_idempotent(command) — Zwraca komendę sprawdzającą stan (jeśli znana), None jeśli nie dotyczy.
  • execute_sync(command, timeout, add_sudo, check_idempotent) — Synchroniczne wykonanie komendy.
  • execute(command, timeout, add_sudo) — Asynchroniczne wykonanie komendy.

Problem methods:

  • is_actionable()
  • to_summary()

ProblemGraph methods:

  • add(problem)
  • get(problem_id)
  • next_actionable() — Zwraca pierwszy problem bez nierozwiązanych zależności.
  • all_done()
  • pending_count()
  • summary()
  • render_tree() — Renderuje drzewo problemów jako tekst.

FixOrchestrator methods:

  • load_from_diagnostics(diagnostics) — Parsuje dane diagnostyczne przez LLM i buduje graf problemów.
  • load_from_dict(problems_data) — Ładuje problemy bezpośrednio z listy dict (bez LLM).
  • run_sync(confirm_fn, progress_fn) — Synchroniczna pętla napraw (dla trybu HITL).
  • run_async(confirm_fn, progress_fn) — Asynchroniczna wersja run_sync.

RollbackSession methods:

  • record(command, rollback_cmd, stdout, stderr, ...) — Zapisz wykonaną operację.
  • get_rollback_commands() — Zwraca listę (komenda, rollback) w odwróconej kolejności.
  • rollback_last(n, dry_run) — Cofnij ostatnich n operacji.
  • load(cls, session_id) — Załaduj sesję z pliku.
  • list_sessions(cls, limit) — Lista ostatnich sesji rollback.

DiagnosticPlugin methods:

  • diagnose() — Wykonaj diagnostykę i zwróć wynik.
  • can_run() — Czy plugin może działać na aktualnej platformie?
  • get_metadata()

PluginRegistry methods:

  • discover() — Odkrywanie pluginów przez builtin + entry_points.
  • register(plugin) — Ręczna rejestracja pluginu.
  • list_plugins(runnable_only) — Lista zarejestrowanych pluginów.
  • get_plugin(name) — Pobierz plugin po nazwie.
  • run(modules, progress_callback) — Uruchom diagnostykę dla wybranych (lub wszystkich) modułów.

Profile methods:

  • load(cls, name) — Załaduj profil — najpierw user, potem builtin.
  • list_available(cls) — Lista dostępnych profili (builtin + user).
  • to_dict()

LLMClient methods:

  • chat(messages) — Wysyła wiadomości do LLM i zwraca odpowiedź jako string.
  • chat_stream(messages) — Generator streamujący tokeny odpowiedzi.
  • chat_structured(messages, response_model) — Wywołanie LLM z wymuszonym schematem JSON (Pydantic model).
  • ping() — Sprawdza czy API odpowiada (krótki test).

LLMAnalyzer methods:

  • analyze_disk_issues(disk_data) — Use LLM to analyze disk issues when heuristics are insufficient
  • analyze_failed_action(action, error) — Analyze failed cleanup action and suggest alternatives
  • analyze_complex_pattern(pattern_data) — Analyze complex disk usage patterns that heuristics can't categorize
  • enhance_heuristics_with_llm(heuristic_suggestions, disk_data) — Enhance heuristic suggestions with LLM insights

AnonymizationReport methods:

  • add(category, count)
  • summary()

WatchDaemon methods:

  • run() — Główna pętla monitorowania.
  • stop() — Zatrzymaj daemon.
Function Signature CC Description Source
run_autonomous_session run_autonomous_session(diagnostics, config, show_data, max_fixes) 1 Uruchamia autonomiczny tryb agenta. source
run_autonomous_session run_autonomous_session(diagnostics, config, show_data, max_fixes) 1 Run autonomous session (backward compatible wrapper). source
run_hitl_session run_hitl_session(diagnostics, config, show_data) 1 Run interactive HITL session with full transparency. source
run_hitl_session run_hitl_session(diagnostics, config, show_data) 1 Run interactive HITL session (backward compatible wrapper). source
anonymize anonymize(data_str) 5 Anonimizuje wrażliwe dane w stringu. source
get_sensitive_values get_sensitive_values() 4 Zbiera aktualne wrażliwe wartości systemowe do zamaskowania. source
ask ask(prompt, dry_run) 1 Wykonaj polecenie w języku naturalnym. source
cleanup_services cleanup_services(threshold, services, json_output, cleanup, ...) 15 ⚠️ Skanuje i czyści dane usług przekraczające próg. source
config config() 1 Zarządzanie konfiguracją fixOS. source
config_init config_init(force) 3 Zainicjalizuj plik konfiguracyjny .env. source
config_set config_set(key, value) 2 Ustaw wartość konfiguracyjną w .env. source
config_show config_show() 4 Pokaż aktualną konfigurację. source
features features() 1 Zarządzanie pakietami komfortu systemu. source
features_audit features_audit(profile, json_output) 4 Sprawdź brakujące pakiety dla profilu. source
features_install features_install(profile, dry_run, yes, category) 15 ⚠️ Zainstaluj brakujące pakiety dla profilu. source
features_profiles features_profiles() 3 Lista dostępnych profili. source
features_system features_system() 1 Pokaż wykryty system. source
execute_cleanup_actions execute_cleanup_actions(actions, cfg, llm_fallback) 6 Execute cleanup actions with safety checks source
fix fix(provider, token, model, no_banner, ...) 18 ⚠️ Przeprowadza pełną diagnostykę i uruchamia sesję naprawczą z LLM. source
handle_disk_cleanup_mode handle_disk_cleanup_mode(disk_analysis, cfg, dry_run, interactive, ...) 13 ⚠️ Handle disk cleanup mode with interactive planning source
try_llm_fallback_for_failures try_llm_fallback_for_failures(failed_actions, cfg) 3 Try to fix failed actions using LLM source
history history(limit, json_output) 5 Historia napraw fixOS. source
cli cli(ctx, dry_run, version) 3 fixos – AI-powered diagnostyka i naprawa Linux, Windows, macOS. source
main main() 1 Entry point for fixOS CLI. source
orchestrate orchestrate(provider, token, model, no_banner, ...) 13 ⚠️ Zaawansowana orkiestracja napraw z grafem problemów. source
profile profile() 1 Zarządzanie profilami diagnostycznymi. source
profile_list profile_list() 4 Pokaż dostępne profile diagnostyczne. source
profile_show profile_show(name) 4 Pokaż szczegóły profilu diagnostycznego. source
llm_providers llm_providers(free) 6 Lista dostępnych providerów LLM. source
providers providers() 4 Lista providerów LLM z oznaczeniem FREE/PAID. source
test_llm test_llm(provider, token, model, no_banner) 9 Test połączenia z LLM. source
quickfix quickfix(dry_run, modules) 12 ⚠️ Natychmiastowe naprawy bez API — baza znanych bugów. source
report report(output_format, output, modules, profile) 16 ⚠️ Eksport wyników diagnostyki do raportu HTML/Markdown/JSON. source
rollback rollback() 1 Zarządzanie cofaniem operacji fixOS. source
rollback_list rollback_list(limit) 3 Pokaż historię sesji naprawczych. source
rollback_show rollback_show(session_id) 5 Pokaż szczegóły sesji rollback. source
rollback_undo rollback_undo(session_id, last, dry_run) 7 Cofnij operacje z podanej sesji. source
scan scan(modules, output, show_raw, no_banner, ...) 12 ⚠️ Przeprowadza diagnostykę systemu. source
add_common_options add_common_options(fn) 2 Decorator adding common LLM options to a Click command. source
add_shared_options add_shared_options(func) 1 Shared options for both scan and fix commands. source
token token() 1 Zarządzanie tokenem API. source
token_clear token_clear(env_file) 3 Usuń token z pliku .env. source
token_set token_set(key, provider, env_file) 7 Zapisz token API do pliku .env. source
token_show token_show() 2 Pokaż obecny token (masked). source
watch watch(interval, modules, alert_on, max_iterations) 2 Monitorowanie systemu w tle z powiadomieniami. source
detect_provider_from_key detect_provider_from_key(key) 3 Wykrywa provider na podstawie prefiksu klucza API. source
get_providers_list get_providers_list() 3 Zwraca listę providerów jako listę słowników. source
interactive_provider_setup interactive_provider_setup() 24 ⚠️ Interaktywny wybór providera gdy brak konfiguracji. source
main main() 1 Test the disk analyzer source
analyze_flatpak_for_cleanup analyze_flatpak_for_cleanup() 1 Convenience function to run full Flatpak analysis source
main main() 1 Test the service data scanner. source
diagnose_audio diagnose_audio() 1 Diagnostyka dźwięku (ALSA/PipeWire/PulseAudio/SOF). source
diagnose_hardware diagnose_hardware() 1 Diagnostyka sprzętu laptopa/desktopa (ACPI, kamera, touchpad, DMI). source
diagnose_resources diagnose_resources() 13 ⚠️ Diagnostyka zasobów systemowych. source
diagnose_security diagnose_security() 4 Diagnostyka bezpieczeństwa systemu i sieci. source
diagnose_system diagnose_system() 14 ⚠️ System metrics – cross-platform: CPU, RAM, disks, processes. source
diagnose_thumbnails diagnose_thumbnails() 1 Diagnostyka podglądów plików (thumbnails) w system. source
get_full_diagnostics get_full_diagnostics(modules, progress_callback) 7 Zbiera diagnostykę z wybranych modułów. source
main main() 1 Test the cleanup planner source
execute_command execute_command(cmd) 10 Wykonuje komendę systemową z potwierdzeniem użytkownika. source
format_time format_time(seconds) 1 source
run_llm_shell run_llm_shell(diagnostics_data, token, model, timeout, ...) 15 ⚠️ Uruchamia interaktywny shell LLM z przekazanymi danymi diagnostycznymi. source
cancel_signal_timeout cancel_signal_timeout() 2 Cancels the timeout signal (POSIX only). source
elevate_cmd elevate_cmd(cmd) 3 Adds sudo (Linux/Mac) or wraps in PowerShell -Verb RunAs (Windows). source
get_os_info get_os_info() 5 Returns basic OS information. source
get_package_manager get_package_manager() 8 Detects the system package manager. source
install_package_cmd install_package_cmd(package) 2 Returns the install command for the detected package manager. source
is_dangerous is_dangerous(cmd) 3 Returns reason string if command is dangerous, None if safe. source
needs_elevation needs_elevation(cmd) 5 Returns True if command likely needs admin/sudo. source
run_command run_command(cmd, timeout, shell) 5 Runs a command cross-platform. source
setup_signal_timeout setup_signal_timeout(seconds, handler) 2 Sets up a timeout signal. Returns True if supported (POSIX only). source
main main() 1 Test the LLM analyzer source
get_cpu_info get_cpu_info() 2 Metryki CPU. source
get_disk_info get_disk_info() 3 Metryki dysków dla wszystkich partycji. source
get_fedora_specific get_fedora_specific() 1 Komendy specyficzne dla system: dnf, journalctl, systemctl. source
get_full_diagnostics get_full_diagnostics() 1 Zbiera kompletne dane diagnostyczne systemu system. source
get_memory_info get_memory_info() 1 Metryki RAM i SWAP. source
get_network_info get_network_info() 4 Statystyki sieciowe (bez wrażliwych danych - anonimizacja jest osobno). source
get_top_processes get_top_processes(n) 3 Lista TOP N procesów według zużycia CPU. source
run_cmd run_cmd(cmd, timeout) 6 Uruchamia komendę shell i zwraca output. Bezpieczny fallback przy błędzie. source
anonymize anonymize(data_str) 15 ⚠️ Anonimizuje wrażliwe dane. source
display_anonymized_preview display_anonymized_preview(data_str, report, max_lines) 5 Wyświetla użytkownikowi zanonimizowane dane przed wysłaniem do LLM. source
colorize colorize(line) 1 Return line unchanged – rich handles markup in render_md(). source
print_cmd_block print_cmd_block(cmd, comment, dry_run) 4 Print a framed command preview panel. source
print_problem_header print_problem_header(problem_id, description, severity, status, ...) 3 Print a colored problem header panel. source
print_stderr_box print_stderr_box(stderr, max_lines) 2 Print stderr in a rich Panel. source
print_stdout_box print_stdout_box(stdout, max_lines) 2 Print stdout in a rich Panel. source
render_md render_md(text) 16 ⚠️ Print LLM markdown reply to terminal via rich. source
render_tree_colored render_tree_colored(nodes, execution_order) 8 Render a ProblemGraph as a rich-markup string. source
timeout_handler timeout_handler(signum, frame) 1 Signal handler dla SIGALRM — rzuca SessionTimeout. source
format_results_for_llm format_results_for_llm(results) 3 Formatuje wyniki wyszukiwania do wklejenia w prompt LLM. source
search_all search_all(query, serpapi_key, max_per_source) 5 Przeszukuje wszystkie dostępne źródła wiedzy. source
search_arch_wiki search_arch_wiki(query, max_results) 9 Arch Wiki – doskonałe źródło dla problemów Linux (nie tylko Arch). source
search_ask_fedora search_ask_fedora(query, max_results) 4 Szuka w Linux forums przez Discourse API. source
search_ddg search_ddg(query, max_results) 8 DuckDuckGo Instant Answer API (bez klucza, ograniczone). source
search_fedora_bugzilla search_fedora_bugzilla(query, max_results) 4 Szuka w Linux Bugzilla przez REST API. source
search_github_issues search_github_issues(query, max_results) 4 GitHub Issues – linuxhardware, ALSA, PipeWire, PulseAudio repos. source
search_serpapi search_serpapi(query, api_key, max_results) 5 SerpAPI – Google/Bing search (wymaga klucza API). source

fixos

fixos.agent source

Class Methods Description Source
AgentReport 1 source
AutonomousSession 1 Self-directed autonomous diagnostic and repair session. source
FixAction 0 source
CmdResult 0 source
HITLSession 3 Interactive Human-in-the-Loop diagnostic and repair session. source

HITLSession methods:

  • remaining() — Get remaining session time in seconds.
  • fmt_time(s) — Format seconds as HH:MM:SS.
  • run() — Run the HITL session.
Function Signature CC Description Source
run_autonomous_session run_autonomous_session(diagnostics, config, show_data, max_fixes) 1 Uruchamia autonomiczny tryb agenta. source
run_autonomous_session run_autonomous_session(diagnostics, config, show_data, max_fixes) 1 Run autonomous session (backward compatible wrapper). source
run_hitl_session run_hitl_session(diagnostics, config, show_data) 1 Run interactive HITL session with full transparency. source
run_hitl_session run_hitl_session(diagnostics, config, show_data) 1 Run interactive HITL session (backward compatible wrapper). source

fixos.agent.autonomous source

Function Signature CC Description Source
run_autonomous_session run_autonomous_session(diagnostics, config, show_data, max_fixes) 1 Uruchamia autonomiczny tryb agenta. source

fixos.agent.autonomous_session source

Class Methods Description Source
AgentReport 1 source
AutonomousSession 1 Self-directed autonomous diagnostic and repair session. source
FixAction 0 source
Function Signature CC Description Source
run_autonomous_session run_autonomous_session(diagnostics, config, show_data, max_fixes) 1 Run autonomous session (backward compatible wrapper). source

fixos.agent.hitl source

Function Signature CC Description Source
run_hitl_session run_hitl_session(diagnostics, config, show_data) 1 Run interactive HITL session with full transparency. source

fixos.agent.hitl_session source

Class Methods Description Source
CmdResult 0 source
HITLSession 3 Interactive Human-in-the-Loop diagnostic and repair session. source

HITLSession methods:

  • remaining() — Get remaining session time in seconds.
  • fmt_time(s) — Format seconds as HH:MM:SS.
  • run() — Run the HITL session.
Function Signature CC Description Source
run_hitl_session run_hitl_session(diagnostics, config, show_data) 1 Run interactive HITL session (backward compatible wrapper). source

fixos.anonymizer source

Function Signature CC Description Source
anonymize anonymize(data_str) 5 Anonimizuje wrażliwe dane w stringu. source
get_sensitive_values get_sensitive_values() 4 Zbiera aktualne wrażliwe wartości systemowe do zamaskowania. source

fixos.cli source

Class Methods Description Source
NaturalLanguageGroup 1 Click group that routes unknown commands to 'ask' command. source
Function Signature CC Description Source
ask ask(prompt, dry_run) 1 Wykonaj polecenie w języku naturalnym. source
cleanup_services cleanup_services(threshold, services, json_output, cleanup, ...) 15 ⚠️ Skanuje i czyści dane usług przekraczające próg. source
config config() 1 Zarządzanie konfiguracją fixOS. source
config_init config_init(force) 3 Zainicjalizuj plik konfiguracyjny .env. source
config_set config_set(key, value) 2 Ustaw wartość konfiguracyjną w .env. source
config_show config_show() 4 Pokaż aktualną konfigurację. source
features features() 1 Zarządzanie pakietami komfortu systemu. source
features_audit features_audit(profile, json_output) 4 Sprawdź brakujące pakiety dla profilu. source
features_install features_install(profile, dry_run, yes, category) 15 ⚠️ Zainstaluj brakujące pakiety dla profilu. source
features_profiles features_profiles() 3 Lista dostępnych profili. source
features_system features_system() 1 Pokaż wykryty system. source
execute_cleanup_actions execute_cleanup_actions(actions, cfg, llm_fallback) 6 Execute cleanup actions with safety checks source
fix fix(provider, token, model, no_banner, ...) 18 ⚠️ Przeprowadza pełną diagnostykę i uruchamia sesję naprawczą z LLM. source
handle_disk_cleanup_mode handle_disk_cleanup_mode(disk_analysis, cfg, dry_run, interactive, ...) 13 ⚠️ Handle disk cleanup mode with interactive planning source
try_llm_fallback_for_failures try_llm_fallback_for_failures(failed_actions, cfg) 3 Try to fix failed actions using LLM source
history history(limit, json_output) 5 Historia napraw fixOS. source
cli cli(ctx, dry_run, version) 3 fixos – AI-powered diagnostyka i naprawa Linux, Windows, macOS. source
main main() 1 Entry point for fixOS CLI. source
orchestrate orchestrate(provider, token, model, no_banner, ...) 13 ⚠️ Zaawansowana orkiestracja napraw z grafem problemów. source
profile profile() 1 Zarządzanie profilami diagnostycznymi. source
profile_list profile_list() 4 Pokaż dostępne profile diagnostyczne. source
profile_show profile_show(name) 4 Pokaż szczegóły profilu diagnostycznego. source
llm_providers llm_providers(free) 6 Lista dostępnych providerów LLM. source
providers providers() 4 Lista providerów LLM z oznaczeniem FREE/PAID. source
test_llm test_llm(provider, token, model, no_banner) 9 Test połączenia z LLM. source
quickfix quickfix(dry_run, modules) 12 ⚠️ Natychmiastowe naprawy bez API — baza znanych bugów. source
report report(output_format, output, modules, profile) 16 ⚠️ Eksport wyników diagnostyki do raportu HTML/Markdown/JSON. source
rollback rollback() 1 Zarządzanie cofaniem operacji fixOS. source
rollback_list rollback_list(limit) 3 Pokaż historię sesji naprawczych. source
rollback_show rollback_show(session_id) 5 Pokaż szczegóły sesji rollback. source
rollback_undo rollback_undo(session_id, last, dry_run) 7 Cofnij operacje z podanej sesji. source
scan scan(modules, output, show_raw, no_banner, ...) 12 ⚠️ Przeprowadza diagnostykę systemu. source
add_common_options add_common_options(fn) 2 Decorator adding common LLM options to a Click command. source
add_shared_options add_shared_options(func) 1 Shared options for both scan and fix commands. source
token token() 1 Zarządzanie tokenem API. source
token_clear token_clear(env_file) 3 Usuń token z pliku .env. source
token_set token_set(key, provider, env_file) 7 Zapisz token API do pliku .env. source
token_show token_show() 2 Pokaż obecny token (masked). source
watch watch(interval, modules, alert_on, max_iterations) 2 Monitorowanie systemu w tle z powiadomieniami. source

fixos.cli.ask_cmd source

Function Signature CC Description Source
ask ask(prompt, dry_run) 1 Wykonaj polecenie w języku naturalnym. source

fixos.cli.cleanup_cmd source

Function Signature CC Description Source
cleanup_services cleanup_services(threshold, services, json_output, cleanup, ...) 15 ⚠️ Skanuje i czyści dane usług przekraczające próg. source

fixos.cli.config_cmd source

Function Signature CC Description Source
config config() 1 Zarządzanie konfiguracją fixOS. source
config_init config_init(force) 3 Zainicjalizuj plik konfiguracyjny .env. source
config_set config_set(key, value) 2 Ustaw wartość konfiguracyjną w .env. source
config_show config_show() 4 Pokaż aktualną konfigurację. source

fixos.cli.features_cmd source

Function Signature CC Description Source
features features() 1 Zarządzanie pakietami komfortu systemu. source
features_audit features_audit(profile, json_output) 4 Sprawdź brakujące pakiety dla profilu. source
features_install features_install(profile, dry_run, yes, category) 15 ⚠️ Zainstaluj brakujące pakiety dla profilu. source
features_profiles features_profiles() 3 Lista dostępnych profili. source
features_system features_system() 1 Pokaż wykryty system. source

fixos.cli.fix_cmd source

Function Signature CC Description Source
execute_cleanup_actions execute_cleanup_actions(actions, cfg, llm_fallback) 6 Execute cleanup actions with safety checks source
fix fix(provider, token, model, no_banner, ...) 18 ⚠️ Przeprowadza pełną diagnostykę i uruchamia sesję naprawczą z LLM. source
handle_disk_cleanup_mode handle_disk_cleanup_mode(disk_analysis, cfg, dry_run, interactive, ...) 13 ⚠️ Handle disk cleanup mode with interactive planning source
try_llm_fallback_for_failures try_llm_fallback_for_failures(failed_actions, cfg) 3 Try to fix failed actions using LLM source

fixos.cli.history_cmd source

Function Signature CC Description Source
history history(limit, json_output) 5 Historia napraw fixOS. source

fixos.cli.main source

Function Signature CC Description Source
cli cli(ctx, dry_run, version) 3 fixos – AI-powered diagnostyka i naprawa Linux, Windows, macOS. source
main main() 1 Entry point for fixOS CLI. source

fixos.cli.orchestrate_cmd source

Function Signature CC Description Source
orchestrate orchestrate(provider, token, model, no_banner, ...) 13 ⚠️ Zaawansowana orkiestracja napraw z grafem problemów. source

fixos.cli.profile_cmd source

Function Signature CC Description Source
profile profile() 1 Zarządzanie profilami diagnostycznymi. source
profile_list profile_list() 4 Pokaż dostępne profile diagnostyczne. source
profile_show profile_show(name) 4 Pokaż szczegóły profilu diagnostycznego. source

fixos.cli.provider_cmd source

Function Signature CC Description Source
llm_providers llm_providers(free) 6 Lista dostępnych providerów LLM. source
providers providers() 4 Lista providerów LLM z oznaczeniem FREE/PAID. source
test_llm test_llm(provider, token, model, no_banner) 9 Test połączenia z LLM. source

fixos.cli.quickfix_cmd source

Function Signature CC Description Source
quickfix quickfix(dry_run, modules) 12 ⚠️ Natychmiastowe naprawy bez API — baza znanych bugów. source

fixos.cli.report_cmd source

Function Signature CC Description Source
report report(output_format, output, modules, profile) 16 ⚠️ Eksport wyników diagnostyki do raportu HTML/Markdown/JSON. source

fixos.cli.rollback_cmd source

Function Signature CC Description Source
rollback rollback() 1 Zarządzanie cofaniem operacji fixOS. source
rollback_list rollback_list(limit) 3 Pokaż historię sesji naprawczych. source
rollback_show rollback_show(session_id) 5 Pokaż szczegóły sesji rollback. source
rollback_undo rollback_undo(session_id, last, dry_run) 7 Cofnij operacje z podanej sesji. source

fixos.cli.scan_cmd source

Function Signature CC Description Source
scan scan(modules, output, show_raw, no_banner, ...) 12 ⚠️ Przeprowadza diagnostykę systemu. source

fixos.cli.shared source

Class Methods Description Source
NaturalLanguageGroup 1 Click group that routes unknown commands to 'ask' command. source
Function Signature CC Description Source
add_common_options add_common_options(fn) 2 Decorator adding common LLM options to a Click command. source
add_shared_options add_shared_options(func) 1 Shared options for both scan and fix commands. source

fixos.cli.token_cmd source

Function Signature CC Description Source
token token() 1 Zarządzanie tokenem API. source
token_clear token_clear(env_file) 3 Usuń token z pliku .env. source
token_set token_set(key, provider, env_file) 7 Zapisz token API do pliku .env. source
token_show token_show() 2 Pokaż obecny token (masked). source

fixos.cli.watch_cmd source

Function Signature CC Description Source
watch watch(interval, modules, alert_on, max_iterations) 2 Monitorowanie systemu w tle z powiadomieniami. source

fixos.config source

Class Methods Description Source
FixOsConfig 3 source

FixOsConfig methods:

  • load(cls) — Tworzy konfigurację z połączonych źródeł.
  • validate() — Zwraca listę błędów walidacji (pusta = OK).
  • summary() — Krótkie podsumowanie konfiguracji (bez klucza API).
Function Signature CC Description Source
detect_provider_from_key detect_provider_from_key(key) 3 Wykrywa provider na podstawie prefiksu klucza API. source
get_providers_list get_providers_list() 3 Zwraca listę providerów jako listę słowników. source
interactive_provider_setup interactive_provider_setup() 24 ⚠️ Interaktywny wybór providera gdy brak konfiguracji. source

fixos.diagnostics source

Class Methods Description Source
DiskAnalyzer 6 Analyzes disk usage and provides cleanup suggestions source
FlatpakAnalyzer 2 Advanced analyzer for Flatpak cleanup decisions source
FlatpakItemInfo 1 Detailed info about a Flatpak item (app, runtime, or data) source
FlatpakItemType 0 source
ServiceCleaner 6 Plans and executes cleanup of service data. source
ServiceDetailsProvider 1 Provides detailed information about service data. source
ServiceDataInfo 0 Information about service data. source
ServiceDataScanner 4 Scans for large service data directories and allows cleanup. source
ServiceType 0 Service types that can be scanned and cleaned. source

DiskAnalyzer methods:

  • analyze_disk_usage(path) — Comprehensive disk usage analysis
  • get_large_files(path, min_size_mb, max_files) — Find large files
  • get_cache_dirs(path, max_dirs) — Find cache directories
  • get_log_dirs(path, max_dirs) — Find log directories
  • get_temp_dirs(path, max_dirs) — Find temporary directories
  • suggest_cleanup_actions(path) — Generate cleanup suggestions using heuristics

FlatpakAnalyzer methods:

  • analyze() — Run full Flatpak analysis
  • get_cleanup_summary() — Get human-readable summary of cleanup opportunities

ServiceCleaner methods:

  • get_cleanup_plan(selected_services) — Generate cleanup plan for services.
  • cleanup_service(service_type, dry_run) — Execute cleanup for a specific service.
  • is_safe_cleanup(service_type) — Determine if cleanup is generally safe (cache-only, not user data).
  • get_service_description(service_type) — Get description for service type.
  • get_cleanup_command(service_type, path) — Get cleanup command for service.
  • get_preview_command(service_type, path) — Get preview command for service.

ServiceDataScanner methods:

  • scan_all_services() — Scan all known services for data above threshold.
  • scan_service(service_type) — Scan specific service type for data.
  • get_cleanup_plan(selected_services) — Generate cleanup plan for services.
  • cleanup_service(service_type, dry_run) — Execute cleanup for a specific service.
Function Signature CC Description Source
main main() 1 Test the disk analyzer source
analyze_flatpak_for_cleanup analyze_flatpak_for_cleanup() 1 Convenience function to run full Flatpak analysis source
main main() 1 Test the service data scanner. source
diagnose_audio diagnose_audio() 1 Diagnostyka dźwięku (ALSA/PipeWire/PulseAudio/SOF). source
diagnose_hardware diagnose_hardware() 1 Diagnostyka sprzętu laptopa/desktopa (ACPI, kamera, touchpad, DMI). source
diagnose_resources diagnose_resources() 13 ⚠️ Diagnostyka zasobów systemowych. source
diagnose_security diagnose_security() 4 Diagnostyka bezpieczeństwa systemu i sieci. source
diagnose_system diagnose_system() 14 ⚠️ System metrics – cross-platform: CPU, RAM, disks, processes. source
diagnose_thumbnails diagnose_thumbnails() 1 Diagnostyka podglądów plików (thumbnails) w system. source
get_full_diagnostics get_full_diagnostics(modules, progress_callback) 7 Zbiera diagnostykę z wybranych modułów. source

fixos.diagnostics.disk_analyzer source

Class Methods Description Source
DiskAnalyzer 6 Analyzes disk usage and provides cleanup suggestions source

DiskAnalyzer methods:

  • analyze_disk_usage(path) — Comprehensive disk usage analysis
  • get_large_files(path, min_size_mb, max_files) — Find large files
  • get_cache_dirs(path, max_dirs) — Find cache directories
  • get_log_dirs(path, max_dirs) — Find log directories
  • get_temp_dirs(path, max_dirs) — Find temporary directories
  • suggest_cleanup_actions(path) — Generate cleanup suggestions using heuristics
Function Signature CC Description Source
main main() 1 Test the disk analyzer source

fixos.diagnostics.flatpak_analyzer source

Class Methods Description Source
FlatpakAnalyzer 2 Advanced analyzer for Flatpak cleanup decisions source
FlatpakItemInfo 1 Detailed info about a Flatpak item (app, runtime, or data) source
FlatpakItemType 0 source

FlatpakAnalyzer methods:

  • analyze() — Run full Flatpak analysis
  • get_cleanup_summary() — Get human-readable summary of cleanup opportunities
Function Signature CC Description Source
analyze_flatpak_for_cleanup analyze_flatpak_for_cleanup() 1 Convenience function to run full Flatpak analysis source

fixos.diagnostics.service_cleanup source

Class Methods Description Source
ServiceCleaner 6 Plans and executes cleanup of service data. source

ServiceCleaner methods:

  • get_cleanup_plan(selected_services) — Generate cleanup plan for services.
  • cleanup_service(service_type, dry_run) — Execute cleanup for a specific service.
  • is_safe_cleanup(service_type) — Determine if cleanup is generally safe (cache-only, not user data).
  • get_service_description(service_type) — Get description for service type.
  • get_cleanup_command(service_type, path) — Get cleanup command for service.
  • get_preview_command(service_type, path) — Get preview command for service.

fixos.diagnostics.service_details source

Class Methods Description Source
ServiceDetailsProvider 1 Provides detailed information about service data. source

fixos.diagnostics.service_scanner source

Class Methods Description Source
ServiceDataInfo 0 Information about service data. source
ServiceDataScanner 4 Scans for large service data directories and allows cleanup. source
ServiceType 0 Service types that can be scanned and cleaned. source

ServiceDataScanner methods:

  • scan_all_services() — Scan all known services for data above threshold.
  • scan_service(service_type) — Scan specific service type for data.
  • get_cleanup_plan(selected_services) — Generate cleanup plan for services.
  • cleanup_service(service_type, dry_run) — Execute cleanup for a specific service.
Function Signature CC Description Source
main main() 1 Test the service data scanner. source

fixos.diagnostics.system_checks source

Function Signature CC Description Source
diagnose_audio diagnose_audio() 1 Diagnostyka dźwięku (ALSA/PipeWire/PulseAudio/SOF). source
diagnose_hardware diagnose_hardware() 1 Diagnostyka sprzętu laptopa/desktopa (ACPI, kamera, touchpad, DMI). source
diagnose_resources diagnose_resources() 13 ⚠️ Diagnostyka zasobów systemowych. source
diagnose_security diagnose_security() 4 Diagnostyka bezpieczeństwa systemu i sieci. source
diagnose_system diagnose_system() 14 ⚠️ System metrics – cross-platform: CPU, RAM, disks, processes. source
diagnose_thumbnails diagnose_thumbnails() 1 Diagnostyka podglądów plików (thumbnails) w system. source
get_full_diagnostics get_full_diagnostics(modules, progress_callback) 7 Zbiera diagnostykę z wybranych modułów. source

fixos.features source

Class Methods Description Source
SystemDetector 1 Detects system parameters. source
SystemInfo 0 Complete system information snapshot. source
AuditResult 3 Result of feature audit - what's installed, what's missing. source
FeatureAuditor 1 Compares installed packages with profile requirements. source
PackageCatalog 4 Manages the package database. source
PackageCategory 0 A category of packages (e.g., core_utils, dev_tools). source
PackageInfo 2 Information about a single package. source
FeatureInstaller 2 Safely installs packages using native package manager or other backends. source
UserProfile 4 A user profile defining what packages/features they want. source
FeatureRenderer 3 Renders audit results for terminal display. source

PackageCatalog methods:

  • load(cls, data_dir) — Load package catalog from YAML files.
  • get_package(pkg_id) — Get package by ID.
  • get_packages_by_category(category) — Get all packages in a category.
  • list_categories() — List all category IDs.

PackageInfo methods:

  • get_distro_name(distro) — Get package name for specific distro.
  • is_available_on(distro) — Check if package is available on given distro.

FeatureInstaller methods:

  • install(packages) — Install a list of packages.
  • get_rollback_commands(installed_packages) — Generate rollback commands for installed packages.

UserProfile methods:

  • load(cls, profile_name, data_dir) — Load a profile from YAML file.
  • list_available(cls, data_dir) — List available profile names.
  • resolve_packages(catalog, system_info) — Resolve all packages for this profile based on system.
  • to_dict() — Convert to dictionary.

FeatureRenderer methods:

  • render_audit(result) — Render complete audit results.
  • render_package_list(packages, title) — Render a list of packages.
  • render_system_info(system) — Render system information.

fixos.features.auditor source

Class Methods Description Source
AuditResult 3 Result of feature audit - what's installed, what's missing. source
FeatureAuditor 1 Compares installed packages with profile requirements. source

fixos.features.catalog source

Class Methods Description Source
PackageCatalog 4 Manages the package database. source
PackageCategory 0 A category of packages (e.g., core_utils, dev_tools). source
PackageInfo 2 Information about a single package. source

PackageCatalog methods:

  • load(cls, data_dir) — Load package catalog from YAML files.
  • get_package(pkg_id) — Get package by ID.
  • get_packages_by_category(category) — Get all packages in a category.
  • list_categories() — List all category IDs.

PackageInfo methods:

  • get_distro_name(distro) — Get package name for specific distro.
  • is_available_on(distro) — Check if package is available on given distro.

fixos.features.installer source

Class Methods Description Source
FeatureInstaller 2 Safely installs packages using native package manager or other backends. source

FeatureInstaller methods:

  • install(packages) — Install a list of packages.
  • get_rollback_commands(installed_packages) — Generate rollback commands for installed packages.

fixos.features.profiles source

Class Methods Description Source
UserProfile 4 A user profile defining what packages/features they want. source

UserProfile methods:

  • load(cls, profile_name, data_dir) — Load a profile from YAML file.
  • list_available(cls, data_dir) — List available profile names.
  • resolve_packages(catalog, system_info) — Resolve all packages for this profile based on system.
  • to_dict() — Convert to dictionary.

fixos.features.renderer source

Class Methods Description Source
FeatureRenderer 3 Renders audit results for terminal display. source

FeatureRenderer methods:

  • render_audit(result) — Render complete audit results.
  • render_package_list(packages, title) — Render a list of packages.
  • render_system_info(system) — Render system information.

fixos.interactive source

Class Methods Description Source
CleanupAction 0 Represents a cleanup action source
CleanupPlanner 4 Interactive cleanup planning and grouping system source
CleanupType 0 source
Priority 0 source

CleanupPlanner methods:

  • group_by_category(suggestions) — Group cleanup suggestions by category
  • prioritize_actions(grouped_actions) — Create prioritized list of all actions
  • create_cleanup_plan(suggestions) — Create comprehensive cleanup plan
  • interactive_selection(plan) — Interactive selection process (simulated for now)
Function Signature CC Description Source
main main() 1 Test the cleanup planner source

fixos.interactive.cleanup_planner source

Class Methods Description Source
CleanupAction 0 Represents a cleanup action source
CleanupPlanner 4 Interactive cleanup planning and grouping system source
CleanupType 0 source
Priority 0 source

CleanupPlanner methods:

  • group_by_category(suggestions) — Group cleanup suggestions by category
  • prioritize_actions(grouped_actions) — Create prioritized list of all actions
  • create_cleanup_plan(suggestions) — Create comprehensive cleanup plan
  • interactive_selection(plan) — Interactive selection process (simulated for now)
Function Signature CC Description Source
main main() 1 Test the cleanup planner source

fixos.llm_shell source

Function Signature CC Description Source
execute_command execute_command(cmd) 10 Wykonuje komendę systemową z potwierdzeniem użytkownika. source
format_time format_time(seconds) 1 source
run_llm_shell run_llm_shell(diagnostics_data, token, model, timeout, ...) 15 ⚠️ Uruchamia interaktywny shell LLM z przekazanymi danymi diagnostycznymi. source

fixos.orchestrator source

Class Methods Description Source
CommandExecutor 6 Bezpieczny executor komend z: source
CommandTimeoutError 0 source
DangerousCommandError 0 source
ExecutionResult 2 source
Problem 2 source
ProblemGraph 7 DAG problemów systemowych z topological sort do wyznaczania kolejności napraw. source
FixOrchestrator 4 Orkiestrator napraw systemowych. source
RollbackEntry 0 Single recorded operation with its rollback command. source
RollbackSession 5 A session of recorded operations that can be rolled back. source

CommandExecutor methods:

  • is_dangerous(command) — Sprawdza czy komenda jest potencjalnie destruktywna.
  • needs_sudo(command)
  • add_sudo(command)
  • check_idempotent(command) — Zwraca komendę sprawdzającą stan (jeśli znana), None jeśli nie dotyczy.
  • execute_sync(command, timeout, add_sudo, check_idempotent) — Synchroniczne wykonanie komendy.
  • execute(command, timeout, add_sudo) — Asynchroniczne wykonanie komendy.

Problem methods:

  • is_actionable()
  • to_summary()

ProblemGraph methods:

  • add(problem)
  • get(problem_id)
  • next_actionable() — Zwraca pierwszy problem bez nierozwiązanych zależności.
  • all_done()
  • pending_count()
  • summary()
  • render_tree() — Renderuje drzewo problemów jako tekst.

FixOrchestrator methods:

  • load_from_diagnostics(diagnostics) — Parsuje dane diagnostyczne przez LLM i buduje graf problemów.
  • load_from_dict(problems_data) — Ładuje problemy bezpośrednio z listy dict (bez LLM).
  • run_sync(confirm_fn, progress_fn) — Synchroniczna pętla napraw (dla trybu HITL).
  • run_async(confirm_fn, progress_fn) — Asynchroniczna wersja run_sync.

RollbackSession methods:

  • record(command, rollback_cmd, stdout, stderr, ...) — Zapisz wykonaną operację.
  • get_rollback_commands() — Zwraca listę (komenda, rollback) w odwróconej kolejności.
  • rollback_last(n, dry_run) — Cofnij ostatnich n operacji.
  • load(cls, session_id) — Załaduj sesję z pliku.
  • list_sessions(cls, limit) — Lista ostatnich sesji rollback.

fixos.orchestrator.executor source

Class Methods Description Source
CommandExecutor 6 Bezpieczny executor komend z: source
CommandTimeoutError 0 source
DangerousCommandError 0 source
ExecutionResult 2 source

CommandExecutor methods:

  • is_dangerous(command) — Sprawdza czy komenda jest potencjalnie destruktywna.
  • needs_sudo(command)
  • add_sudo(command)
  • check_idempotent(command) — Zwraca komendę sprawdzającą stan (jeśli znana), None jeśli nie dotyczy.
  • execute_sync(command, timeout, add_sudo, check_idempotent) — Synchroniczne wykonanie komendy.
  • execute(command, timeout, add_sudo) — Asynchroniczne wykonanie komendy.

fixos.orchestrator.graph source

Class Methods Description Source
Problem 2 source
ProblemGraph 7 DAG problemów systemowych z topological sort do wyznaczania kolejności napraw. source

Problem methods:

  • is_actionable()
  • to_summary()

ProblemGraph methods:

  • add(problem)
  • get(problem_id)
  • next_actionable() — Zwraca pierwszy problem bez nierozwiązanych zależności.
  • all_done()
  • pending_count()
  • summary()
  • render_tree() — Renderuje drzewo problemów jako tekst.

fixos.orchestrator.orchestrator source

Class Methods Description Source
FixOrchestrator 4 Orkiestrator napraw systemowych. source

FixOrchestrator methods:

  • load_from_diagnostics(diagnostics) — Parsuje dane diagnostyczne przez LLM i buduje graf problemów.
  • load_from_dict(problems_data) — Ładuje problemy bezpośrednio z listy dict (bez LLM).
  • run_sync(confirm_fn, progress_fn) — Synchroniczna pętla napraw (dla trybu HITL).
  • run_async(confirm_fn, progress_fn) — Asynchroniczna wersja run_sync.

fixos.orchestrator.rollback source

Class Methods Description Source
RollbackEntry 0 Single recorded operation with its rollback command. source
RollbackSession 5 A session of recorded operations that can be rolled back. source

RollbackSession methods:

  • record(command, rollback_cmd, stdout, stderr, ...) — Zapisz wykonaną operację.
  • get_rollback_commands() — Zwraca listę (komenda, rollback) w odwróconej kolejności.
  • rollback_last(n, dry_run) — Cofnij ostatnich n operacji.
  • load(cls, session_id) — Załaduj sesję z pliku.
  • list_sessions(cls, limit) — Lista ostatnich sesji rollback.

fixos.platform_utils source

Function Signature CC Description Source
cancel_signal_timeout cancel_signal_timeout() 2 Cancels the timeout signal (POSIX only). source
elevate_cmd elevate_cmd(cmd) 3 Adds sudo (Linux/Mac) or wraps in PowerShell -Verb RunAs (Windows). source
get_os_info get_os_info() 5 Returns basic OS information. source
get_package_manager get_package_manager() 8 Detects the system package manager. source
install_package_cmd install_package_cmd(package) 2 Returns the install command for the detected package manager. source
is_dangerous is_dangerous(cmd) 3 Returns reason string if command is dangerous, None if safe. source
needs_elevation needs_elevation(cmd) 5 Returns True if command likely needs admin/sudo. source
run_command run_command(cmd, timeout, shell) 5 Runs a command cross-platform. source
setup_signal_timeout setup_signal_timeout(seconds, handler) 2 Sets up a timeout signal. Returns True if supported (POSIX only). source

fixos.plugins source

Class Methods Description Source
DiagnosticPlugin 3 Bazowa klasa dla pluginów diagnostycznych fixOS. source
DiagnosticResult 1 Result of a diagnostic plugin run. source
Finding 0 Single finding from a diagnostic plugin. source
Severity 0 Severity level for diagnostic findings. source
Plugin 1 source
Plugin 1 source
Plugin 1 source
Plugin 1 source
Plugin 1 source
Plugin 1 source
PluginRegistry 6 Registry for diagnostic plugins with autodiscovery. source

DiagnosticPlugin methods:

  • diagnose() — Wykonaj diagnostykę i zwróć wynik.
  • can_run() — Czy plugin może działać na aktualnej platformie?
  • get_metadata()

PluginRegistry methods:

  • discover() — Odkrywanie pluginów przez builtin + entry_points.
  • register(plugin) — Ręczna rejestracja pluginu.
  • list_plugins(runnable_only) — Lista zarejestrowanych pluginów.
  • get_plugin(name) — Pobierz plugin po nazwie.
  • run(modules, progress_callback) — Uruchom diagnostykę dla wybranych (lub wszystkich) modułów.

fixos.plugins.base source

Class Methods Description Source
DiagnosticPlugin 3 Bazowa klasa dla pluginów diagnostycznych fixOS. source
DiagnosticResult 1 Result of a diagnostic plugin run. source
Finding 0 Single finding from a diagnostic plugin. source
Severity 0 Severity level for diagnostic findings. source

DiagnosticPlugin methods:

  • diagnose() — Wykonaj diagnostykę i zwróć wynik.
  • can_run() — Czy plugin może działać na aktualnej platformie?
  • get_metadata()

fixos.plugins.builtin source

Class Methods Description Source
Plugin 1 source
Plugin 1 source
Plugin 1 source
Plugin 1 source
Plugin 1 source
Plugin 1 source

fixos.plugins.builtin.audio source

Class Methods Description Source
Plugin 1 source

fixos.plugins.builtin.disk source

Class Methods Description Source
Plugin 1 source

fixos.plugins.builtin.hardware source

Class Methods Description Source
Plugin 1 source

fixos.plugins.builtin.resources source

Class Methods Description Source
Plugin 1 source

fixos.plugins.builtin.security source

Class Methods Description Source
Plugin 1 source

fixos.plugins.builtin.thumbnails source

Class Methods Description Source
Plugin 1 source

fixos.plugins.registry source

Class Methods Description Source
PluginRegistry 6 Registry for diagnostic plugins with autodiscovery. source

PluginRegistry methods:

  • discover() — Odkrywanie pluginów przez builtin + entry_points.
  • register(plugin) — Ręczna rejestracja pluginu.
  • list_plugins(runnable_only) — Lista zarejestrowanych pluginów.
  • get_plugin(name) — Pobierz plugin po nazwie.
  • run(modules, progress_callback) — Uruchom diagnostykę dla wybranych (lub wszystkich) modułów.

fixos.profiles source

Class Methods Description Source
Profile 3 Profil diagnostyczny z zestawem modułów i progów. source

Profile methods:

  • load(cls, name) — Załaduj profil — najpierw user, potem builtin.
  • list_available(cls) — Lista dostępnych profili (builtin + user).
  • to_dict()

fixos.providers source

Class Methods Description Source
LLMClient 5 Wrapper nad openai.OpenAI kompatybilny z wieloma providerami. source
LLMError 0 Błąd komunikacji z LLM. source
LLMAnalysis 0 Result of LLM analysis source
LLMAnalyzer 4 Uses LLM to analyze disk issues when heuristics aren't sufficient source
CommandValidation 0 Wynik walidacji komendy przez LLM. source
FixSuggestion 0 Pojedyncza sugestia naprawy od LLM. source
LLMDiagnosticResponse 0 Strukturalna odpowiedź LLM na dane diagnostyczne. source
NLPIntent 0 Rozpoznana intencja z polecenia NLP. source
RiskLevel 0 source

LLMClient methods:

  • chat(messages) — Wysyła wiadomości do LLM i zwraca odpowiedź jako string.
  • chat_stream(messages) — Generator streamujący tokeny odpowiedzi.
  • chat_structured(messages, response_model) — Wywołanie LLM z wymuszonym schematem JSON (Pydantic model).
  • ping() — Sprawdza czy API odpowiada (krótki test).

LLMAnalyzer methods:

  • analyze_disk_issues(disk_data) — Use LLM to analyze disk issues when heuristics are insufficient
  • analyze_failed_action(action, error) — Analyze failed cleanup action and suggest alternatives
  • analyze_complex_pattern(pattern_data) — Analyze complex disk usage patterns that heuristics can't categorize
  • enhance_heuristics_with_llm(heuristic_suggestions, disk_data) — Enhance heuristic suggestions with LLM insights
Function Signature CC Description Source
main main() 1 Test the LLM analyzer source

fixos.providers.llm source

Class Methods Description Source
LLMClient 5 Wrapper nad openai.OpenAI kompatybilny z wieloma providerami. source
LLMError 0 Błąd komunikacji z LLM. source

LLMClient methods:

  • chat(messages) — Wysyła wiadomości do LLM i zwraca odpowiedź jako string.
  • chat_stream(messages) — Generator streamujący tokeny odpowiedzi.
  • chat_structured(messages, response_model) — Wywołanie LLM z wymuszonym schematem JSON (Pydantic model).
  • ping() — Sprawdza czy API odpowiada (krótki test).

fixos.providers.llm_analyzer source

Class Methods Description Source
LLMAnalysis 0 Result of LLM analysis source
LLMAnalyzer 4 Uses LLM to analyze disk issues when heuristics aren't sufficient source

LLMAnalyzer methods:

  • analyze_disk_issues(disk_data) — Use LLM to analyze disk issues when heuristics are insufficient
  • analyze_failed_action(action, error) — Analyze failed cleanup action and suggest alternatives
  • analyze_complex_pattern(pattern_data) — Analyze complex disk usage patterns that heuristics can't categorize
  • enhance_heuristics_with_llm(heuristic_suggestions, disk_data) — Enhance heuristic suggestions with LLM insights
Function Signature CC Description Source
main main() 1 Test the LLM analyzer source

fixos.providers.schemas source

Class Methods Description Source
CommandValidation 0 Wynik walidacji komendy przez LLM. source
FixSuggestion 0 Pojedyncza sugestia naprawy od LLM. source
LLMDiagnosticResponse 0 Strukturalna odpowiedź LLM na dane diagnostyczne. source
NLPIntent 0 Rozpoznana intencja z polecenia NLP. source
RiskLevel 0 source

fixos.system_checks source

Function Signature CC Description Source
get_cpu_info get_cpu_info() 2 Metryki CPU. source
get_disk_info get_disk_info() 3 Metryki dysków dla wszystkich partycji. source
get_fedora_specific get_fedora_specific() 1 Komendy specyficzne dla system: dnf, journalctl, systemctl. source
get_full_diagnostics get_full_diagnostics() 1 Zbiera kompletne dane diagnostyczne systemu system. source
get_memory_info get_memory_info() 1 Metryki RAM i SWAP. source
get_network_info get_network_info() 4 Statystyki sieciowe (bez wrażliwych danych - anonimizacja jest osobno). source
get_top_processes get_top_processes(n) 3 Lista TOP N procesów według zużycia CPU. source
run_cmd run_cmd(cmd, timeout) 6 Uruchamia komendę shell i zwraca output. Bezpieczny fallback przy błędzie. source

fixos.utils source

Class Methods Description Source
AnonymizationReport 2 Raport anonimizacji – co zostało zmaskowane. source
SessionTimeout 0 Wyjątek rzucany po przekroczeniu limitu czasu sesji. source
SearchResult 0 source

AnonymizationReport methods:

  • add(category, count)
  • summary()
Function Signature CC Description Source
anonymize anonymize(data_str) 15 ⚠️ Anonimizuje wrażliwe dane. source
display_anonymized_preview display_anonymized_preview(data_str, report, max_lines) 5 Wyświetla użytkownikowi zanonimizowane dane przed wysłaniem do LLM. source
colorize colorize(line) 1 Return line unchanged – rich handles markup in render_md(). source
print_cmd_block print_cmd_block(cmd, comment, dry_run) 4 Print a framed command preview panel. source
print_problem_header print_problem_header(problem_id, description, severity, status, ...) 3 Print a colored problem header panel. source
print_stderr_box print_stderr_box(stderr, max_lines) 2 Print stderr in a rich Panel. source
print_stdout_box print_stdout_box(stdout, max_lines) 2 Print stdout in a rich Panel. source
render_md render_md(text) 16 ⚠️ Print LLM markdown reply to terminal via rich. source
render_tree_colored render_tree_colored(nodes, execution_order) 8 Render a ProblemGraph as a rich-markup string. source
timeout_handler timeout_handler(signum, frame) 1 Signal handler dla SIGALRM — rzuca SessionTimeout. source
format_results_for_llm format_results_for_llm(results) 3 Formatuje wyniki wyszukiwania do wklejenia w prompt LLM. source
search_all search_all(query, serpapi_key, max_per_source) 5 Przeszukuje wszystkie dostępne źródła wiedzy. source
search_arch_wiki search_arch_wiki(query, max_results) 9 Arch Wiki – doskonałe źródło dla problemów Linux (nie tylko Arch). source
search_ask_fedora search_ask_fedora(query, max_results) 4 Szuka w Linux forums przez Discourse API. source
search_ddg search_ddg(query, max_results) 8 DuckDuckGo Instant Answer API (bez klucza, ograniczone). source
search_fedora_bugzilla search_fedora_bugzilla(query, max_results) 4 Szuka w Linux Bugzilla przez REST API. source
search_github_issues search_github_issues(query, max_results) 4 GitHub Issues – linuxhardware, ALSA, PipeWire, PulseAudio repos. source
search_serpapi search_serpapi(query, api_key, max_results) 5 SerpAPI – Google/Bing search (wymaga klucza API). source

fixos.utils.anonymizer source

Class Methods Description Source
AnonymizationReport 2 Raport anonimizacji – co zostało zmaskowane. source

AnonymizationReport methods:

  • add(category, count)
  • summary()
Function Signature CC Description Source
anonymize anonymize(data_str) 15 ⚠️ Anonimizuje wrażliwe dane. source
display_anonymized_preview display_anonymized_preview(data_str, report, max_lines) 5 Wyświetla użytkownikowi zanonimizowane dane przed wysłaniem do LLM. source

fixos.utils.terminal source

Function Signature CC Description Source
colorize colorize(line) 1 Return line unchanged – rich handles markup in render_md(). source
print_cmd_block print_cmd_block(cmd, comment, dry_run) 4 Print a framed command preview panel. source
print_problem_header print_problem_header(problem_id, description, severity, status, ...) 3 Print a colored problem header panel. source
print_stderr_box print_stderr_box(stderr, max_lines) 2 Print stderr in a rich Panel. source
print_stdout_box print_stdout_box(stdout, max_lines) 2 Print stdout in a rich Panel. source
render_md render_md(text) 16 ⚠️ Print LLM markdown reply to terminal via rich. source
render_tree_colored render_tree_colored(nodes, execution_order) 8 Render a ProblemGraph as a rich-markup string. source

fixos.utils.timeout source

Class Methods Description Source
SessionTimeout 0 Wyjątek rzucany po przekroczeniu limitu czasu sesji. source
Function Signature CC Description Source
timeout_handler timeout_handler(signum, frame) 1 Signal handler dla SIGALRM — rzuca SessionTimeout. source

fixos.utils.web_search source

Class Methods Description Source
SearchResult 0 source
Function Signature CC Description Source
format_results_for_llm format_results_for_llm(results) 3 Formatuje wyniki wyszukiwania do wklejenia w prompt LLM. source
search_all search_all(query, serpapi_key, max_per_source) 5 Przeszukuje wszystkie dostępne źródła wiedzy. source
search_arch_wiki search_arch_wiki(query, max_results) 9 Arch Wiki – doskonałe źródło dla problemów Linux (nie tylko Arch). source
search_ask_fedora search_ask_fedora(query, max_results) 4 Szuka w Linux forums przez Discourse API. source
search_ddg search_ddg(query, max_results) 8 DuckDuckGo Instant Answer API (bez klucza, ograniczone). source
search_fedora_bugzilla search_fedora_bugzilla(query, max_results) 4 Szuka w Linux Bugzilla przez REST API. source
search_github_issues search_github_issues(query, max_results) 4 GitHub Issues – linuxhardware, ALSA, PipeWire, PulseAudio repos. source
search_serpapi search_serpapi(query, api_key, max_results) 5 SerpAPI – Google/Bing search (wymaga klucza API). source

fixos.watch source

Class Methods Description Source
WatchDaemon 2 Daemon wykonujący cykliczną diagnostykę z powiadomieniami. source

WatchDaemon methods:

  • run() — Główna pętla monitorowania.
  • stop() — Zatrzymaj daemon.