Skip to content

Commit 2656c02

Browse files
authored
Merge pull request #30 from AnExiledDev/docs/multi-client-support
Add multi-client support docs and dynamic port forwarding
2 parents f1428a2 + dc58121 commit 2656c02

File tree

10 files changed

+272
-61
lines changed

10 files changed

+272
-61
lines changed

.devcontainer/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
## [Unreleased]
44

5+
### Changed
6+
7+
#### Port Forwarding
8+
- Dynamic port forwarding for all ports in VS Code — previously only port 7847 was statically forwarded; now all ports auto-forward with notification
9+
10+
#### Documentation
11+
- Updated prerequisites and installation docs to support all DevContainer clients (VS Code, CLI, JetBrains Gateway, DevPod, Codespaces)
12+
- Added tabbed client-specific instructions on the installation page
13+
- Added dedicated port forwarding reference page covering VS Code auto-detect, devcontainer-bridge, and SSH tunneling
14+
515
### Fixed
616

717
#### Session Context Plugin
@@ -12,6 +22,9 @@
1222
#### Auto Code Quality Plugin
1323
- **Advisory test runner** now reads from the correct tmp file prefix (`claude-cq-edited` instead of `claude-edited-files`), fixing a mismatch that prevented it from ever finding edited files
1424

25+
#### Docs
26+
- Removed stale merge conflict marker in first-session docs page
27+
1528
### Added
1629

1730
#### Startup

