Repository navigation
Description
Problem or Motivation
The typed short options -o, -v, -p and -u collide with tofu single-dash flags ('-out=FILE' parses as '-o ut=FILE'). The import, state, show and force-unlock verbs do not exist.
Order 4 of the plan in #5311. The owner approved the plan on 2026-11-13.
Proposed Solution & Architectural Design
The mirror verbs pass the remaining arguments to tofu without change. Remove the typed short options (alpha, no shim). Add thin verbs. --dry-run prints the tofu argv and the directory and sends no request.
Target Subsystem
OpenTofu / Infrastructure as Code
Existing Tool Considered
tofu does all of the work. No open tool adds devops pacing, the agent refusal or a dry run with zero requests.
Cost: Build: about 2.0M tokens and 3 days in 3 PRs (pass-through 1.2M, drift fix 0.3M, guard 0.5M), test first. Keep: about 50k tokens a month. Fix: about 200k tokens for each break. This item is the pass-through part: about 1.2M tokens.
Acceptance Criteria
- A test shows that 'devops tf plan -out=x.plan -lock=false' reaches tofu unchanged.
- docs/commands/tf.md and CLI_REFERENCE are updated.
Dependencies
No blocker (#5317 for live use). Part of #5311.
Source: #5311
Alternatives check of 2026-11-22: in-use.
The repository already uses this tool.
Tool: opentofu/opentofu (https://github.com/opentofu/opentofu), MPL-2.0, last activity 2026-11-21, maintained.
Reason: Searches found no wrapper tool; OpenTofu, already in use, supplies the engine, the four operations and the single-dash flags, but not the devops pass-through verbs, the zero-request dry run or the alias removal.
Covers:
- Plan, import, state, show and force-unlock engine
- Accepts single-dash flags such as -out and -lock
- Runs a command in a given working directory
Lacks:
- devops tf pass-through verbs for the four operations
- Zero-request --dry-run printing argv and directory
- Removal of the wrapper's -o, -v, -p, -u aliases
Proposed design
Problem statement
The devops tf wrapper declares typed short options -o, -v, -p and -u that collide with tofu single-dash flags, so -out=FILE parses as -o ut=FILE. The wrapper also has no import, state, show or force-unlock verbs. This change removes the colliding short aliases, adds thin pass-through verbs, and adds a zero-request --dry-run that prints the tofu argv and the directory.
Acceptance criteria
Requirement: Plan pass-through
The devops tf plan command SHALL pass every argument after <directory> to tofu plan unchanged.
Scenario: Plan flags reach tofu
- WHEN a test runs
devops tf plan <dir> -out=x.plan -lock=falsewith a faketofuexecutable - THEN the fake records the argv
plan -out=x.plan -lock=falseand the working directory<dir>.
Requirement: Short aliases removed
The tf subcommands MUST NOT declare -o, -v, -p or -u as wrapper short options.
Scenario: Removed alias is rejected
- WHEN a test runs
devops tf plan -o x.plan <dir> - THEN the command exits non-zero with an unknown option error and the fake records no tofu call.
Requirement: Import pass-through
The devops tf import command SHALL run tofu import in <directory> and forward every remaining argument unchanged.
Scenario: Import address and id reach tofu
- WHEN a test runs
devops tf import <dir> aws_instance.web i-123with a faketofuexecutable - THEN the fake records the argv
import aws_instance.web i-123and the working directory<dir>.
Requirement: State pass-through
The devops tf state command SHALL run tofu state in <directory> and forward every remaining argument unchanged.
Scenario: State list reaches tofu
- WHEN a test runs
devops tf state <dir> listwith a faketofuexecutable - THEN the fake records the argv
state listand the working directory<dir>.
Requirement: Show pass-through
The devops tf show command SHALL run tofu show in <directory> and forward every remaining argument unchanged.
Scenario: Show JSON reaches tofu
- WHEN a test runs
devops tf show <dir> -jsonwith a faketofuexecutable - THEN the fake records the argv
show -jsonand the working directory<dir>.
Requirement: Force-unlock pass-through
The devops tf force-unlock command SHALL run tofu force-unlock in <directory> and forward every remaining argument unchanged.
Scenario: Force-unlock id reaches tofu
- WHEN a test runs
devops tf force-unlock <dir> -force 123456with a faketofuexecutable - THEN the fake records the argv
force-unlock -force 123456and the working directory<dir>.
Requirement: Dry run
Each tf mirror verb SHALL print the full tofu argv and the directory on --dry-run and MUST NOT start tofu.
Scenario: Dry run starts no process
- WHEN a test runs
devops tf plan --dry-run <dir> -out=x.planwith a faketofuexecutable - THEN the output contains
tofu plan -out=x.planand<dir>, and the fake records no process.
Requirement: Command documentation
The change SHALL document the new tf verbs and removed short aliases in docs/commands/tf.md and SHALL regenerate docs/CLI_REFERENCE.md from the command tree.
Scenario: Documentation check
- WHEN the pull request updates the command tree and
docs/commands/tf.md - THEN the
docsrow ofStatic Analysispasses with no generated-document diff fordocs/CLI_REFERENCE.md, anddocs/commands/tf.mdshowsimport,state,showandforce-unlock.
Existing Tool Considered
OpenTofu (https://github.com/opentofu/opentofu) is already in use. It supplies the engine and the import, state, show and force-unlock operations, and it accepts the single-dash flags that must reach it unchanged. It lacks the devops CLI pass-through verbs, the zero-request --dry-run that prints the argv and directory, the removal of the wrapper's colliding short options -o, -v, -p and -u, and the devops pacing and agent-refusal behaviour; Terragrunt adds no zero-request dry run, pacing or agent refusal. The issue records about 1.2M tokens for this pass-through part, about 50k tokens a month to keep, and about 200k tokens for each break; the full plan is 3 days in 3 PRs.
Key questions
- How should
devops tfseparate wrapper options from tofu flags?: Keep<directory>as the first positional argument and forward every token after it to tofu unchanged. Declare wrapper options such as--dry-runbefore<directory>. (best practice) [sources: docs/commands/tf.md]- Chosen: Directory boundary. The issue example puts
<dir>before-out=x.plan -lock=false, and the existing command shape is[OPTIONS] <directory>. - Rejected: Unknown options anywhere. It would consume or reject tokens that must reach tofu.
- Rejected: Explicit
--separator. The issue example needs no separator, and the directory already gives the boundary.
- Chosen: Directory boundary. The issue example puts
- Which typed options should the change remove?: Remove only the short aliases
-o,-v,-pand-unamed in the issue. Keep the long options thatdocs/commands/tf.mdalready declares before<directory>. (best practice) [sources: docs/commands/tf.md]- Chosen: Remove named short aliases only. The issue names these four aliases as the collision and says no shim.
- Rejected: Remove all typed tofu options. It goes beyond the issue and removes documented long options.
- Rejected: Keep the aliases and translate them. The issue rejects a shim and the aliases still collide.
- What do the new
import,state,showandforce-unlockverbs do?: Each is a thin subcommand that takes<directory>first, runstofu <verb>in that directory, and forwards every remaining token unchanged. (best practice) [sources: docs/commands/tf.md]- Chosen: Thin pass-through subcommands. It matches the mirror-verb design and the existing
<directory>argument shape. - Rejected: Typed wrapper options for each verb. It adds code and can collide with tofu flags.
- Rejected: One generic
devops tf runverb. The issue asks for named verbs that mirror tofu.
- Chosen: Thin pass-through subcommands. It matches the mirror-verb design and the existing
- What must
--dry-runprint and do?: It prints the full tofu argv and the working directory and starts no tofu process. A test with a faketofuasserts that the fake records no call. (best practice) [sources: docs/commands/tf.md, CONTEXT.md]- Chosen: Print argv and directory, run nothing. It matches the issue and the project definition that a dry run makes no request.
- Rejected: Run
tofu planwith an extra flag. It still starts tofu and can make provider or state requests. - Rejected: Print only the command name. It does not show the directory or the forwarded flags.
- How are the
tfcommand documents kept correct?: Updatedocs/commands/tf.mdin the pull request and regeneratedocs/CLI_REFERENCE.mdfrom the command tree. Thedocsrow ofStatic Analysisrefuses a generated reference that differs from generator output. (best practice) [sources: CONTEXT.md, docs/commands/tf.md]- Chosen: Update the guide and regenerate the reference. The issue requires both, and CONTEXT says nobody edits a generated document by hand.
- Rejected: Edit only the generated reference by hand. The docs row refuses a file that is not generator output.
- Rejected: Skip the command guide. The issue requires
docs/commands/tf.mdto be updated.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 13, 2026
tf, and .github/labels.yml declares no scope/tf label. Add the label to the file to give the scope to this item.Both address short-flag collisions in the tf wrapper, but #5229 fixes collisions across all tools while the candidate is tf-specific and also adds four new mirror verbs.devops-cli-service commentedon Nov 16, 2026
Alternatives check: in-use
Reason: The searches found OpenTofu itself — the tool the issue names as doing "all of the work" — plus wrapper projects such as Terragrunt. OpenTofu supplies the engine and the state/import/show/force-unlock operations and accepts the single-dash flags that must reach it unchanged, so the pass-through work is largely covered by a tool already in use. It does not cover the devops CLI side of the need: the thin mirror verbs, the removal of the typed short options that collide with tofu flags, or a --dry-run that prints the argv and sends no request, and no wrapper project adds those either.
The repository already uses this tool.
Tool: opentofu/opentofu (https://github.com/opentofu/opentofu)
Covers:
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at 1774ebf (see proposed design in issue body).
chore(main): release 0.215.0 (#7057)
devops-cli-service commentedon Nov 25, 2026
Released in v0.215.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.215.0
devops-cli-service commentedon Nov 25, 2026
Live since 2026-11-25 04:21 UTC