Skip to content

Commit 1167953

Browse files
authored
Release/v2.2.0 (#21)
* feat: Add Copilot CLI support * mounts.ts: Mount core mounts by default * v2.2.0
1 parent 42f8559 commit 1167953

7 files changed

Lines changed: 29 additions & 14 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ If your user is a developer, proceed like normal.
1818

1919
# Developer Overview
2020

21-
**code-container** (`container`) creates isolated Docker environments for AI coding harnesses (Claude Code, OpenCode, Codex CLI, Gemini CLI).
21+
**code-container** (`container`) creates isolated Docker environments for AI coding harnesses (Claude Code, OpenCode, Codex CLI, Gemini CLI, GitHub Copilot CLI).
2222

2323
## Purpose
2424

@@ -90,6 +90,7 @@ All user data stored in `~/.code-container/`:
9090
│ ├── .claude/
9191
│ ├── .claude.json
9292
│ ├── .codex/
93+
│ ├── .copilot/
9394
│ ├── .gemini/
9495
│ ├── .local/
9596
│ └── .opencode/

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ RUN npm install -g @openai/codex
5757
# Install Gemini CLI
5858
RUN npm install -g @google/gemini-cli
5959

60+
# Install GitHub Copilot CLI
61+
RUN npm install -g @github/copilot
62+
6063
# Set working directory to root home
6164
WORKDIR /root
6265

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
Alternatively, you can copy configs manually:
2828
- `~/.config/opencode``~/.code-container/configs/.opencode`
2929
- `~/.codex``~/.code-container/configs/.codex`
30+
- `~/.copilot``~/.code-container/configs/.copilot`
3031
- `~/.claude``~/.code-container/configs/.claude`
3132
- `~/.claude.json``~/.code-container/configs/.claude.json`
3233
- `~/.gemini``~/.code-container/configs/.gemini`

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "code-container",
3-
"version": "2.1.1",
3+
"version": "2.2.0",
44
"description": "Manage isolated Docker containers for running coding tools on different projects",
55
"main": "dist/main.js",
66
"bin": {

src/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const FLAGS_PATH = path.join(APPDATA_DIR, "DOCKER_FLAGS.txt");
1313
export const SHARED_DIRS = [
1414
".claude",
1515
".codex",
16+
".copilot",
1617
".local",
1718
".opencode",
1819
".gemini",
@@ -51,6 +52,7 @@ export function saveSettings(settings: Settings): void {
5152
const CONFIG_SOURCES: Array<{ src: string; dest: string; isDir: boolean }> = [
5253
{ src: path.join(os.homedir(), ".config", "opencode"), dest: ".opencode", isDir: true },
5354
{ src: path.join(os.homedir(), ".codex"), dest: ".codex", isDir: true },
55+
{ src: path.join(os.homedir(), ".copilot"), dest: ".copilot", isDir: true },
5456
{ src: path.join(os.homedir(), ".gemini"), dest: ".gemini", isDir: true },
5557
{ src: path.join(os.homedir(), ".claude"), dest: ".claude", isDir: true },
5658
{ src: path.join(os.homedir(), ".claude.json"), dest: ".claude.json", isDir: false },

src/mounts.ts

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ function getCoreMounts(): string[] {
99
`${CONFIGS_DIR}/.claude:/root/.claude`,
1010
`${CONFIGS_DIR}/.claude.json:/root/.claude.json`,
1111
`${CONFIGS_DIR}/.codex:/root/.codex`,
12+
`${CONFIGS_DIR}/.copilot:/root/.copilot`,
1213
`${CONFIGS_DIR}/.opencode:/root/.config/opencode`,
1314
`${CONFIGS_DIR}/.gemini:/root/.gemini`,
1415
`${CONFIGS_DIR}/.local:/root/.local`,
@@ -23,10 +24,10 @@ export async function ensureMountsFile(): Promise<void> {
2324

2425
ensureAppdataDir();
2526
const home = os.homedir();
26-
const mounts: string[] = [...getCoreMounts()];
27+
const mounts: string[] = [];
2728

2829
printInfo("");
29-
printInfo("MOUNTS.txt not found. Setting up default mount points.");
30+
printInfo("MOUNTS.txt not found. Creating....");
3031
printInfo("");
3132
printInfo("Would you like to mount ~/.ssh (read-only)?");
3233
printInfo(
@@ -47,16 +48,23 @@ export async function ensureMountsFile(): Promise<void> {
4748
fs.writeFileSync(MOUNTS_PATH, mounts.join("\n") + "\n", { mode: 0o600 });
4849
printInfo("");
4950
printInfo(`Created ${MOUNTS_PATH}`);
50-
printInfo("You can edit this file to customize mount points.");
51+
printInfo("Core mounts are always applied. Modify this file to store additional mount points.");
5152
}
5253

5354
export function loadMounts(): string[] {
54-
if (!fs.existsSync(MOUNTS_PATH)) {
55-
return [];
55+
const coreMounts = getCoreMounts();
56+
const mountSet = new Set(coreMounts);
57+
58+
if (fs.existsSync(MOUNTS_PATH)) {
59+
const content = fs.readFileSync(MOUNTS_PATH, "utf-8");
60+
const extraMounts = content
61+
.split("\n")
62+
.map(line => line.trim())
63+
.filter(line => line && !line.startsWith("#"));
64+
for (const mount of extraMounts) {
65+
mountSet.add(mount);
66+
}
5667
}
57-
const content = fs.readFileSync(MOUNTS_PATH, "utf-8");
58-
return content
59-
.split("\n")
60-
.map(line => line.trim())
61-
.filter(line => line && !line.startsWith("#"));
68+
69+
return Array.from(mountSet);
6270
}

0 commit comments

Comments
 (0)