dkit 0.4.0 → 0.4.1

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 (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +8 -3
  4. data/bin/dkit +2 -2
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 50d35a0b2d2d8d179be81ce6360eccc29cacd941125ce01dc7202954a7499ab1
4
- data.tar.gz: 727ca198989f81815d6aa2fecb8a2096ababe1402de1f2e73e0cdc07938753dc
3
+ metadata.gz: a3a9a92ddb91d679c5e3829e29555e41e350f28e21d5b23068c9f47aed0bfb71
4
+ data.tar.gz: 7cfdcde91b707f91065824ebd500b7d98ece0775a69cd0d859592c65200924f0
5
5
  SHA512:
6
- metadata.gz: 24a65808288983e07fe1897600f467d763518c09954480c6b0dd753e2f310a055c8928e1cd7cf3933c46945ac6a6f2b87eecdb66d754f083e24c20d82153e595
7
- data.tar.gz: 6e604b67d3bafed4b1c90794fd5bf9309a807dbdcd5a0d72f7641f0b5faeb20b7da3a9db2206e983461c43d94204195269c4abfd24ed9b660ec4a603ab5e2e9b
6
+ metadata.gz: f545daeb77092ee428d0ec2405e1cea0f9f83685bc918ba4900acfa0dd9e1355858bab85a2326ed8f0a944720b1a01d6dd635ee574a39ca9985efd4f118fdcb2
7
+ data.tar.gz: 83ff15a0ebf7e693aff3a40ce59c9deab9373aea4be9afbc45da082a970886c6c35e3344485827f7b9ed8486d29c54837b300e936f66e6c017a36508344669c4
data/CHANGELOG.md CHANGED
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.4.1] - 2026-04-13
9
+
10
+ ### Fixed
11
+ - `dkit shell` now runs as a subprocess (`system`) instead of replacing the current process (`exec`), so `exit` returns to the host shell instead of closing the terminal
12
+
13
+ ### Changed
14
+ - README: added zsh as explicit requirement, documented glob/wildcard intercept patterns, clarified zsh-specific hook mechanisms
15
+
8
16
  ## [0.4.0] - 2026-04-13
9
17
 
10
18
  ### Added
data/README.md CHANGED
@@ -10,6 +10,7 @@ When you `cd` into a project, dkit intercepts configured commands (e.g. `rails`,
10
10
  ## Requirements
11
11
 
12
12
  - macOS or Linux
13
+ - zsh (bash and other shells are not supported)
13
14
  - Ruby >= 2.7
14
15
  - Docker with Compose v2 (`docker compose`)
15
16
  - A project with `.devcontainer/devcontainer.json` using `dockerComposeFile` + `service`
@@ -56,10 +57,13 @@ git commit -m "chore: add dkit intercept config"
56
57
  ```sh
57
58
  dkit intercept list # show active commands for this project
58
59
  dkit intercept add terraform # add a command
60
+ dkit intercept add 'bin/*' # add a glob pattern (quote to prevent shell expansion)
59
61
  dkit intercept remove terraform # remove a command
60
62
  exec zsh # reload shell to apply changes
61
63
  ```
62
64
 
65
+ Glob patterns like `bin/*` intercept all matching executables at once (e.g. `bin/rails`, `bin/rspec`). New files are picked up automatically at each prompt.
66
+
63
67
  ### Verbose routing messages
64
68
 
65
69
  By default, dkit prints a line to stderr whenever it intercepts a command:
@@ -100,17 +104,18 @@ dkit down [flags] docker compose down
100
104
  dkit logs [service] docker compose logs -f
101
105
 
102
106
  dkit init Create .devcontainer/dkit-intercept
103
- dkit intercept list|add|remove <cmd>
107
+ dkit intercept list|add|remove <cmd|pattern>
104
108
  dkit hook Emit shell hook for ~/.zshrc
105
109
  dkit version
106
110
  ```
107
111
 
108
112
  ## How it works
109
113
 
110
- 1. On `cd`, the shell hook calls `dkit root` to find the nearest `.devcontainer/devcontainer.json`.
111
- 2. It reads `.devcontainer/dkit-intercept` and defines a shell function for each listed command.
114
+ 1. On `cd`, the zsh `chpwd` hook calls `dkit root` to find the nearest `.devcontainer/devcontainer.json`.
115
+ 2. It reads `.devcontainer/dkit-intercept` and defines a zsh function for each listed command. Glob patterns (e.g. `bin/*`) are expanded to matching executables.
112
116
  3. Each function calls `dkit status --quiet` to check if the container is running. If yes, it delegates to `dkit run <cmd>`; otherwise it calls the host binary.
113
117
  4. `dkit run` resolves the container name from the devcontainer config (via compose YAML, docker labels, or `docker compose ps`) and execs into it at the mirrored working directory.
118
+ 5. A `precmd` hook re-expands glob patterns before each prompt, picking up new files and cleaning up deleted ones.
114
119
 
115
120
  ## devcontainer.json requirements
116
121
 
data/bin/dkit CHANGED
@@ -16,7 +16,7 @@ require 'pathname'
16
16
  require 'shellwords'
17
17
  require 'fileutils'
18
18
 
19
- VERSION = "0.4.0"
19
+ VERSION = "0.4.1"
20
20
  DC_CONFIG = ".devcontainer/devcontainer.json"
21
21
  DC_INTERCEPT = ".devcontainer/dkit-intercept"
22
22
 
@@ -367,7 +367,7 @@ def cmd_run(ctx, args)
367
367
  end
368
368
 
369
369
  def cmd_shell(ctx)
370
- exec("docker", "exec", "-it", "--user", ctx.user, "--workdir", ctx.cwd, ctx.container, "zsh", "-l")
370
+ system("docker", "exec", "-it", "--user", ctx.user, "--workdir", ctx.cwd, ctx.container, "zsh", "-l")
371
371
  end
372
372
 
373
373
  def cmd_claude(ctx, args)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Augusto Stroligo