mirror of
https://github.com/wirenboard/agent-vm.git
synced 2026-07-09 16:00:54 +00:00
Auto-accept project trust in VM Claude config
This commit is contained in:
parent
e584cf8da9
commit
e8f48bc237
1 changed files with 12 additions and 3 deletions
15
claude-vm.sh
15
claude-vm.sh
|
|
@ -255,9 +255,11 @@ _claude_vm_setup_session_persistence() {
|
|||
|
||||
_claude_vm_ensure_onboarding_config() {
|
||||
local vm_name="$1"
|
||||
local host_dir="$2"
|
||||
limactl shell "$vm_name" bash -c '
|
||||
CONFIG="$HOME/.claude.json"
|
||||
SETTINGS="$HOME/.claude/settings.json"
|
||||
PROJECT_PATH="'"$host_dir"'"
|
||||
|
||||
mkdir -p "$HOME/.claude"
|
||||
|
||||
|
|
@ -272,7 +274,14 @@ _claude_vm_ensure_onboarding_config() {
|
|||
echo "{}" > "$CONFIG"
|
||||
fi
|
||||
|
||||
jq ".hasCompletedOnboarding = true | .lastOnboardingVersion = (.lastOnboardingVersion // \"vm\")" \
|
||||
jq --arg project_path "$PROJECT_PATH" \
|
||||
".hasCompletedOnboarding = true
|
||||
| .lastOnboardingVersion = (.lastOnboardingVersion // \"vm\")
|
||||
| .effortCalloutDismissed = true
|
||||
| .projects = (.projects // {})
|
||||
| .projects[
|
||||
\$project_path
|
||||
] = ((.projects[\$project_path] // {}) + {hasTrustDialogAccepted: true})" \
|
||||
"$CONFIG" > "$CONFIG.tmp" && mv "$CONFIG.tmp" "$CONFIG"
|
||||
'
|
||||
}
|
||||
|
|
@ -543,7 +552,7 @@ claude-vm() {
|
|||
|
||||
_claude_vm_write_dummy_credentials "$vm_name"
|
||||
_claude_vm_setup_session_persistence "$vm_name" "$host_dir"
|
||||
_claude_vm_ensure_onboarding_config "$vm_name"
|
||||
_claude_vm_ensure_onboarding_config "$vm_name" "$host_dir"
|
||||
|
||||
if $use_github && [ -n "$_claude_vm_github_mcp_port" ]; then
|
||||
_claude_vm_inject_github_mcp "$vm_name" "$_claude_vm_github_mcp_port"
|
||||
|
|
@ -632,7 +641,7 @@ claude-vm-shell() {
|
|||
|
||||
_claude_vm_write_dummy_credentials "$vm_name"
|
||||
_claude_vm_setup_session_persistence "$vm_name" "$host_dir"
|
||||
_claude_vm_ensure_onboarding_config "$vm_name"
|
||||
_claude_vm_ensure_onboarding_config "$vm_name" "$host_dir"
|
||||
|
||||
if $use_github && [ -n "$_claude_vm_github_mcp_port" ]; then
|
||||
_claude_vm_inject_github_mcp "$vm_name" "$_claude_vm_github_mcp_port"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue