Skip to content

Fix git auth fallback for non-interactive environments #10

@patmakesapps

Description

@patmakesapps

Problem

The _run_git_interactive fallback for auth requires an interactive terminal. In non-interactive contexts (headless Raspberry Pi, systemd service, Docker), this can hang indefinitely.

Proposed solution

  • Detect whether the environment is interactive before attempting interactive git auth.
  • Provide a non-interactive fallback with a clear error message.
  • Support token-based auth as an alternative.

Implementation notes

  • Check sys.stdin.isatty() before calling _run_git_interactive.
  • Support GIT_TOKEN or GITHUB_TOKEN env vars for non-interactive auth.
  • Add a configurable timeout to prevent indefinite hangs.

Acceptance criteria

  • Git operations in non-interactive environments fail gracefully instead of hanging.
  • Clear error message explains how to configure auth for headless use.
  • Token-based auth works when the env var is set.
  • Interactive auth still works when a TTY is available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions