Skip to content

Commit d9e49e7

Browse files
grichaclaude
andcommitted
Code formatting and documentation updates
- Apply oxfmt formatting to ws-shell.ts - Documentation updates 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent ebf73ac commit d9e49e7

File tree

9 files changed

+144
-141
lines changed

9 files changed

+144
-141
lines changed

README.md

Lines changed: 106 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,161 +1,159 @@
1-
# Workspace CLI
1+
# Workspace
22

33
[![Tests](https://github.com/subroutinecom/workspace/actions/workflows/test.yml/badge.svg)](https://github.com/subroutinecom/workspace/actions/workflows/test.yml)
44
[![npm version](https://badge.fury.io/js/@subroutinecom%2Fworkspace.svg)](https://www.npmjs.com/package/@subroutinecom/workspace)
55
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
66

7-
Containerized development environments with Docker-in-Docker, SSH access, and persistent storage.
7+
Isolated, self-hosted workspaces accessible over Tailscale. AI coding agents, web UI, and remote terminal access.
88

9-
## Install
9+
## Features
10+
11+
- **AI Coding Agents** - Claude Code, OpenCode, GitHub Copilot pre-installed
12+
- **Self-Hosted** - Run on your own hardware, full control
13+
- **Remote Access** - Use from anywhere via Tailscale, CLI, web, or SSH
14+
- **Web UI** - Manage workspaces from your browser
15+
- **Isolated Environments** - Each workspace runs in its own container
16+
17+
## Setup
18+
19+
### Install
1020

1121
```bash
1222
npm install -g @subroutinecom/workspace
1323
```
1424

15-
## Quick Start
25+
Or with curl:
1626

1727
```bash
18-
# Initialize in your project
19-
cd myproject
20-
workspace init
21-
22-
# Edit .workspace.yml, then start
23-
workspace start
24-
workspace shell # SSH into container
25-
workspace proxy # Port forwarding (separate terminal)
28+
curl -fsSL https://workspace.subroutine.com/install.sh | sh
2629
```
2730

28-
## Configuration
31+
### Build Base Image
2932

30-
### Project Configuration
33+
```bash
34+
ws build
35+
```
3136

32-
`.workspace.yml` in your project:
37+
### Start Agent
3338

34-
```yaml
35-
repo:
36-
remote: git@github.com:user/repo.git
37-
branch: main
38-
39-
bootstrap:
40-
scripts:
41-
- scripts/install-deps.sh
42-
43-
forwards:
44-
- 3000
45-
- 5173
46-
- "8000-8010"
47-
48-
mounts:
49-
- ./local:/home/workspace/otherLocalData
50-
- ~/data:/data:ro
39+
```bash
40+
ws agent start
5141
```
5242

53-
### User Configuration
43+
Web UI: **http://localhost:7391**
5444

55-
`~/.workspaces/config.yml` for user-specific settings across all workspaces:
45+
The agent runs on port 7391 by default. For remote access:
5646

57-
```yaml
58-
ssh:
59-
# Default SSH key (optional - uses heuristic if not specified)
60-
defaultKey: ~/.ssh/id_ed25519
61-
62-
# Per-repository key overrides (supports wildcards)
63-
repos:
64-
"git@github.com:user/private-repo.git": ~/.ssh/id_github_personal
65-
"git@github.com:company/*": ~/.ssh/id_github_work
66-
67-
bootstrap:
68-
scripts:
69-
- userscripts # Directory: runs all executable files alphabetically
47+
```bash
48+
ws agent start --host 0.0.0.0
7049
```
7150

72-
User config is automatically created on first run with `userscripts` directory reference. Paths are relative to `~/.workspaces/`. Directories auto-expand to run all executable files. Configuration is merged with project config - user bootstrap scripts run **after** project scripts.
51+
### Create & Use Workspaces
7352

74-
**SSH Configuration:**
53+
**Via CLI:**
7554

76-
- All SSH keys from `~/.ssh/` are copied to containers
77-
- Specify `defaultKey` to set which key is used by default for git operations
78-
- Per-repository overrides support exact matches and wildcard patterns
79-
- If no `defaultKey` is specified, the CLI uses SSH agent keys or falls back to `id_ed25519`, `id_ecdsa`, or `id_rsa`
80-
- The selected key is automatically configured in git and SSH config inside containers
55+
```bash
56+
# Create workspace
57+
ws create myproject
8158

82-
**Bootstrap scripts** run as `workspace` user with passwordless sudo.
59+
# Or clone a repo
60+
ws create myproject --clone git@github.com:user/repo.git
8361

84-
**Mounts** format: `source:target[:mode]`. Relative paths resolve from config directory. Tilde expands to home. By default workspace mounts your host $HOME at `/host/home` (read-only).
62+
# SSH into workspace
63+
ws list # Find SSH port
64+
ssh -p 2201 workspace@localhost
8565

86-
**Forwards** creates SSH tunnels when running `workspace proxy <name>`.
66+
# Manage workspaces
67+
ws start myproject
68+
ws stop myproject
69+
ws delete myproject
70+
```
8771

88-
## Commands
72+
**Via Web UI:**
8973

90-
```bash
91-
# Lifecycle
92-
workspace start [name] # Start workspace (auto-builds image)
93-
workspace stop [name] # Stop workspace
94-
workspace destroy [name...] [-f] # Remove container + volumes
95-
workspace status [name] # Show state (CPU, memory, ports)
96-
97-
# Development
98-
workspace shell [name] [-c "cmd"] # SSH into container
99-
workspace proxy [name] # Port forwarding tunnel
100-
workspace logs [name] [-f] # Container logs
101-
102-
# Discovery
103-
workspace list # Find all .workspace.yml files
104-
workspace config [name] # Show resolved configuration
105-
workspace doctor # Check prerequisites
106-
107-
# Image/BuildKit
108-
workspace build [--no-cache] # Build base image
109-
workspace buildkit [--status] # Manage shared BuildKit
110-
```
74+
Open http://localhost:7391 and click "+" to create a workspace.
11175

112-
Commands run from project directory use that workspace. Or specify name from anywhere.
76+
## Security
11377

114-
## What's Inside
78+
Workspace is designed for use within **secure networks** like [Tailscale](https://tailscale.com). The web UI and API have no authentication, making them ideal for private networks where you can safely access workspaces remotely without additional security concerns.
11579

116-
- **OS**: Ubuntu 24.04 LTS
117-
- **Docker**: CE + Compose + BuildKit
118-
- **Languages**: Node.js 22, Python 3
119-
- **Editor**: Neovim v0.11.4 + LazyVim
120-
- **Tools**: Git, GitHub CLI, ripgrep, fd-find, jq, curl, wget, rsync
121-
- **User**: `workspace` with passwordless sudo
80+
For public internet exposure, place behind a reverse proxy with authentication.
12281

123-
## User Scripts
82+
## Configuration
12483

125-
Add executable scripts to `~/.workspaces/userscripts/` - they run automatically in all workspaces:
84+
Configure credentials and environment variables via Web UI → Settings or edit `~/.workspace-agent/config.yaml`:
12685

12786
```yaml
128-
# ~/.workspaces/config.yml (auto-created on first run)
129-
bootstrap:
130-
scripts:
131-
- userscripts # Runs all executable files in directory
87+
credentials:
88+
env:
89+
ANTHROPIC_API_KEY: "sk-ant-..."
90+
OPENAI_API_KEY: "sk-..."
91+
GITHUB_TOKEN: "ghp_..."
92+
files:
93+
~/.ssh/id_ed25519: ~/.ssh/id_ed25519
94+
~/.gitconfig: ~/.gitconfig
13295
```
13396
134-
Example script:
97+
Restart workspaces to apply changes.
98+
99+
## What's Inside Each Workspace
100+
101+
- Ubuntu 24.04 LTS
102+
- Node.js 22, Python 3, Go
103+
- Docker (for containerized development)
104+
- Neovim + LazyVim
105+
- Git, GitHub CLI, ripgrep, fd-find, jq
106+
- Claude Code, OpenCode, Codex CLI
107+
108+
## Commands
135109
136110
```bash
137-
# ~/.workspaces/userscripts/setup-shell.sh
138-
#!/bin/bash
139-
echo "Setting up shell configuration..."
140-
cp /host/home/.zshrc ~/.zshrc
111+
# Agent
112+
ws agent start [--port PORT] [--host HOST]
113+
ws agent stop
114+
ws agent status
115+
116+
# Workspaces
117+
ws create <name> [--clone URL]
118+
ws start <name>
119+
ws stop <name>
120+
ws delete <name>
121+
ws list
122+
ws logs <name> [-f]
123+
124+
# Build
125+
ws build [--no-cache]
126+
ws doctor
141127
```
142128

143-
Make scripts executable: `chmod +x ~/.workspaces/userscripts/setup-shell.sh`
129+
## Documentation
144130

145-
**Directory expansion**: Point at a directory to run all executable files alphabetically. Or specify individual scripts for precise control.
131+
Full docs at https://workspace.subroutine.com/docs
146132

147-
User scripts execute after project bootstrap scripts in the order listed.
133+
Or run locally:
148134

149-
## Testing
135+
```bash
136+
cd docs
137+
npm install
138+
npm start
139+
```
140+
141+
## Development
150142

151143
```bash
152-
npm test
144+
git clone https://github.com/subroutinecom/workspace.git
145+
cd workspace
146+
bun install
147+
bun run build
153148
```
154149

155-
## Prerequisites
150+
Run tests:
151+
152+
```bash
153+
bun run validate # Lint, typecheck, build, test
154+
bun run test # Tests only
155+
```
156156

157-
- Docker Desktop or Engine
158-
- SSH client + ssh-keygen
159-
- Node.js 18+
157+
## License
160158

161-
Run `workspace doctor` to verify.
159+
MIT

docs/docs/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sidebar_position: 3
1010
ws agent start
1111
```
1212

13-
Web UI: `http://localhost:8420`
13+
Web UI: `http://localhost:7391`
1414

1515
Options:
1616
```bash
@@ -27,7 +27,7 @@ ws create myproject --clone git@github.com:user/repo.git
2727
```
2828

2929
Web UI:
30-
1. Open `http://localhost:8420`
30+
1. Open `http://localhost:7391`
3131
2. Click "+"
3232
3. Enter name
3333
4. Create

docs/docs/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ bun link
3131
ws build
3232
```
3333

34-
Takes 5-10 minutes. Only needed once.
34+
Builds the Ubuntu 24.04 base image with dev tools. Takes 5-10 minutes, only needed once.
3535

3636
## Verify
3737

docs/docs/introduction.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ sidebar_position: 1
44

55
# Introduction
66

7-
Workspace creates isolated Docker-in-Docker development environments.
7+
Workspace creates isolated, containerized development environments accessible from anywhere.
88

99
## Features
1010

11-
- **Isolated** - Each project in its own container
12-
- **Reproducible** - Same environment everywhere
11+
- **Isolated** - Each workspace runs in its own container
12+
- **Self-Hosted** - Run on your hardware, full control
1313
- **AI-Ready** - Claude Code, OpenCode, GitHub Copilot pre-installed
14-
- **Remote** - Access via Web UI, CLI, or SSH
14+
- **Remote Access** - Use over Tailscale, web UI, CLI, or SSH
1515

1616
## What's Inside
1717

1818
- Ubuntu 24.04 LTS
19-
- Docker CE + Compose + BuildKit
2019
- Node.js 22, Python 3, Go
20+
- Docker (for containerized workflows)
2121
- Neovim + LazyVim
2222
- Git, GitHub CLI, common tools
2323
- Claude Code, OpenCode, Codex CLI
2424

2525
## Access
2626

27-
- **Web UI** - Browser interface (port 8420)
27+
- **Web UI** - Browser interface (port 7391)
2828
- **CLI** - `ws` command
2929
- **SSH** - Direct terminal access
3030

docs/docs/troubleshooting.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ docker volume rm workspace-<name>
200200

201201
1. **Check if port is in use:**
202202
```bash
203-
lsof -i :8420
203+
lsof -i :7391
204204
# or
205-
netstat -tuln | grep 8420
205+
netstat -tuln | grep 7391
206206
```
207207

208208
2. **Use a different port:**
@@ -239,19 +239,19 @@ docker volume rm workspace-<name>
239239
1. **Verify agent is running:**
240240
```bash
241241
ws agent status
242-
# Should show "Agent is running on port 8420"
242+
# Should show "Agent is running on port 7391"
243243
```
244244

245245
2. **Test API directly:**
246246
```bash
247-
curl http://localhost:8420/rpc
247+
curl http://localhost:7391/rpc
248248
# Should return JSON response
249249
```
250250

251251
3. **Check firewall (Linux):**
252252
```bash
253253
sudo ufw status
254-
sudo ufw allow 8420
254+
sudo ufw allow 7391
255255
```
256256

257257
4. **Try different browser:**

docs/docs/web-ui.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 6
44

55
# Web UI
66

7-
Access: `http://localhost:8420`
7+
Access: `http://localhost:7391`
88

99
## Features
1010

docs/docusaurus.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type * as Preset from '@docusaurus/preset-classic';
66

77
const config: Config = {
88
title: 'Workspace',
9-
tagline: 'Containerized development environments with Docker-in-Docker',
9+
tagline: 'Isolated, self-hosted workspaces accessible over Tailscale',
1010
favicon: 'img/favicon.ico',
1111

1212
// Future flags, see https://docusaurus.io/docs/api/docusaurus-config#future

0 commit comments

Comments
 (0)