Skip to content

ADR adr008 editor integration with multiple input m Editor integration with multiple input modes

Robert Allen edited this page Dec 16, 2025 · 10 revisions

Editor integration with multiple input modes

Property Value
ID adr008-editor-integration-with-multiple-input-m
Status accepted
Date 2025-12-15
Tags git-adr-cli

Editor integration with multiple input modes

Date: 2025-12-15 Status: Accepted Deciders: User

Context

Users need flexibility in how they provide ADR content:

  • Interactive editing (terminal or GUI editors)
  • Scripted/automated creation
  • Pre-written content from files

Decision

Support multiple input modes for git adr new:

  1. Editor mode (default): Opens configured editor

    • Fallback chain: $EDITOR$VISUALvimnanovi
    • Auto-detects GUI editors and adds --wait flag (VS Code, Sublime, Atom)
  2. File input: git adr new "Title" --file path/to/content.md

  3. Stdin input: cat file.md | git adr new "Title"

  4. Preview mode: git adr new "Title" --preview (shows template without creating)

Consequences

Positive:

  • Works with any editor (terminal or GUI)
  • Enables scripting and automation
  • No editor lock-in
  • Template preview helps users understand formats

Negative:

  • More complex input handling logic
  • Must detect stdin vs interactive mode

Synced from git-adr on 2025-12-16 19:04 UTC

Clone this wiki locally