.devcontainer/CLAUDE.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,14 @@ Custom features in `./features/` follow the [devcontainer feature spec](https://
184184

185185
## Port Forwarding
186186

187-
Two mechanisms handle port access:
187+
Three mechanisms handle port access depending on your client:
188188

189-
| Mechanism | When Active | Dynamic Discovery |
190-
|-----------|-------------|-------------------|
191-
| `forwardPorts` (devcontainer.json) | VS Code / Codespaces only | No (static list; VS Code auto-detects separately) |
192-
| devcontainer-bridge (`dbr`) | Any terminal client | Yes (polls `/proc/net/tcp`) |
189+
| Mechanism | Client | Discovery |
190+
|-----------|--------|-----------|
191+
| VS Code auto-detect | VS Code only | Dynamic — all ports auto-forwarded with notification |
192+
| devcontainer-bridge (`dbr`) | Any terminal client | Dynamic — polls `/proc/net/tcp` |
193+
| SSH tunneling | Any SSH client | Manual — `ssh -L localPort:localhost:remotePort` |
193194

194-
`forwardPorts` is a no-op outside VS Code — the `devcontainer` CLI ignores it. `dbr` provides VS Code-independent dynamic port discovery via a reverse connection model (container→host). The container daemon auto-starts and is inert without the host daemon (`dbr host-daemon`). Both mechanisms coexist. See [devcontainer-bridge](https://github.com/bradleybeddoes/devcontainer-bridge).
195+
VS Code auto-detects all ports opened inside the container (configured via `portsAttributes` in `devcontainer.json`). Outside VS Code, `dbr` provides dynamic port discovery via a reverse connection model (container→host). The container daemon auto-starts and is inert without the host daemon (`dbr host-daemon`). Both mechanisms coexist. See [devcontainer-bridge](https://github.com/bradleybeddoes/devcontainer-bridge).
196+
197+
For full setup instructions, see the [Port Forwarding reference](https://anexileddev.github.io/CodeForge/reference/port-forwarding/) in the docs.

.devcontainer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CodeForge Usage Guide
22

3-
Everything you need to know once you're inside the devcontainer.
3+
Everything you need to know once you're inside the devcontainer. These instructions apply regardless of which client you used to start the container — VS Code, the `devcontainer` CLI, JetBrains Gateway, DevPod, or GitHub Codespaces.
44

55
## Quick Start
66

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,14 @@
155155
"ghcr.io/bradleybeddoes/devcontainer-bridge/dbr:0.2.0": {}
156156
},
157157

158-
"forwardPorts": [7847],
158+
"forwardPorts": [],
159159
"portsAttributes": {
160160
"7847": {
161161
"label": "Claude Dashboard",
162162
"onAutoForward": "notify"
163163
},
164164
"*": {
165-
"onAutoForward": "silent"
165+
"onAutoForward": "notify"
166166
}
167167
},
168168

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ npx codeforge-dev@1.2.3
4848
## Prerequisites
4949

5050
- **Docker Desktop** (or compatible container runtime like Podman)
51-
- **VS Code** with the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers), or **GitHub Codespaces**
51+
- **A DevContainer client** — any of:
52+
- **VS Code** with the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
53+
- **DevContainer CLI**`npm install -g @devcontainers/cli` ([docs](https://containers.dev/supporting#devcontainer-cli))
54+
- **GitHub Codespaces** — zero local setup
55+
- **JetBrains Gateway** with [Dev Containers plugin](https://plugins.jetbrains.com/plugin/21962-dev-containers)
56+
- **DevPod** — open-source, editor-agnostic ([devpod.sh](https://devpod.sh/))
5257
- **Claude Code authentication** — run `claude` on first start to authenticate
5358

5459
## What's Included
@@ -127,11 +132,14 @@ For the complete configuration guide, see the [documentation site](https://anexi
127132
## Quick Start
128133

129134
1. **Install**: `npx codeforge-dev`
130-
2. **Open in Container**: "Reopen in Container" in VS Code, or create a Codespace
135+
2. **Open in Container**:
136+
- **VS Code**: "Reopen in Container" from the Command Palette
137+
- **CLI**: `devcontainer up --workspace-folder .` then `docker exec -it <container> zsh`
138+
- **Codespaces**: Create a Codespace from the repo
131139
3. **Authenticate**: Run `claude` and follow prompts
132140
4. **Start coding**: Run `cc`
133141

134-
For full usage documentation — authentication, configuration, tools, agents, and keybindings — see [`.devcontainer/README.md`](.devcontainer/README.md).
142+
CodeForge uses the open [Dev Containers specification](https://containers.dev/) — any compatible client works. For full usage documentation — authentication, configuration, tools, agents, and keybindings — see [`.devcontainer/README.md`](.devcontainer/README.md).
135143

136144
## Contributing
137145

docs/astro.config.mjs

Lines changed: 47 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,71 @@
1-
import { defineConfig } from 'astro/config';
2-
import starlight from '@astrojs/starlight';
3-
import tailwindcss from '@tailwindcss/vite';
4-
import sitemap from '@astrojs/sitemap';
5-
import astroMermaid from 'astro-mermaid';
6-
import starlightSidebarTopics from 'starlight-sidebar-topics';
7-
import starlightImageZoom from 'starlight-image-zoom';
8-
import starlightLinksValidator from 'starlight-links-validator';
9-
import starlightKbd from 'starlight-kbd';
10-
import starlightScrollToTop from 'starlight-scroll-to-top';
11-
import starlightLlmsTxt from 'starlight-llms-txt';
1+
import sitemap from "@astrojs/sitemap";
2+
import starlight from "@astrojs/starlight";
3+
import tailwindcss from "@tailwindcss/vite";
4+
import { defineConfig } from "astro/config";
5+
import astroMermaid from "astro-mermaid";
6+
import starlightImageZoom from "starlight-image-zoom";
7+
import starlightKbd from "starlight-kbd";
8+
import starlightLinksValidator from "starlight-links-validator";
9+
import starlightLlmsTxt from "starlight-llms-txt";
10+
import starlightScrollToTop from "starlight-scroll-to-top";
11+
import starlightSidebarTopics from "starlight-sidebar-topics";
1212

1313
export default defineConfig({
14-
site: 'https://anexileddev.github.io',
15-
base: '/CodeForge',
14+
site: "https://anexileddev.github.io",
15+
base: "/CodeForge",
1616
integrations: [
1717
// astro-mermaid MUST be registered BEFORE starlight
1818
astroMermaid(),
1919
starlight({
20-
title: 'CodeForge',
21-
tagline: 'Your AI dev environment, battle-tested.',
20+
title: "CodeForge",
21+
tagline: "Your AI dev environment, battle-tested.",
2222
logo: {
23-
src: './src/assets/logo.png',
23+
src: "./src/assets/logo.png",
2424
replacesTitle: false,
2525
},
2626
social: [
27-
{ icon: 'github', label: 'GitHub', href: 'https://github.com/AnExiledDev/CodeForge' },
28-
{ icon: 'x.com', label: 'X', href: 'https://x.com/AnExiledDev' },
27+
{
28+
icon: "github",
29+
label: "GitHub",
30+
href: "https://github.com/AnExiledDev/CodeForge",
31+
},
32+
{ icon: "x.com", label: "X", href: "https://x.com/AnExiledDev" },
2933
],
30-
customCss: ['./src/styles/global.css'],
34+
customCss: ["./src/styles/global.css"],
3135
components: {
32-
Hero: './src/components/Hero.astro',
33-
Header: './src/components/Header.astro',
36+
Hero: "./src/components/Hero.astro",
37+
Header: "./src/components/Header.astro",
3438
},
3539
editLink: {
36-
baseUrl: 'https://github.com/AnExiledDev/CodeForge/edit/main/docs/',
40+
baseUrl: "https://github.com/AnExiledDev/CodeForge/edit/main/docs/",
3741
},
3842
head: [
3943
{
40-
tag: 'meta',
44+
tag: "meta",
4145
attrs: {
42-
name: 'og:image',
43-
content: '/CodeForge/og-image.png',
46+
name: "og:image",
47+
content: "/CodeForge/og-image.png",
4448
},
4549
},
4650
{
47-
tag: 'link',
51+
tag: "link",
4852
attrs: {
49-
rel: 'icon',
50-
type: 'image/png',
51-
href: '/CodeForge/favicon.png',
53+
rel: "icon",
54+
type: "image/png",
55+
href: "/CodeForge/favicon.png",
5256
},
5357
},
5458
{
55-
tag: 'link',
59+
tag: "link",
5660
attrs: {
57-
rel: 'apple-touch-icon',
58-
href: '/CodeForge/apple-touch-icon.png',
61+
rel: "apple-touch-icon",
62+
href: "/CodeForge/apple-touch-icon.png",
5963
},
6064
},
6165
{
6266
// Default to dark theme when no user preference is saved
63-
tag: 'script',
64-
attrs: { is: 'inline' },
67+
tag: "script",
68+
attrs: { is: "inline" },
6569
content: `(function(){var k='starlight-theme';if(!localStorage.getItem(k)){localStorage.setItem(k,'dark');document.documentElement.setAttribute('data-theme','dark');document.documentElement.style.colorScheme='dark'}})()`,
6670
},
6771
],
@@ -150,6 +154,7 @@ export default defineConfig({
150154
{ label: 'Commands', slug: 'reference/commands' },
151155
{ label: 'Environment Variables', slug: 'reference/environment' },
152156
{ label: 'Architecture', slug: 'reference/architecture' },
157+
{ label: 'Port Forwarding', slug: 'reference/port-forwarding' },
153158
],
154159
},
155160
],
@@ -160,8 +165,13 @@ export default defineConfig({
160165
}),
161166
starlightKbd({
162167
types: [
163-
{ id: 'mac', label: 'macOS', detector: 'apple', default: false },
164-
{ id: 'windows', label: 'Windows / Linux', detector: 'windows', default: true },
168+
{ id: "mac", label: "macOS", detector: "apple", default: false },
169+
{
170+
id: "windows",
171+
label: "Windows / Linux",
172+
detector: "windows",
173+
default: true,
174+
},
165175
],
166176
}),
167177
starlightScrollToTop(),
@@ -171,7 +181,7 @@ export default defineConfig({
171181
sitemap(),
172182
],
173183
server: {
174-
host: '0.0.0.0',
184+
host: "0.0.0.0",
175185
},
176186
vite: {
177187
plugins: [tailwindcss()],

docs/src/content/docs/getting-started/first-session.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ CodeForge includes **21 specialized agents** and **38 skills** that activate aut
105105

106106
If your terminal supports it, CodeForge provides a status line that shows session information at a glance. The `ccstatusline` feature adds session metadata to your terminal prompt, so you always know which session you're in and its current state.
107107

108+
109+
108110
## Tips for Effective Sessions
109111

110112
:::tip[Be specific with requests]

docs/src/content/docs/getting-started/installation.md

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,14 @@ your-project/
5454
└── ... (your existing files)
5555
```
5656

57-
## Step 2: Open in VS Code
57+
## Step 2: Open in a DevContainer Client
58+
59+
import { Tabs, TabItem } from '@astrojs/starlight/components';
60+
61+
CodeForge uses the open [Dev Containers specification](https://containers.dev/). Pick whichever client fits your workflow:
62+
63+
<Tabs>
64+
<TabItem label="VS Code">
5865

5966
Open your project in VS Code. You should see a notification in the bottom-right corner:
6067

@@ -65,6 +72,51 @@ Click **Reopen in Container**. If you miss the notification, use the Command Pal
6572
1. Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on macOS)
6673
2. Type "Dev Containers" and select **Dev Containers: Reopen in Container**
6774

75+
You can watch the build progress in the "Dev Containers" output channel in the terminal panel.
76+
77+
</TabItem>
78+
<TabItem label="DevContainer CLI">
79+
80+
Install the CLI if you haven't already:
81+
82+
```bash
83+
npm install -g @devcontainers/cli
84+
```
85+
86+
Build and start the container:
87+
88+
```bash
89+
devcontainer up --workspace-folder .
90+
```
91+
92+
Then connect to the running container:
93+
94+
```bash
95+
docker exec -it <container-name> zsh
96+
```
97+
98+
Use `docker ps` to find the container name. For port forwarding outside VS Code, see the [Port Forwarding reference](../reference/port-forwarding/).
99+
100+
</TabItem>
101+
<TabItem label="JetBrains">
102+
103+
1. Open **JetBrains Gateway** (or IntelliJ IDEA / PyCharm with the [Dev Containers plugin](https://plugins.jetbrains.com/plugin/21962-dev-containers))
104+
2. Select **Dev Containers** as the connection type
105+
3. Point to your project directory containing `.devcontainer/`
106+
4. Gateway builds the container and connects the IDE backend automatically
107+
108+
</TabItem>
109+
<TabItem label="Codespaces">
110+
111+
1. Push your project (with the `.devcontainer/` directory) to GitHub
112+
2. Go to your repository on GitHub and click **Code → Codespaces → Create codespace**
113+
3. Codespaces reads your `devcontainer.json` and builds the environment in the cloud
114+
115+
No local Docker installation required. Port forwarding is handled automatically by Codespaces.
116+
117+
</TabItem>
118+
</Tabs>
119+
68120
### What Happens During the First Build
69121

70122
The first container build takes several minutes (typically 3-8 minutes depending on your internet speed and hardware). Here's what's happening behind the scenes:
@@ -73,10 +125,10 @@ The first container build takes several minutes (typically 3-8 minutes depending
73125
2. **Feature installation** — installs 21 DevContainer features in dependency order: Node.js and uv first (other tools depend on them), then Rust, Bun, Claude Code, and all custom features
74126
3. **Post-start setup** — deploys configuration files, sets up shell aliases, and configures plugins
75127

76-
You can watch the progress in VS Code's log output. Look for the "Dev Containers" output channel in the terminal panel.
77-
78128
:::caution[Don't interrupt the first build]
79-
If the build is interrupted, Docker may cache a partial state. Use **Dev Containers: Rebuild Container Without Cache** to start fresh.
129+
If the build is interrupted, Docker may cache a partial state. Rebuild without cache to start fresh:
130+
- **VS Code**: Dev Containers: Rebuild Container Without Cache
131+
- **CLI**: `devcontainer up --workspace-folder . --remove-existing-container`
80132
:::
81133

82134
## Step 3: Verify Installation
@@ -162,8 +214,8 @@ npx codeforge-dev@latest
162214

163215
This updates the `.devcontainer/` configuration. After updating, rebuild the container:
164216

165-
1. Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on macOS)
166-
2. Select **Dev Containers: Rebuild Container**
217+
- **VS Code**: Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on macOS) and select **Dev Containers: Rebuild Container**
218+
- **CLI**: `devcontainer up --workspace-folder . --remove-existing-container`
167219

168220
:::tip[Check what changed]
169221
Use `git diff .devcontainer/` after updating to review what changed before committing. This lets you verify the update didn't overwrite any customizations you want to keep.
@@ -220,6 +272,10 @@ Use `git diff .devcontainer/` after updating to review what changed before commi
220272

221273
- **Extension not installed** — install `ms-vscode-remote.remote-containers` from the Extensions marketplace, then reload VS Code
222274
- **`.devcontainer/` not at repo root** — VS Code looks for `.devcontainer/` in the workspace root folder. If your project is inside a subfolder, open that subfolder directly
275+
276+
:::note[Using a different client?]
277+
Not using VS Code? The DevContainer CLI, JetBrains Gateway, DevPod, and Codespaces all read the same `devcontainer.json`. See [Step 2](#step-2-open-in-a-devcontainer-client) for client-specific instructions.
278+
:::
223279
- **VS Code version** — DevContainers requires VS Code 1.85 or later. Check **Help → About** and update if needed
224280

225281
### Docker permission errors (Linux)

docs/src/content/docs/getting-started/requirements.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,20 @@ Run `docker info` in your terminal. If you see container and image counts, Docke
2929
WSL 2 is required. Docker Desktop's legacy Hyper-V backend is not supported because DevContainers rely on WSL 2 for Linux container support. If you haven't enabled WSL 2, follow [Microsoft's WSL installation guide](https://learn.microsoft.com/en-us/windows/wsl/install) before proceeding.
3030
:::
3131

32-
### VS Code
32+
### DevContainer Client
3333

34-
- **Visual Studio Code** — version 1.85 or later
35-
- **Dev Containers extension** — install `ms-vscode-remote.remote-containers` from the Extensions marketplace
34+
CodeForge uses the open [Dev Containers specification](https://containers.dev/). Any compatible client works — pick whichever fits your workflow:
3635

37-
The Dev Containers extension is what makes VS Code able to open your project inside the container. Without it, the "Reopen in Container" prompt won't appear.
36+
| Client | Notes |
37+
|--------|-------|
38+
| **VS Code** with [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) | Most popular option. Version 1.85+ required. |
39+
| **DevContainer CLI** | Standalone CLI: `npm install -g @devcontainers/cli`. No editor required — connect via any terminal. |
40+
| **GitHub Codespaces** | Zero local setup. Push your repo with `.devcontainer/` and create a Codespace. |
41+
| **JetBrains Gateway** | Native devcontainer.json support via [Dev Containers plugin](https://plugins.jetbrains.com/plugin/21962-dev-containers). |
42+
| **DevPod** | Open-source, editor-agnostic client. Supports local Docker, Kubernetes, and cloud backends. See [devpod.sh](https://devpod.sh/). |
3843

39-
:::note[Alternative: GitHub Codespaces]
40-
If you prefer not to run Docker locally, you can use GitHub Codespaces. Push your project (with the `.devcontainer/` directory) to GitHub and create a Codespace from it. Codespaces use the same DevContainer configuration, so everything works the same way.
44+
:::tip[Port forwarding outside VS Code]
45+
VS Code auto-detects ports opened inside the container. Other clients don't. CodeForge includes `devcontainer-bridge` (`dbr`) for dynamic port forwarding from any terminal. See the [Port Forwarding reference](../reference/port-forwarding/) for setup details.
4146
:::
4247

4348
### Claude Code

0 commit comments

Comments
 (0)