Skip to content

Commit 1d4262f

Browse files
feat: add zsh, AI CLIs, CNB UI settings & assets
Increase CNB runner CPUs and add CNB UI settings and assets (.cnb/settings.yml, laugh/bug images). Update Dockerfile to install zsh, Oh My Zsh + plugins, initialize conda for zsh, install AI coding CLIs (@anthropic-ai/claude-code, @google/gemini-cli, @openai/codex), populate /root/.zshrc with environment configs, set zsh as the default shell and change container CMD to /bin/zsh. Minor README tweaks to specify code block languages.
1 parent d464b78 commit 1d4262f

File tree

7 files changed

+73
-6
lines changed

7 files changed

+73
-6
lines changed

.cnb.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
$:
33
vscode:
44
- runner:
5-
cpus: 16
5+
cpus: 32
66
docker:
77
image:
88
name: docker.cnb.cool/pleasure1234/my-env:latest

.cnb/bug.png

57 KB
Loading

.cnb/laugh.gif

43.3 KB
Loading

.cnb/laugh.png

11.1 KB
Loading

.cnb/settings.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# .cnb/settings.yml
2+
3+
workspace:
4+
launch:
5+
button:
6+
name: Coding Time ~o( =∩ω∩= )m
7+
description: 开始开发喵 Ciallo ~(∠・ω< )⌒★
8+
hoverImage: .cnb/laugh.png
9+
disabled: false
10+
autoOpenWebIDE: false
11+
12+
fork:
13+
button:
14+
description: 这么烂的代码都要搬? (=^_^=)
15+
hoverImage: .cnb/laugh.gif
16+
17+
reaction:
18+
bug:
19+
image: .cnb/bug.png

Dockerfile

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y \
2424
unzip \
2525
net-tools \
2626
openssh-server \
27+
zsh \
2728
libbz2-dev \
2829
libreadline-dev \
2930
libsqlite3-dev \
@@ -53,6 +54,12 @@ RUN . "$NVM_DIR/nvm.sh" \
5354
&& corepack prepare yarn@stable --activate \
5455
&& npm install -g bun
5556

57+
# 安装常用 AI Coding CLI 工具
58+
RUN . "$NVM_DIR/nvm.sh" \
59+
&& npm install -g @anthropic-ai/claude-code \
60+
&& npm install -g @google/gemini-cli \
61+
&& npm install -g @openai/codex
62+
5663
# 安装 pyenv
5764
ENV PYENV_ROOT=/root/.pyenv
5865
ENV PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
@@ -65,7 +72,8 @@ ENV CONDA_DIR=/opt/conda
6572
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh \
6673
&& bash /tmp/miniconda.sh -b -p $CONDA_DIR \
6774
&& rm /tmp/miniconda.sh \
68-
&& $CONDA_DIR/bin/conda init bash
75+
&& $CONDA_DIR/bin/conda init bash \
76+
&& $CONDA_DIR/bin/conda init zsh
6977

7078
ENV PATH=$CONDA_DIR/bin:$PATH
7179

@@ -155,6 +163,46 @@ RUN echo '' >> /root/.bashrc \
155163
&& echo 'export GOPATH="/root/go"' >> /root/.bashrc \
156164
&& echo 'export PATH="/usr/local/go/bin:$GOPATH/bin:$PATH"' >> /root/.bashrc
157165

166+
# 安装 oh-my-zsh 及插件
167+
ENV ZSH=/root/.oh-my-zsh
168+
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended \
169+
&& git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH}/custom/plugins/zsh-autosuggestions \
170+
&& git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH}/custom/plugins/zsh-syntax-highlighting \
171+
&& sed -i 's/^plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting)/' /root/.zshrc
172+
173+
# 将环境变量写入 .zshrc
174+
RUN echo '' >> /root/.zshrc \
175+
&& echo '# NVM configuration' >> /root/.zshrc \
176+
&& echo 'export NVM_DIR="/root/.nvm"' >> /root/.zshrc \
177+
&& echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> /root/.zshrc \
178+
&& echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"' >> /root/.zshrc \
179+
&& echo '' >> /root/.zshrc \
180+
&& echo '# Pyenv configuration' >> /root/.zshrc \
181+
&& echo 'export PYENV_ROOT="/root/.pyenv"' >> /root/.zshrc \
182+
&& echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> /root/.zshrc \
183+
&& echo 'eval "$(pyenv init -)"' >> /root/.zshrc \
184+
&& echo '' >> /root/.zshrc \
185+
&& echo '# Conda configuration' >> /root/.zshrc \
186+
&& echo 'export CONDA_DIR="/opt/conda"' >> /root/.zshrc \
187+
&& echo 'export PATH="$CONDA_DIR/bin:$PATH"' >> /root/.zshrc \
188+
&& echo '' >> /root/.zshrc \
189+
&& echo '# SDKMAN configuration' >> /root/.zshrc \
190+
&& echo 'export SDKMAN_DIR="/root/.sdkman"' >> /root/.zshrc \
191+
&& echo '[ -s "$SDKMAN_DIR/bin/sdkman-init.sh" ] && source "$SDKMAN_DIR/bin/sdkman-init.sh"' >> /root/.zshrc \
192+
&& echo 'export JAVA_HOME="$SDKMAN_DIR/candidates/java/current"' >> /root/.zshrc \
193+
&& echo 'export PATH="$JAVA_HOME/bin:$PATH"' >> /root/.zshrc \
194+
&& echo '' >> /root/.zshrc \
195+
&& echo '# Maven configuration' >> /root/.zshrc \
196+
&& echo 'export MAVEN_HOME="/opt/maven"' >> /root/.zshrc \
197+
&& echo 'export PATH="$MAVEN_HOME/bin:$PATH"' >> /root/.zshrc \
198+
&& echo '' >> /root/.zshrc \
199+
&& echo '# Go configuration' >> /root/.zshrc \
200+
&& echo 'export GOPATH="/root/go"' >> /root/.zshrc \
201+
&& echo 'export PATH="/usr/local/go/bin:$GOPATH/bin:$PATH"' >> /root/.zshrc
202+
203+
# 设置 zsh 为默认 shell
204+
RUN chsh -s $(which zsh)
205+
158206
# 显示版本信息
159207
RUN echo "=== Environment Setup Complete ===" \
160208
&& neofetch \
@@ -172,4 +220,4 @@ RUN echo "=== Environment Setup Complete ===" \
172220

173221
WORKDIR /workspace
174222

175-
CMD ["/bin/bash"]
223+
CMD ["/bin/zsh"]

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ p.s. vercel does not support docker useage
1212

1313
## github codespace useage
1414

15-
```
16-
# .devcontainer/devcontainer.json
15+
```json
16+
// .devcontainer/devcontainer.json
1717
{
1818
"image": "ghcr.io/pleasurecruise/my-env:latest",
1919
"features": {}
@@ -22,7 +22,7 @@ p.s. vercel does not support docker useage
2222

2323
## cloud native build useage
2424

25-
```
25+
```yaml
2626
# .cnb.yml
2727
$:
2828
vscode:

0 commit comments

Comments
 (0)