It would be cool if maybe MADR was also built in and selectable via a flag/env variable as the default, as well as pointing to a custom template. I have some basic ideas around this, but there are probably some cases that are trickier than I think they'll be (for example, supporting nested files/directories).
I'm hoping to deprecate this in favor of something like an environment variable such as ADRS_DIRECTORY, but in the meantime, I see a bug where reading the string read from the file doesn't get the newline trimmed, and hence adrs doesn't think the directory exists. This definitely happens in the new command, so the short term fix is to trim whatever is read. This file gets read enough that the call should get abstracted out into adrs.rs at the very least.
I'd like to keep the README and in-app docs simple. There should be a more complete documentation site deployed to GitHub pages with some basic information about the tool and ADRs, and documentation and examples for all of the commands.
adr-tools creates the .adr-dir file on init and then uses that for subsequent runs to decide where to put/get ADRs. This works fine, and I've reproduced this behavior in adrs, but I think it would be cleaner to use a global flag tied to an environment variable, as well as just use the docs/adr as a default everywhere.
The flow would be something like this:
If no .adr-dir exists, and no docs/adr exists, default to docs/adr without writing a .adr-dir file
If the global --directory flag is set for any command, use that value for all operations, even if a .adr-dir exists.
If the ADR_DIRECTORY environment variable is set, use that value for all operations even if a .adr-dir exists.
If no .adr-dir exists but the docs/adr directory does exist, use the docs/adr directory.
I think this covers most potential situations while maintaining backwards compatibility and keeping sane defaults.
Steps off the top of my head:
Add the directory flag in main.rs as a global flag, with the env marker to also pull it from the environment.
Process the flag before calling the subcommand, and pass the directory value to any subcommand as a Path (or maybe PathBuf?).
Change anything that uses .adr-dir now to always use that value.