-
-
Notifications
You must be signed in to change notification settings - Fork 1
Interactions
Project commands declared in wip.yml and run as wip <name> [args...]. This is the feature that
turns a twelve-flag wslc exec line into wip rspec.
interaction: # the primary key — same name dip uses
rspec:
command: bundle exec rspeccommands: # accepted alias
rspec:
command: bundle exec rspecPick one. Declaring both in the same file is a ConfigError:
commands is mutually exclusive with interaction — pick one
wip config always prints the effective block under the name commands:, whichever you wrote.
interaction:
rails:
type: exec # exec (default) | run | build
command: bin/rails
container: app # override which container to exec into
interactive: true
workdir: /app
user: "1000:1000"
env:
RAILS_ENV: development| Key | Default | Notes |
|---|---|---|
type |
exec (build for an entry literally named build) |
see below |
command |
— | split with shell-word rules; extra CLI args are appended |
interactive |
false |
combined with real-TTY detection — see TTY Allocation |
container |
the primary container |
exec target override |
workdir, user, env, ports, volumes, image, remove
|
inherited from the primary entry | any of them can be overridden per command |
Every entry starts from the primary dependencies: entry's values and merges its own on top. That
inheritance is why a minimal entry works:
interaction:
bundle:
command: bundle # inherits image, workdir, env, … from dependencies.appRuns inside the already-running primary container:
wslc exec [-it] [-w WORKDIR] [-u USER] [-e KEY=VALUE …] CONTAINER command…
Ports and volumes are not applied — the container already exists. Requires the container to be
up (wip up -d first).
Runs in a fresh, ephemeral container:
migrate:
type: run
command: bundle exec rails db:migrate
image: slidict/slidict:development
remove: truewslc run [--rm] [-it] [-w] [-u] [-e …] [-p …] [-v …] IMAGE command…
Unlike exec, this does apply ports and volumes, and needs an image (inherited from the
primary entry unless overridden).
Not supported under mode: compose.
Builds an image:
build:
type: build
context: .
tag: slidict/slidict:development
shadow_context: /mnt/c/Users/me/AppData/Local/wip/build-contextswslc build -t TAG [extra args…] CONTEXT
An entry named build defaults to type: build even without the key. tag falls back to the
inherited image; an empty one is a ConfigError. Arguments you pass on the command line become
extra wslc build flags. See wip build, Dockerignore, and
Shadow Build Context.
Not supported under mode: compose.
Any other type value:
Invalid command type for migrate: exectue
Extra CLI arguments are appended to the configured command:
interaction:
rails:
command: bin/railswip rails console # → bin/rails console
wip rails db:migrate # → bin/rails db:migrate
wip rails g model User # → bin/rails g model UserBuilt-in commands always win. If you declare an interaction named sync, build, up, config,
… then wip sync runs the built-in. wip says so where it can:
$ wip sync
wip: commands.sync in wip.yml is shadowed by the built-in `wip sync`; run it with `wip dispatch sync`Run yours explicitly:
wip dispatch syncSee wip dispatch. Reserved names to avoid: init, version, doctor, config,
build, up, stop, down, exec, run, shell, logs, sync, dispatch, help.
Note build is a special case: it's both a built-in and the conventional name for the build
definition — wip build uses interaction.build's context/tag, so that collision is by design.
$ wip nope
Unknown command: nopeAny first argument wip doesn't recognize as a built-in is routed to dispatch, which raises this
if there's no matching entry.
Only type: exec is supported:
commands.migrate: type 'run' is not supported in compose mode (use `wslc-compose build`/`up --build` directly)
The command runs via the bridge's exec against compose.service.
Introduction
Modes
Configuration
- Configuration Reference
- Config File Discovery
- Dependencies
- Networking
- Interactions
- Restart Policies
- Env Files
- Secret Masking
- Dockerignore
- Shadow Build Context
- Source Sync
- Sync Modes
compose.yml support
- Compose File Support
- Compose Build
- Compose Depends On
- Compose Profiles
- Compose Variable Interpolation
Commands
- CLI Command Reference
- wip init
- wip version
- wip doctor
- wip config
- wip build
- wip up
- wip stop
- wip down
- wip exec
- wip run
- wip shell
- wip logs
- wip sync
- wip dispatch
- Global Options
- Debug Output
- TTY Allocation
Guides
- Guides
- Migrating from dip
- Reusing an Existing compose.yml
- Fixing a Slow Boot
- Continuous Sync
- Auto Restarting Containers
- Multi Arch Images
- Using wip in CI
Troubleshooting
- Troubleshooting & FAQ
- FAQ
- Configuration Errors
- WSLC Not Found
- Registry Authentication
- Architecture Mismatch
- Volume Limit Reached
- rsync Not Found
- Reporting Issues
Comparison
Project