@zookanalytics/agent-env 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/agent-env.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
FROM node:22-bookworm-slim
|
|
2
|
+
|
|
3
|
+
# Install system dependencies
|
|
4
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
5
|
+
tmux \
|
|
6
|
+
zsh \
|
|
7
|
+
git \
|
|
8
|
+
gnupg \
|
|
9
|
+
openssh-client \
|
|
10
|
+
curl \
|
|
11
|
+
sudo \
|
|
12
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
13
|
+
|
|
14
|
+
# Install Claude Code CLI globally
|
|
15
|
+
RUN npm install -g @anthropic-ai/claude-code@2.1.29
|
|
16
|
+
|
|
17
|
+
# Configure non-root user with sudo access
|
|
18
|
+
RUN echo "node ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/node \
|
|
19
|
+
&& chmod 0440 /etc/sudoers.d/node
|
|
20
|
+
|
|
21
|
+
# Switch to non-root user
|
|
22
|
+
USER node
|
|
23
|
+
|
|
24
|
+
# Set zsh as default shell
|
|
25
|
+
RUN sudo chsh -s /usr/bin/zsh node
|
|
26
|
+
|
|
27
|
+
WORKDIR /workspace
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"build": {
|
|
3
|
+
"dockerfile": "Dockerfile",
|
|
4
|
+
"context": "."
|
|
5
|
+
},
|
|
6
|
+
"remoteUser": "node",
|
|
7
|
+
"containerUser": "node",
|
|
8
|
+
"initializeCommand": "bash .devcontainer/init-host.sh",
|
|
9
|
+
"mounts": [
|
|
10
|
+
"source=${localEnv:HOME}/.claude,target=/home/node/.claude,type=bind,readonly"
|
|
11
|
+
],
|
|
12
|
+
"features": {
|
|
13
|
+
"ghcr.io/devcontainers/features/git:1": {},
|
|
14
|
+
"ghcr.io/devcontainers/features/git-lfs:1": {}
|
|
15
|
+
},
|
|
16
|
+
"postCreateCommand": "bash .devcontainer/post-create.sh",
|
|
17
|
+
"postStartCommand": "tmux new-session -d -s main 2>/dev/null || true",
|
|
18
|
+
"customizations": {
|
|
19
|
+
"vscode": {
|
|
20
|
+
"settings": {
|
|
21
|
+
"terminal.integrated.defaultProfile.linux": "zsh"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# init-host.sh - Runs on the HOST before container creation (initializeCommand)
|
|
3
|
+
# Ensures mount sources exist to prevent devcontainer up failures
|
|
4
|
+
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
CLAUDE_DIR="$HOME/.claude"
|
|
8
|
+
|
|
9
|
+
# Ensure ~/.claude directory exists (mounted read-only into container)
|
|
10
|
+
if [ ! -d "$CLAUDE_DIR" ]; then
|
|
11
|
+
echo "agent-env: Creating $CLAUDE_DIR (mount source)"
|
|
12
|
+
mkdir -p "$CLAUDE_DIR"
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
echo "agent-env: Host initialization complete"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# post-create.sh - Runtime initialization for agent-env devcontainers
|
|
3
|
+
# Runs once after the container is created
|
|
4
|
+
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
echo "=== agent-env: post-create initialization ==="
|
|
8
|
+
|
|
9
|
+
# Include agent-env git config for SSH-based signing
|
|
10
|
+
cp .devcontainer/git-config /home/node/.devcontainer-git-config 2>/dev/null || true
|
|
11
|
+
git config --global include.path /home/node/.devcontainer-git-config
|
|
12
|
+
|
|
13
|
+
# Verify tool installation
|
|
14
|
+
echo "--- Tool verification ---"
|
|
15
|
+
echo "Node.js: $(node --version)"
|
|
16
|
+
echo "npm: $(npm --version)"
|
|
17
|
+
echo "git: $(git --version)"
|
|
18
|
+
echo "tmux: $(tmux -V)"
|
|
19
|
+
echo "zsh: $(zsh --version)"
|
|
20
|
+
|
|
21
|
+
if command -v claude &>/dev/null; then
|
|
22
|
+
echo "Claude Code: installed"
|
|
23
|
+
else
|
|
24
|
+
echo "Warning: Claude Code CLI not found in PATH"
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
echo "=== agent-env: post-create complete ==="
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zookanalytics/agent-env",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI for creating isolated, AI-ready development environments",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"agent-env": "bin/agent-env.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "dist/cli.js",
|
|
10
|
+
"types": "dist/cli.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/cli.d.ts",
|
|
14
|
+
"import": "./dist/cli.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=20"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"bin",
|
|
23
|
+
"config"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"dev": "tsx src/cli.ts",
|
|
27
|
+
"build": "tsc",
|
|
28
|
+
"test": "vitest",
|
|
29
|
+
"test:run": "vitest run",
|
|
30
|
+
"test:coverage": "vitest run --coverage",
|
|
31
|
+
"lint": "eslint src/",
|
|
32
|
+
"type-check": "tsc --noEmit",
|
|
33
|
+
"check": "pnpm type-check && pnpm lint && pnpm test:run"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@zookanalytics/shared": "workspace:*",
|
|
37
|
+
"@inkjs/ui": "^2.0.0",
|
|
38
|
+
"commander": "^14.0.2",
|
|
39
|
+
"execa": "^9.6.1",
|
|
40
|
+
"ink": "^6.6.0",
|
|
41
|
+
"react": "^19.2.3",
|
|
42
|
+
"timeago.js": "^4.0.2"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/node": "^20.14.10",
|
|
46
|
+
"@types/react": "^19.2.8",
|
|
47
|
+
"glob": "^10.4.5",
|
|
48
|
+
"ink-testing-library": "^4.0.0",
|
|
49
|
+
"tsx": "^4.21.0"
|
|
50
|
+
}
|
|
51
|
+
}
|