Skip to content

Add completion spec: systemctl#204

Merged
acarl005 merged 1 commit into
mainfrom
add-systemctl-spec
Mar 20, 2026
Merged

Add completion spec: systemctl#204
acarl005 merged 1 commit into
mainfrom
add-systemctl-spec

Conversation

@acarl005
Copy link
Copy Markdown
Contributor

Summary

Add a comprehensive completion spec for systemctl, the systemd service manager CLI.

JSON Spec (systemctl.json)

  • All subcommands from systemctl --help organized by category:
    • Unit Commands: list-units, start, stop, restart, reload, status, enable, disable, mask, unmask, isolate, kill, freeze, thaw, etc.
    • Unit File Commands: list-unit-files, enable, disable, reenable, preset, is-enabled, mask, unmask, link, revert, edit, etc.
    • Machine Commands: list-machines
    • Job Commands: list-jobs, cancel
    • Environment Commands: show-environment, set-environment, unset-environment, import-environment
    • Manager State Commands: daemon-reload, daemon-reexec, log-level, log-target, service-watchdogs
    • System Commands: halt, poweroff, reboot, suspend, hibernate, etc.
  • All global options with proper argument types and static suggestions where applicable

Generators (systemctl.rs)

Three generators for dynamic completions:

  • units: Combines list-units and list-unit-files output with deduplication, showing unit state as description
  • unit_types: Dynamically fetches available unit types via --type=help
  • unit_states: Dynamically fetches available unit states via --state=help

Testing

  • All tests pass via script/presubmit
  • Generators verified end-to-end in local Warp build — all three produce correct completions

Conversation: https://staging.warp.dev/conversation/4c48b63b-7e62-4d1a-aa6a-1501b6ce7168
Run: https://oz.staging.warp.dev/runs/bf968e47-4078-4ab7-9137-d2643aa8cf5e

This PR was generated with Oz.

Add JSON completion spec and Rust generators for systemctl, covering:
- All subcommands from systemctl --help (unit commands, unit file commands,
  machine commands, job commands, environment commands, manager state commands,
  and system commands)
- All global options
- Three generators:
  - units: combines list-units and list-unit-files for comprehensive unit name
    completions with state descriptions
  - unit_types: dynamic completion for --type option
  - unit_states: dynamic completion for --state option

Co-Authored-By: Oz <oz-agent@warp.dev>
Copy link
Copy Markdown
Contributor

@lucieleblanc lucieleblanc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stamp

@acarl005 acarl005 merged commit 60cf115 into main Mar 20, 2026
3 checks passed
@acarl005 acarl005 deleted the add-systemctl-spec branch March 20, 2026 22:39
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.

2 participants