Skip to content

feat(claude-code): add yoloAlias option#19

Merged
tmaier merged 6 commits into
mainfrom
feature/yolo-alias
Apr 22, 2026
Merged

feat(claude-code): add yoloAlias option#19
tmaier merged 6 commits into
mainfrom
feature/yolo-alias

Conversation

@tmaier
Copy link
Copy Markdown
Owner

@tmaier tmaier commented Apr 21, 2026

Summary

  • Adds a yoloAlias boolean option (default: false) to the claude-code feature
  • When enabled, creates a yolo alias that expands to claude --allow-dangerously-skip-permissions
  • Configures the alias for bash (.bashrc), zsh (.zshrc), and fish (function file at ~/.config/fish/functions/yolo.fish)

Test plan

  • devcontainer features validate ./src passes
  • New claude_code_yolo_alias scenario tests pass
  • Existing claude-code scenarios remain green

Add a boolean option that creates a 'yolo' shell alias mapping to
'claude --allow-dangerously-skip-permissions' in bash, zsh, and fish.
Copilot AI review requested due to automatic review settings April 21, 2026 23:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an opt-in yoloAlias configuration to the claude-code devcontainer feature to create a yolo shortcut for running Claude with permissions skipped, plus a new test scenario to validate the setup.

Changes:

  • Introduces yoloAlias (default false) to the claude-code feature options.
  • Updates installation logic to configure yolo for bash/zsh and a fish function file when enabled.
  • Adds a new scenario + test script to validate alias/function creation.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/claude-code/scenarios.json Adds a new claude_code_yolo_alias test scenario enabling yoloAlias.
test/claude-code/claude_code_yolo_alias.sh New scenario test script for verifying alias/function presence.
src/claude-code/install.sh Implements shell alias/function creation when YOLOALIAS=true.
src/claude-code/devcontainer-feature.json Adds the new yoloAlias boolean option to the feature schema.
src/claude-code/NOTES.md Documents the new YOLO alias behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/claude-code/install.sh Outdated
Comment thread src/claude-code/NOTES.md
Comment thread test/claude-code/claude_code_yolo_alias.sh Outdated
Make alias appending idempotent with grep guard, add security warning
to docs, and strengthen test assertions to verify full command string.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an optional “YOLO” convenience command to the claude-code devcontainer feature, allowing users to opt-in to a yolo shortcut for running Claude Code with permissions checks skipped.

Changes:

  • Adds a yoloAlias boolean feature option (default false) and documents it.
  • Updates the feature installer to configure yolo for bash/zsh and a fish function file.
  • Adds a new scenario + test script to validate the alias/function is created.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/claude-code/scenarios.json Adds a new claude_code_yolo_alias test scenario enabling yoloAlias.
test/claude-code/claude_code_yolo_alias.sh New scenario test that asserts the alias/function is present in bash/zsh/fish configs.
src/claude-code/install.sh Implements yoloAlias behavior by appending aliases to rc files and creating a fish function.
src/claude-code/devcontainer-feature.json Introduces the new yoloAlias option in the feature metadata.
src/claude-code/NOTES.md Documents the yoloAlias option and its security implications.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/claude-code/install.sh
Comment thread src/claude-code/install.sh
Comment thread src/claude-code/NOTES.md Outdated
Skip writing yolo.fish if it already exists to match bash/zsh behavior.
Chown only the specific file instead of the entire functions directory.
Update docs to reflect the skip-if-exists behavior.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an opt-in yoloAlias option to the claude-code devcontainer feature to install a yolo shortcut for running Claude Code with --allow-dangerously-skip-permissions, with shell-specific setup and new scenario coverage.

Changes:

  • Introduces yoloAlias (default false) to the feature options.
  • Updates the installer to add yolo for bash/zsh and a fish function file when enabled.
  • Adds a new test scenario and scenario script to validate alias/function installation.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/claude-code/scenarios.json Adds a new claude_code_yolo_alias scenario enabling yoloAlias.
test/claude-code/claude_code_yolo_alias.sh Adds checks for yolo being written to bash/zsh config and fish function.
src/claude-code/install.sh Implements YOLOALIAS-gated alias/function creation and ownership adjustments.
src/claude-code/devcontainer-feature.json Declares the new yoloAlias option.
src/claude-code/NOTES.md Documents yoloAlias behavior and warns about safety implications.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +62 to +74
add_shell_alias_if_missing() {
local rc_file="$1"
local alias_name="$2"
local alias_cmd="$3"

if [ -f "$rc_file" ] && grep -Eq "^[[:space:]]*alias[[:space:]]+${alias_name}=" "$rc_file"; then
echo "Skipping $rc_file: alias '$alias_name' already exists."
return 0
fi

touch "$rc_file"
printf '%s\n' "$alias_cmd" >> "$rc_file"
}
"claude-code": {
"yoloAlias": true
}
}
Update NOTES.md to accurately describe which existing definitions are
detected. Add test scenario combining yoloAlias with remoteUser to
verify file ownership for non-root users.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an opt-in yoloAlias feature option for the claude-code devcontainer feature to create a yolo shortcut that runs Claude Code with --allow-dangerously-skip-permissions, and validates it via new feature scenario tests.

Changes:

  • Introduces a yoloAlias boolean option in devcontainer-feature.json and documents it (including safety warning) in NOTES.md.
  • Updates the installer to append a yolo alias to .bashrc/.zshrc and create a fish function at ~/.config/fish/functions/yolo.fish when enabled.
  • Adds new test scenarios and scripts to verify alias/function creation, including a non-root remoteUser scenario.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/claude-code/scenarios.json Adds new test scenarios for yoloAlias (default + custom user).
test/claude-code/claude_code_yolo_alias.sh New scenario test validating alias/function presence.
test/claude-code/claude_code_yolo_alias_with_custom_user.sh New scenario test validating alias/function presence and ownership under non-root user.
src/claude-code/install.sh Implements alias/function creation logic when YOLOALIAS=true.
src/claude-code/devcontainer-feature.json Adds the yoloAlias option definition.
src/claude-code/NOTES.md Documents the option and its security implications.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return 0
fi

touch "$rc_file"
Comment thread src/claude-code/install.sh Outdated
# Fix ownership if installing for non-root user
if [ -n "$_REMOTE_USER" ] && [ "$_REMOTE_USER" != "root" ]; then
chown "$_REMOTE_USER" "$TARGET_HOME/.bashrc" "$TARGET_HOME/.zshrc"
chown "$_REMOTE_USER" "$FISH_FUNC_FILE"
check "yolo alias in zshrc" bash -c "grep -Fq 'claude --allow-dangerously-skip-permissions' ~/.zshrc"
check "fish yolo function body" bash -c "test -f ~/.config/fish/functions/yolo.fish && grep -Fq 'claude --allow-dangerously-skip-permissions' ~/.config/fish/functions/yolo.fish"
check "bashrc owned by current user" bash -c "test \"$(stat -c '%U' ~/.bashrc)\" = \"$(whoami)\""
check "zshrc owned by current user" bash -c "test \"$(stat -c '%U' ~/.zshrc)\" = \"$(whoami)\""
tmaier added 2 commits April 22, 2026 23:13
…wnership

Ensure rc files end with a newline before appending alias to prevent
concatenation onto the previous line. Chown fish config directories
individually so non-root users can manage their fish config.
@tmaier tmaier merged commit ff3fbb2 into main Apr 22, 2026
55 checks passed
@tmaier tmaier deleted the feature/yolo-alias branch April 22, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants