Merged
Conversation
…psos CLI When invoked as `python -m cli.devopsos scaffold <target>`, the scaffold module's argparse would read sys.argv and see 'scaffold <target>' as unrecognized arguments. Fix by saving and restoring sys.argv around each scaffold main() call in devopsos.py so argparse falls back to env-var/ default values. Add regression tests for gha, gitlab and argocd. Co-authored-by: chefgs <7605658+chefgs@users.noreply.github.com>
Co-authored-by: chefgs <7605658+chefgs@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add setup instructions for running CLI commands
Fix Mar 7, 2026
python -m cli.devopsos scaffold <target> failing with "unrecognized arguments"
Lets users specify where the .devcontainer folder is scaffolded instead of always writing to the current working directory. python -m cli.devopsos init --dir my-project Renames the parameter from `dir` to `directory` to avoid shadowing the Python built-in. Adds _strip_ansi() test helper and two new tests: one for --help visibility, one functional test verifying the directory is used. Co-authored-by: chefgs <7605658+chefgs@users.noreply.github.com>
Copilot
AI
changed the title
Fix
Add --dir option to Mar 7, 2026
python -m cli.devopsos scaffold <target> failing with "unrecognized arguments"devopsos init command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
devopsos inithardcoded.devcontaineroutput to the current working directory with no way to redirect it.Changes
cli/devopsos.py--diroption (Python paramdirectory, default.) toinit()— fully backward-compatiblePath(".devcontainer")→Path(directory) / ".devcontainer"mkdirupgraded toparents=Trueto support nested target pathscli/test_cli.py_strip_ansi()helper to handle ANSI escape codes that typer/rich emits in help text, making--optionstring assertions reliabletest_init_help_shows_dir_option— verifies--dirappears ininit --helptest_init_dir_option_creates_devcontainer_in_specified_dir— functional test usingCliRunnerwith patchedInquirerPythat confirms.devcontainer/devcontainer.env.jsonlands in the specified directoryUsage
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.