Skip to content

Commit 31ffca2

Browse files
committed
Merge remote-tracking branch 'origin/main' into dm/add-sync
# Conflicts: # install.sh
2 parents 30a3b0a + d05cd49 commit 31ffca2

3 files changed

Lines changed: 37 additions & 0 deletions

File tree

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Default owners for everything in the repo
2+
* @dguido @computerality @DarkaMaul @disconnect3d

install.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Commands:
3838
upgrade Upgrade Claude Code to latest version
3939
mount <host> <cont> Add a mount to the devcontainer (recreates container)
4040
sync [project] Sync Claude Code sessions from devcontainers to host
41+
cp <cont> <host> Copy files/directories from container to host
4142
help Show this help message
4243
4344
Examples:
@@ -52,6 +53,7 @@ Examples:
5253
devc mount ~/data /data # Add mount to container
5354
devc sync # Sync sessions from all devcontainers
5455
devc sync crypto # Sync only matching devcontainer
56+
devc cp /some/file ./out # Copy a path from container to host
5557
EOF
5658
}
5759

@@ -532,6 +534,33 @@ sync_one_container() {
532534
echo " Total: ${total_copied} file(s) synced."
533535
}
534536

537+
cmd_cp() {
538+
local container_path="${1:-}"
539+
local host_path="${2:-}"
540+
541+
if [[ -z "$container_path" ]] || [[ -z "$host_path" ]]; then
542+
log_error "Usage: devc cp <container_path> <host_path>"
543+
exit 1
544+
fi
545+
546+
local workspace_folder
547+
workspace_folder="$(get_workspace_folder)"
548+
549+
# Find the running container
550+
local label="devcontainer.local_folder=$workspace_folder"
551+
local container_id
552+
container_id=$(docker ps -q --filter "label=$label" 2>/dev/null || true)
553+
554+
if [[ -z "$container_id" ]]; then
555+
log_error "No running devcontainer found for $workspace_folder"
556+
exit 1
557+
fi
558+
559+
log_info "Copying $container_path$host_path"
560+
docker cp "$container_id:$container_path" "$host_path"
561+
log_success "Copied $container_path$host_path"
562+
}
563+
535564
cmd_self_install() {
536565
local install_dir="$HOME/.local/bin"
537566
local install_path="$install_dir/devc"
@@ -622,6 +651,9 @@ main() {
622651
sync)
623652
cmd_sync "$@"
624653
;;
654+
cp)
655+
cmd_cp "$@"
656+
;;
625657
self-install)
626658
cmd_self_install
627659
;;

post_install.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ def setup_global_gitignore():
199199
200200
[diff]
201201
colorMoved = default
202+
203+
[gpg "ssh"]
204+
program = /usr/bin/ssh-keygen
202205
"""
203206
local_gitconfig.write_text(local_config, encoding="utf-8")
204207
print(f"[post_install] Local git config created: {local_gitconfig}", file=sys.stderr)

0 commit comments

Comments
 (0)