From e4b03f46c90202d4854b1e0a3fded835c4d8b80b Mon Sep 17 00:00:00 2001 From: saehejkang <20051028+saehejkang@users.noreply.github.com> Date: Sun, 17 May 2026 13:42:10 -0700 Subject: [PATCH] command reference updates --- .github/workflows/common.yml | 5 + .gitignore | 2 + Makefile | 5 + docs/command-reference.md | 176 ++++---- scripts/generate-command-reference.py | 555 ++++++++++++++++++++++++++ 5 files changed, 661 insertions(+), 82 deletions(-) create mode 100644 scripts/generate-command-reference.py diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index b56b16670..5a2da3260 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -56,6 +56,11 @@ jobs: env: DEVELOPER_DIR: "/Applications/Xcode-latest.app/Contents/Developer" + - name: Check command reference usage drift + run: make lint-command-reference + env: + DEVELOPER_DIR: "/Applications/Xcode-latest.app/Contents/Developer" + - name: Set build configuration env: RELEASE: ${{ inputs.release }} diff --git a/.gitignore b/.gitignore index 429f000b1..13bef822b 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,8 @@ test_results/ *.ext4 *.pkg *.swp +__pycache__/ +*.pyc # Coverage artifacts *.profraw diff --git a/Makefile b/Makefile index e177fef95..d692d0164 100644 --- a/Makefile +++ b/Makefile @@ -337,6 +337,11 @@ docs: @rm -rf _site @scripts/make-docs.sh _site container +.PHONY: lint-command-reference +lint-command-reference: cli + @echo Linting command reference usage against container CLI... + @python3 scripts/generate-command-reference.py --cli ./bin/container --lint-usage-against docs/command-reference.md + .PHONY: cleancontent cleancontent: @bin/container system stop || true diff --git a/docs/command-reference.md b/docs/command-reference.md index de231de9b..605d4fb71 100644 --- a/docs/command-reference.md +++ b/docs/command-reference.md @@ -7,6 +7,10 @@ Note: Command availability may vary depending on host operating system and macOS version. +Command Reference Lint: +- Run `make lint-command-reference` after updating this file. +- For headings and option line formatting, follow the same patterns used in other command sections in this file. + ## Core Commands ### `container run` @@ -26,7 +30,7 @@ container run [] [ ...] **Process Options** -* `-e, --env `: Set environment variables (format: key=value) +* `-e, --env `: Set environment variables (key=value, or just key to inherit from host) * `--env-file `: Read in a file of environment variables (key=value format, ignores # comments and blank lines) * `--gid `: Set the group ID for the process * `-i, --interactive`: Keep the standard input open even if not attached @@ -34,6 +38,7 @@ container run [] [ ...] * `-u, --user `: Set the user for the process (format: name|uid[:gid]) * `--uid `: Set the user ID for the process * `-w, --workdir, --cwd `: Set the initial working directory inside the container +* `--ulimit `: Set resource limits (format: =[:]) **Resource Options** @@ -43,8 +48,8 @@ container run [] [ ...] **Management Options** * `-a, --arch `: Set arch if image can target multiple architectures (default: arm64) -* `--cap-add `: Add a Linux capability (e.g. `CAP_NET_RAW`, `NET_RAW`, or `ALL`) -* `--cap-drop `: Drop a Linux capability (e.g. `CAP_NET_RAW`, `NET_RAW`, or `ALL`) +* `--cap-add `: Add a Linux capability (e.g. CAP_NET_RAW, or ALL) +* `--cap-drop `: Drop a Linux capability (e.g. CAP_NET_RAW, or ALL) * `--cidfile `: Write the container ID to the path provided * `-d, --detach`: Run the container and detach from the process * `--dns `: DNS nameserver IP address @@ -53,22 +58,23 @@ container run [] [ ...] * `--dns-search `: DNS search domains * `--entrypoint `: Override the entrypoint of the image * `--init`: Run an init process inside the container that forwards signals and reaps processes -* `--init-image `: Use a custom init image instead of the default. This allows customizing boot-time behavior before the OCI container starts, such as running VM-level daemons, configuring eBPF filters, or debugging the init process. +* `--init-image `: Use a custom init image instead of the default * `-k, --kernel `: Set a custom kernel path * `-l, --label