@prover-coder-ai/docker-git 1.0.5

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.
Files changed (72) hide show
  1. package/.jscpd.json +16 -0
  2. package/.package.json.release.bak +109 -0
  3. package/CHANGELOG.md +31 -0
  4. package/README.md +173 -0
  5. package/biome.json +34 -0
  6. package/dist/main.js +847 -0
  7. package/dist/main.js.map +1 -0
  8. package/dist/src/app/main.js +15 -0
  9. package/dist/src/app/program.js +61 -0
  10. package/dist/src/docker-git/cli/input.js +21 -0
  11. package/dist/src/docker-git/cli/parser-attach.js +19 -0
  12. package/dist/src/docker-git/cli/parser-auth.js +70 -0
  13. package/dist/src/docker-git/cli/parser-clone.js +40 -0
  14. package/dist/src/docker-git/cli/parser-create.js +1 -0
  15. package/dist/src/docker-git/cli/parser-options.js +101 -0
  16. package/dist/src/docker-git/cli/parser-panes.js +19 -0
  17. package/dist/src/docker-git/cli/parser-sessions.js +69 -0
  18. package/dist/src/docker-git/cli/parser-shared.js +26 -0
  19. package/dist/src/docker-git/cli/parser-state.js +62 -0
  20. package/dist/src/docker-git/cli/parser.js +42 -0
  21. package/dist/src/docker-git/cli/read-command.js +17 -0
  22. package/dist/src/docker-git/cli/usage.js +99 -0
  23. package/dist/src/docker-git/main.js +15 -0
  24. package/dist/src/docker-git/menu-actions.js +115 -0
  25. package/dist/src/docker-git/menu-create.js +203 -0
  26. package/dist/src/docker-git/menu-input.js +2 -0
  27. package/dist/src/docker-git/menu-menu.js +46 -0
  28. package/dist/src/docker-git/menu-render.js +151 -0
  29. package/dist/src/docker-git/menu-select.js +131 -0
  30. package/dist/src/docker-git/menu-shared.js +111 -0
  31. package/dist/src/docker-git/menu-types.js +19 -0
  32. package/dist/src/docker-git/menu.js +237 -0
  33. package/dist/src/docker-git/program.js +38 -0
  34. package/dist/src/docker-git/tmux.js +176 -0
  35. package/eslint.config.mts +305 -0
  36. package/eslint.effect-ts-check.config.mjs +220 -0
  37. package/linter.config.json +33 -0
  38. package/package.json +63 -0
  39. package/src/app/main.ts +18 -0
  40. package/src/app/program.ts +75 -0
  41. package/src/docker-git/cli/input.ts +29 -0
  42. package/src/docker-git/cli/parser-attach.ts +22 -0
  43. package/src/docker-git/cli/parser-auth.ts +124 -0
  44. package/src/docker-git/cli/parser-clone.ts +55 -0
  45. package/src/docker-git/cli/parser-create.ts +3 -0
  46. package/src/docker-git/cli/parser-options.ts +152 -0
  47. package/src/docker-git/cli/parser-panes.ts +22 -0
  48. package/src/docker-git/cli/parser-sessions.ts +101 -0
  49. package/src/docker-git/cli/parser-shared.ts +51 -0
  50. package/src/docker-git/cli/parser-state.ts +86 -0
  51. package/src/docker-git/cli/parser.ts +73 -0
  52. package/src/docker-git/cli/read-command.ts +26 -0
  53. package/src/docker-git/cli/usage.ts +112 -0
  54. package/src/docker-git/main.ts +18 -0
  55. package/src/docker-git/menu-actions.ts +246 -0
  56. package/src/docker-git/menu-create.ts +320 -0
  57. package/src/docker-git/menu-input.ts +2 -0
  58. package/src/docker-git/menu-menu.ts +58 -0
  59. package/src/docker-git/menu-render.ts +327 -0
  60. package/src/docker-git/menu-select.ts +250 -0
  61. package/src/docker-git/menu-shared.ts +141 -0
  62. package/src/docker-git/menu-types.ts +94 -0
  63. package/src/docker-git/menu.ts +339 -0
  64. package/src/docker-git/program.ts +134 -0
  65. package/src/docker-git/tmux.ts +292 -0
  66. package/tests/app/main.test.ts +60 -0
  67. package/tests/docker-git/entrypoint-auth.test.ts +29 -0
  68. package/tests/docker-git/parser.test.ts +172 -0
  69. package/tsconfig.build.json +8 -0
  70. package/tsconfig.json +20 -0
  71. package/vite.config.ts +32 -0
  72. package/vitest.config.ts +85 -0
