Skip to content

feat(prepare-compose): compose file picker#1135

Open
keithy wants to merge 5 commits intonextlevelbuilder:mainfrom
keithy:feature/prepare-compose-script
Open

feat(prepare-compose): compose file picker#1135
keithy wants to merge 5 commits intonextlevelbuilder:mainfrom
keithy:feature/prepare-compose-script

Conversation

@keithy
Copy link
Copy Markdown
Contributor

@keithy keithy commented May 9, 2026

Summary

Having used a variety of schemes for managing the COMPOSE_FILE value, the symlink file method becomes cumbersome when you want to change the root docker-compose.yml file for an alternative implementation. The previous GOCLAW_MODULES env var approach is no longer generic and doesn't help the user with discovery of additional modules. Another option would be to write a bespoke tui picker, but that just seems like overkill for such a simple configuration item. These options dont easily ship with presets or examples.

Using a single bash script that offers the user the ability to edit an intermediary file, adds module discover-ability, and retains the same functionality. This one script is clean and simple.

It is also a generic approach that can be adopted by other compose oriented projects.

  • Removed: compose.d/ and compose.options/ symlink directories (tidier)
  • New: .env-compose file-based selection uncomment to enable files. (effectively a tmpfile)
  • Sections: ROOT (required), SERVICE (optional), OVERLAY (optional)
  • Detection: by content (services:/networks:/volumes:) + naming (. = service, + = overlay)
  • Options: --generate, --edit, --update, --check, --file
  • Validation: runs docker/podman compose config via DOCKER_CMD
  • Rename overlay example: postgres-low-cpu.ymlpostgres+low-cpu.yml

Options

Flag Description
--generate Create/replace .env-compose from available compose files
--edit Open .env-compose in $EDITOR, then apply to .env
--update Apply current .env-compose to .env
--check Validate compose config using $DOCKER_CMD (default: docker)
--file <f> Copy <f> to .env-compose, auto-runs --check + --update

Test plan

  • prepare-compose.sh --generate creates .env-compose
  • prepare-compose.sh --edit opens editor and applies
  • prepare-compose.sh --check validates with compose config
  • prepare-compose.sh --file <f> copies file, checks, and updates
  • Categories correctly separate root/service/overlay

keithy added 5 commits May 9, 2026 17:12
- Remove compose.d/ and compose.options/ symlink directories
- New prepare-compose.sh with --generate, --edit, --update, --check flags
- Uses .env-compose for file selection (uncomment = enabled)
- Sections: ROOT (required), SERVICE (optional), OVERLAY (optional)
- Detection by services:/networks:/volumes: content + naming (. = service, + = overlay)
- Validates with compose config via DOCKER_CMD (default: docker)
- Rename postgres-low-cpu.yml to postgres+low-cpu.yml
Auto-runs --check and --update after copying the file
Order: --generate, --edit, --update, --check
do_edit now calls do_update then do_check after editor saves
Replaces verbose write_compose_file with generic update_env(key, value)
that's more readable and reusable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant