yadm-enter
Enter a managed directory
TLDR
Run a sub-shell with all Git variables set
Exit the sub-shell
SYNOPSIS
yadm [yadm-options] enter [--] [command [arg ...]]
PARAMETERS
yadm-options
Optional global yadm options that affect the execution, such as --repo <path>
to specify an alternate yadm repository, or --config-file <path>
for an alternate configuration file. These options must precede the 'enter' subcommand.
--
A standard convention used to signify the end of command options and the beginning of positional arguments. This is useful if the command itself starts with a hyphen.
command
The command to be executed within the yadm repository's context. If no command is specified, yadm-enter will drop into an interactive shell (e.g., bash or sh) inside the repository.
arg ...
Arguments to be passed to the command being executed.
DESCRIPTION
yadm-enter is a powerful subcommand of yadm (Yet Another Dotfiles Manager) designed to execute a command or an interactive shell directly within the context of the currently managed yadm repository. This means that the specified command will run as if your current working directory was the internal Git repository that yadm uses to store your dotfiles (typically located at ~/.yadm/repo.d).
This functionality is crucial for advanced users who need to interact directly with yadm's underlying Git repository without manually navigating to it. It allows for operations like inspecting Git history of your dotfiles, performing complex Git manipulations, or running scripts that rely on being executed within the dotfiles repository. By providing this isolated environment, yadm-enter ensures that any Git commands or other operations are applied to your yadm-managed dotfiles, preventing accidental modifications to other Git repositories you might be working with.
CAVEATS
Commands executed via yadm-enter operate on the internal yadm Git repository (typically ~/.yadm/repo.d), not necessarily on any other Git repository you might be in at the time of execution. Be mindful of this context shift to avoid unintended operations on unrelated repositories. When no command is provided, an interactive subshell is spawned, and you must explicitly exit
it to return to your original shell environment.
USAGE EXAMPLES
To inspect the Git status of your dotfiles:
yadm enter git status
To view the Git log of your dotfiles repository:
yadm enter git log --oneline
To enter an interactive shell within the yadm repository context:
yadm enter
To run a custom script located within your yadm-managed dotfiles:
yadm enter bash ./my_dotfiles_script.sh
HISTORY
The enter subcommand has been a fundamental part of yadm since its early development. It serves as a crucial utility for direct interaction with yadm's underlying Git repository, reflecting yadm's design philosophy of being a thin wrapper around Git. Its functionality has remained consistent, primarily facilitating advanced Git operations or debugging within the dotfiles management context.