package/.jscpd.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "threshold": 0,
3
+ "minTokens": 30,
4
+ "minLines": 5,
5
+ "ignore": [
6
+ "**/node_modules/**",
7
+ "**/build/**",
8
+ "**/dist/**",
9
+ "**/*.min.js",
10
+ "**/reports/**"
11
+ ],
12
+ "skipComments": true,
13
+ "ignorePattern": [
14
+ "private readonly \\w+: \\w+;\\s*private readonly \\w+: \\w+;\\s*private \\w+: \\w+ \\| null = null;\\s*private \\w+: \\w+ \\| null = null;"
15
+ ]
16
+ }
@@ -0,0 +1,109 @@
1
+ {
2
+ "name": "@prover-coder-ai/docker-git",
3
+ "version": "1.0.5",
4
+ "description": "Minimal Vite-powered TypeScript console starter using Effect",
5
+ "main": "dist/src/docker-git/main.js",
6
+ "bin": {
7
+ "docker-git": "dist/src/docker-git/main.js"
8
+ },
9
+ "directories": {
10
+ "doc": "doc"
11
+ },
12
+ "scripts": {
13
+ "prebuild": "pnpm -C ../lib build",
14
+ "build": "pnpm run build:app && pnpm run build:docker-git",
15
+ "build:app": "vite build --ssr src/app/main.ts",
16
+ "dev": "vite build --watch --ssr src/app/main.ts",
17
+ "prelint": "pnpm -C ../lib build",
18
+ "lint": "npx @ton-ai-core/vibecode-linter src/",
19
+ "lint:tests": "npx @ton-ai-core/vibecode-linter tests/",
20
+ "lint:effect": "npx eslint --config eslint.effect-ts-check.config.mjs .",
21
+ "prebuild:docker-git": "pnpm -C ../lib build",
22
+ "build:docker-git": "tsc -p tsconfig.build.json",
23
+ "check": "pnpm run typecheck",
24
+ "clone": "pnpm -C ../.. run clone",
25
+ "docker-git": "node dist/src/docker-git/main.js",
26
+ "list": "pnpm -C ../.. run list",
27
+ "prestart": "pnpm run build",
28
+ "start": "node dist/main.js",
29
+ "pretest": "pnpm -C ../lib build",
30
+ "test": "pnpm run lint:tests && vitest run",
31
+ "pretypecheck": "pnpm -C ../lib build",
32
+ "typecheck": "tsc --noEmit"
33
+ },
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/ProverCoderAI/docker-git.git"
37
+ },
38
+ "keywords": [
39
+ "effect",
40
+ "typescript",
41
+ "vite",
42
+ "console"
43
+ ],
44
+ "author": "",
45
+ "license": "ISC",
46
+ "type": "module",
47
+ "bugs": {
48
+ "url": "https://github.com/ProverCoderAI/docker-git/issues"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public"
52
+ },
53
+ "homepage": "https://github.com/ProverCoderAI/docker-git#readme",
54
+ "packageManager": "pnpm@10.28.0",
55
+ "dependencies": {
56
+ "@effect-template/lib": "workspace:*",
57
+ "@effect/cli": "^0.73.0",
58
+ "@effect/cluster": "^0.56.1",
59
+ "@effect/experimental": "^0.58.0",
60
+ "@effect/platform": "^0.94.1",
61
+ "@effect/platform-node": "^0.104.0",
62
+ "@effect/printer": "^0.47.0",
63
+ "@effect/printer-ansi": "^0.47.0",
64
+ "@effect/rpc": "^0.73.0",
65
+ "@effect/schema": "^0.75.5",
66
+ "@effect/sql": "^0.49.0",
67
+ "@effect/typeclass": "^0.38.0",
68
+ "@effect/workflow": "^0.16.0",
69
+ "effect": "^3.19.14",
70
+ "ink": "^5.0.1",
71
+ "react": "^18.3.1",
72
+ "react-reconciler": "^0.29.2",
73
+ "ts-morph": "^27.0.2"
74
+ },
75
+ "devDependencies": {
76
+ "@biomejs/biome": "^2.3.11",
77
+ "@effect/eslint-plugin": "^0.3.2",
78
+ "@effect/language-service": "latest",
79
+ "@effect/vitest": "^0.27.0",
80
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.6.0",
81
+ "@eslint/compat": "2.0.1",
82
+ "@eslint/eslintrc": "3.3.3",
83
+ "@eslint/js": "9.39.2",
84
+ "@prover-coder-ai/eslint-plugin-suggest-members": "^0.0.13",
85
+ "@ton-ai-core/vibecode-linter": "^1.0.6",
86
+ "@types/node": "^24.10.9",
87
+ "@typescript-eslint/eslint-plugin": "^8.53.0",
88
+ "@typescript-eslint/parser": "^8.53.0",
89
+ "typescript-eslint": "^8.53.0",
90
+ "@vitest/coverage-v8": "^4.0.17",
91
+ "eslint": "^9.39.2",
92
+ "eslint-import-resolver-typescript": "^4.4.4",
93
+ "eslint-plugin-codegen": "0.34.1",
94
+ "eslint-plugin-import": "^2.32.0",
95
+ "eslint-plugin-simple-import-sort": "^12.1.1",
96
+ "eslint-plugin-sonarjs": "^3.0.5",
97
+ "eslint-plugin-sort-destructure-keys": "^2.0.0",
98
+ "eslint-plugin-unicorn": "^62.0.0",
99
+ "@vitest/eslint-plugin": "^1.6.6",
100
+ "@types/react": "^18.3.12",
101
+ "biome": "npm:@biomejs/biome@^2.3.11",
102
+ "globals": "^17.0.0",
103
+ "jscpd": "^4.0.7",
104
+ "typescript": "^5.9.3",
105
+ "vite": "^7.3.1",
106
+ "vite-tsconfig-paths": "^6.0.4",
107
+ "vitest": "^4.0.17"
108
+ }
109
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,31 @@
1
+ # @prover-coder-ai/docker-git
2
+
3
+ ## 1.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - chore: automated version bump
8
+
9
+ ## 1.0.4
10
+
11
+ ### Patch Changes
12
+
13
+ - chore: automated version bump
14
+
15
+ ## 1.0.3
16
+
17
+ ### Patch Changes
18
+
19
+ - chore: automated version bump
20
+
21
+ ## 1.0.2
22
+
23
+ ### Patch Changes
24
+
25
+ - chore: automated version bump
26
+
27
+ ## 1.0.1
28
+
29
+ ### Patch Changes
30
+
31
+ - chore: automated version bump
package/README.md ADDED
@@ -0,0 +1,173 @@
1
+ # docker-git
2
+
3
+ `docker-git` generates a disposable Docker development environment per repository and stores it under a single projects root (default: `~/.docker-git`).
4
+
5
+ Key goals:
6
+ - Functional Core, Imperative Shell implementation (pure templates + typed orchestration).
7
+ - Per-project `.orch/` directory (env + local state), while still allowing shared credentials across containers.
8
+ - Optional Playwright MCP + Chromium sidecar so Codex can do browser automation.
9
+
10
+ ## Quickstart
11
+
12
+ From this repo:
13
+
14
+ ```bash
15
+ pnpm install
16
+
17
+ # Interactive TUI menu (default)
18
+ pnpm run docker-git
19
+
20
+ # Clone a repo into its own container (creates under ~/.docker-git)
21
+ pnpm run docker-git clone https://github.com/agiens/crm/tree/vova-fork --force
22
+
23
+ # Clone an issue URL (creates isolated workspace + issue branch)
24
+ pnpm run docker-git clone https://github.com/agiens/crm/issues/123 --force
25
+
26
+ # Reset only project env defaults (keep workspace volume/data)
27
+ pnpm run docker-git clone https://github.com/agiens/crm/issues/123 --force-env
28
+
29
+ # Same, but also enable Playwright MCP + Chromium sidecar for Codex
30
+ pnpm run docker-git clone https://github.com/agiens/crm/tree/vova-fork --force --mcp-playwright
31
+ ```
32
+
33
+ ## Parallel Issues / PRs
34
+
35
+ When you clone GitHub issue or PR URLs, docker-git creates isolated project paths and container names:
36
+ - `.../issues/123` -> `<projectsRoot>/<owner>/<repo>/issue-123` (branch `issue-123`)
37
+ - `.../pull/45` -> `<projectsRoot>/<owner>/<repo>/pr-45` (ref `refs/pull/45/head`)
38
+
39
+ This lets you run multiple issues/PRs for the same repository in parallel without container/path collisions.
40
+
41
+ Force modes:
42
+ - `--force`: overwrite managed files and wipe compose volumes (`docker compose down -v`).
43
+ - `--force-env`: reset only project env defaults and recreate containers without wiping volumes.
44
+
45
+ Agent context for issue workspaces:
46
+ - Global `${CODEX_HOME}/AGENTS.md` includes workspace path + issue/PR context.
47
+ - For `issue-*` workspaces, docker-git creates `${TARGET_DIR}/AGENTS.md` (if missing) with issue context and auto-adds it to `.git/info/exclude`.
48
+
49
+ ## Projects Root Layout
50
+
51
+ The projects root is:
52
+ - `~/.docker-git` by default
53
+ - Override with `DOCKER_GIT_PROJECTS_ROOT=/some/path`
54
+
55
+ Structure (simplified):
56
+
57
+ ```text
58
+ ~/.docker-git/
59
+ authorized_keys
60
+ .orch/
61
+ env/
62
+ global.env
63
+ auth/
64
+ codex/ # shared Codex auth cache (credentials)
65
+ gh/ # shared GitHub auth (optional)
66
+ <owner>/<repo>/
67
+ docker-compose.yml
68
+ Dockerfile
69
+ entrypoint.sh
70
+ docker-git.json
71
+ .orch/
72
+ env/
73
+ global.env # copied/synced from root .orch/env/global.env
74
+ project.env # per-project env knobs (see below)
75
+ auth/
76
+ codex/ # project-local Codex state (sessions/logs/tmp/etc)
77
+ ```
78
+
79
+ ## Codex Auth: Shared Credentials, Per-Project Sessions
80
+
81
+ Default behavior:
82
+ - Shared credentials live in `/home/dev/.codex-shared/auth.json` (mounted from projects root).
83
+ - Each project keeps its own Codex state under `/home/dev/.codex/` (mounted from project `.orch/auth/codex`).
84
+ - The entrypoint links `/home/dev/.codex/auth.json -> /home/dev/.codex-shared/auth.json`.
85
+
86
+ This avoids `refresh_token` rotation issues that can happen when copying `auth.json` into every project while still keeping session state isolated per project.
87
+
88
+ Disable sharing (per-project auth):
89
+ - Set `CODEX_SHARE_AUTH=0` in `.orch/env/project.env`.
90
+
91
+ ## Playwright MCP (Chromium Sidecar)
92
+
93
+ Enable during create/clone:
94
+ - Add `--mcp-playwright`
95
+
96
+ This will:
97
+ - Create a Chromium sidecar container: `dg-<repo>-browser`
98
+ - Configure Codex MCP server `playwright` inside the dev container
99
+ - Provide a wrapper `docker-git-playwright-mcp` inside the dev container
100
+
101
+ Concurrency (many Codex sessions):
102
+ - Default is safe for many sessions: `MCP_PLAYWRIGHT_ISOLATED=1`
103
+ - Each Codex session gets its own browser context (incognito) to reduce cross-session interference.
104
+ - If you want a shared browser context (shared cookies/login), set `MCP_PLAYWRIGHT_ISOLATED=0` (not recommended with multiple concurrent sessions).
105
+
106
+ ## Runtime Env Knobs (per project)
107
+
108
+ Edit: `<projectDir>/.orch/env/project.env`
109
+
110
+ Common toggles:
111
+ - `CODEX_SHARE_AUTH=1|0` (default: `1`)
112
+ - `CODEX_AUTO_UPDATE=1|0` (default: `1`)
113
+ - `DOCKER_GIT_ZSH_AUTOSUGGEST=1|0` (default: `1`)
114
+ - `MCP_PLAYWRIGHT_ISOLATED=1|0` (default: `1`)
115
+ - `MCP_PLAYWRIGHT_CDP_ENDPOINT=http://...` (override CDP endpoint if needed)
116
+
117
+ ## Troubleshooting
118
+
119
+ MCP errors in `codex` UI:
120
+ - `No such file or directory (os error 2)` for `playwright`:
121
+ - `~/.codex/config.toml` contains `[mcp_servers.playwright]`, but the container was created without `--mcp-playwright`.
122
+ - Fix: recreate with `--force --mcp-playwright` (or remove the block from `config.toml`).
123
+ - `handshaking ... initialize response`:
124
+ - The configured MCP command is not a real MCP server (example: `command="echo"`).
125
+
126
+ Docker permission error (`/var/run/docker.sock`):
127
+ - Symptom:
128
+ - `permission denied while trying to connect to the docker API at unix:///var/run/docker.sock`
129
+ - Check:
130
+ ```bash
131
+ id
132
+ ls -l /var/run/docker.sock
133
+ docker version
134
+ ```
135
+ - Fix (works in `fish` and `bash`):
136
+ ```bash
137
+ sudo chgrp docker /var/run/docker.sock
138
+ sudo chmod 660 /var/run/docker.sock
139
+ sudo mkdir -p /etc/systemd/system/docker.socket.d
140
+ printf '[Socket]\nSocketGroup=docker\nSocketMode=0660\n' | sudo tee /etc/systemd/system/docker.socket.d/override.conf >/dev/null
141
+ sudo systemctl daemon-reload
142
+ sudo systemctl restart docker.socket docker
143
+ ```
144
+ - Verify:
145
+ ```bash
146
+ ls -l /var/run/docker.sock
147
+ docker version
148
+ ```
149
+ - Note:
150
+ - Do not run `pnpm run docker-git ...` with `sudo`.
151
+
152
+ Clone auth error (`Invalid username or token`):
153
+ - Symptom:
154
+ - `remote: Invalid username or token. Password authentication is not supported for Git operations.`
155
+ - Check and fix token:
156
+ ```bash
157
+ pnpm run docker-git auth github status
158
+ pnpm run docker-git auth github logout
159
+ pnpm run docker-git auth github login --token '<GITHUB_TOKEN>'
160
+ pnpm run docker-git auth github status
161
+ ```
162
+ - Token requirements:
163
+ - Token must have access to the target repository.
164
+ - For org repositories with SSO/SAML, authorize the token for that organization.
165
+ - Recommended scopes: `repo,workflow,read:org`.
166
+
167
+ ## Security Notes
168
+
169
+ The generated Codex config uses:
170
+ - `sandbox_mode = "danger-full-access"`
171
+ - `approval_policy = "never"`
172
+
173
+ This is intended for local disposable containers. Do not reuse these defaults for untrusted code.
package/biome.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
3
+ "vcs": {
4
+ "enabled": false,
5
+ "clientKind": "git",
6
+ "useIgnoreFile": false
7
+ },
8
+ "files": {
9
+ "ignoreUnknown": false
10
+ },
11
+ "assist": {
12
+ "enabled": false
13
+ },
14
+ "formatter": {
15
+ "enabled": false,
16
+ "indentStyle": "tab"
17
+ },
18
+ "linter": {
19
+ "enabled": false,
20
+ "rules": {
21
+ "recommended": false,
22
+ "suspicious": {
23
+ "noExplicitAny": "off"
24
+ }
25
+ }
26
+ },
27
+ "javascript": {
28
+ "formatter": {
29
+ "enabled": false,
30
+ "quoteStyle": "double",
31
+ "semicolons": "asNeeded"
32
+ }
33
+ }
34
+ }