Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Reusable Dev Containers for any project — without modifying the repository.

---

![](assets/demo.gif "Demo gif")
![](assets/demo.png "Demo gif")

`devcode` is a CLI that opens any project in VS Code Dev Containers using reusable, local templates.

Expand Down
Binary file added assets/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions demo/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.fonts
.agg
demo.cast
demo.png
demo.sc
59 changes: 8 additions & 51 deletions demo/Makefile
Original file line number Diff line number Diff line change
@@ -1,56 +1,13 @@
CAST := demo.cast
GIF := demo.gif
AGG := .agg
FONTS_DIR := .fonts
# Requires: uv (https://docs.astral.sh/uv/)
PNG := demo.png

# Detect platform for agg binary
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m)
.PHONY: all clean

ifeq ($(UNAME_S),Linux)
ifeq ($(UNAME_M),x86_64)
AGG_ASSET := agg-x86_64-unknown-linux-gnu
else ifeq ($(UNAME_M),aarch64)
AGG_ASSET := agg-aarch64-unknown-linux-gnu
else
$(error Unsupported Linux architecture: $(UNAME_M))
endif
else ifeq ($(UNAME_S),Darwin)
ifeq ($(UNAME_M),arm64)
AGG_ASSET := agg-aarch64-apple-darwin
else
AGG_ASSET := agg-x86_64-apple-darwin
endif
else
$(error Unsupported OS: $(UNAME_S))
endif
all: $(PNG)

AGG_URL := https://github.com/asciinema/agg/releases/latest/download/$(AGG_ASSET)
FONT_URL := https://github.com/JetBrains/JetBrainsMono/releases/download/v2.304/JetBrainsMono-2.304.zip

.PHONY: all gif cast clean

all: gif

gif: $(GIF)

$(GIF): $(CAST) $(AGG) $(FONTS_DIR)
./$(AGG) --font-dir $(FONTS_DIR) --renderer fontdue --font-family "JetBrains Mono" --rows 20 --cols 80 $(CAST) $(GIF)

$(CAST): demo.yaml generate.py
uv run python generate.py

$(AGG):
curl -fsSL -o $(AGG) $(AGG_URL)
chmod +x $(AGG)

$(FONTS_DIR):
mkdir -p $(FONTS_DIR)
curl -fsSL -o $(FONTS_DIR)/JetBrainsMono.zip $(FONT_URL)
unzip -q -o $(FONTS_DIR)/JetBrainsMono.zip "fonts/ttf/*.ttf" -d $(FONTS_DIR)
mv $(FONTS_DIR)/fonts/ttf/*.ttf $(FONTS_DIR)/
rm -rf $(FONTS_DIR)/fonts $(FONTS_DIR)/JetBrainsMono.zip
$(PNG): demo.sh
command -v agg >/dev/null 2>&1 || uvx scriptcast install
uvx scriptcast --output-dir . demo.sh

clean:
rm -f $(GIF) $(CAST) $(AGG)
rm -rf $(FONTS_DIR)
rm -f $(PNG)
Binary file removed demo/demo.gif
Binary file not shown.
81 changes: 81 additions & 0 deletions demo/demo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/usr/bin/env bash
# shellcheck disable=SC2034 # SC variables are consumed by the scriptcast tracer
: SC helpers
: SC set width 80
: SC set height 14
: SC set type_speed 60
: SC set cmd_wait 800
: SC set exit_wait 800
: SC set input_wait 300


# ---------------------------------------------------------------------------
# Scene 1: Open a project
# ---------------------------------------------------------------------------
: SC scene "Open a project"

: SC \\ ${YELLOW}Create a new template${RESET}
: SC mock devcode new dev <<'EOF'
Created template 'dev' at ~/.local/share/dev-code/templates/dev
EOF

: SC \\ ${YELLOW}Open a project in VS Code using the template${RESET}
: SC mock devcode open dev ~/projects/my-app <<EOF
${GREEN} Opening ~/projects/my-app in VS Code...${RESET}
EOF

# ---------------------------------------------------------------------------
# Scene 2: Manage templates
# ---------------------------------------------------------------------------
: SC scene "Manage templates"

: SC \\ ${YELLOW}List existing templates${RESET}
: SC mock devcode list <<'EOF'
dev
EOF

: SC \\ ${YELLOW}Create another template${RESET}
: SC mock devcode new demo <<'EOF'
Created template 'demo' at ~/.local/share/dev-code/templates/demo
EOF

: SC \\ ${YELLOW}List templates again to confirm${RESET}
: SC mock devcode list <<'EOF'
dev
demo
EOF

: SC \\ ${YELLOW}Edit the template in VS Code${RESET}
: SC mock devcode edit demo <<EOF
${GREEN} Opening 'demo' template in VS Code...${RESET}
EOF

# ---------------------------------------------------------------------------
# Scene 3: Container status
# ---------------------------------------------------------------------------
: SC scene "Container status"

: SC \\ ${YELLOW}Show running containers${RESET}
: SC mock devcode ps <<'EOF'
# CONTAINER ID TEMPLATE PROJECT PATH STATUS
1 a1b9afa16218 dev ~/projects/my-app Up 3 min
EOF

: SC \\ ${YELLOW}Show all containers including stopped ones${RESET}
: SC mock devcode ps -a <<'EOF'
# CONTAINER ID TEMPLATE PROJECT PATH STATUS
1 a1b2c3d4e5f6 claude ~/projects/mk3serve Exited (0) 2 weeks ago
2 9f8e7d6c5b4a py-dev ~/projects/py-app Exited (0) 1 hours ago
3 a1b9afa16218 dev ~/projects/my-app Up 3 min
EOF

: SC \\ ${YELLOW}Interactively pick a container to reopen${RESET}
: SC mock devcode ps -a -i <<EOF
# CONTAINER ID TEMPLATE PROJECT PATH STATUS
1 a1b2c3d4e5f6 claude ~/projects/mk3serve Exited (0) 2 weeks ago
2 9f8e7d6c5b4a py-dev ~/projects/py-app Exited (0) 1 hours ago
3 a1b9afa16218 dev ~/projects/my-app Up 3 min

Open [1-3]: 2
${GREEN} Opening '~/projects/py-app' container in VS Code...${RESET}
EOF
74 changes: 0 additions & 74 deletions demo/demo.yaml

This file was deleted.

Loading
Loading