feat(help): show version, command counts, and allowed/disabled builtins#181
Merged
feat(help): show version, command counts, and allowed/disabled builtins#181
Conversation
4 tasks
Add internal/version package with a source constant as single source of truth for the release version, overridable via ldflags for dev builds. Update the Makefile to inject version + commit at build time via git describe. Add a GitHub Actions release workflow (workflow_dispatch) that auto-computes the next version from the latest git tag. Pick patch/minor/major from a dropdown and click Run — no version to type. The workflow bumps the constant, commits, tags, and creates the release. Access is gated by a "release" environment requiring reviewer approval. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ltins
The help builtin now displays:
- A header with the rshell version and builtin count summary
("All N builtins available" or "N of M builtins enabled")
- A compact "Not allowed:" list when commands are restricted
- With --all, full description tables for both allowed and
not-allowed builtins
- When all builtins are allowed and --all is used, a confirmation
message "All builtins are allowed in this session."
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4ee0b74 to
cdc07cf
Compare
matt-dz
approved these changes
Apr 14, 2026
Address review feedback from matt-dz. Uses singular/plural form based on the count. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address PR review feedback: reword --all flag description to "show all builtins (including not allowed) with descriptions" and replace stdout_contains with full stdout assertions in all three help scenario tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AlexandreYang
approved these changes
Apr 16, 2026
…dd-allowed_commands # Conflicts: # .github/workflows/release.yml # internal/version/version.go # internal/version/version_test.go
Skip displaying the version when it is "dev" (the default for development/test builds). Real version strings from tagged releases or ldflags are still shown. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The version package on main uses debug.ReadBuildInfo() instead of ldflags, so the VERSION/COMMIT ldflags in the Makefile are unnecessary. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Covers case 4 from the PR description: all builtins allowed with --all flag, showing the "All builtins are allowed in this session." message. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Group the four help listing tests by restricted/unrestricted with an _all_flag suffix: - list_commands → unrestricted - all_flag_unrestricted → unrestricted_all_flag - restricted_commands → restricted - all_flag → restricted_all_flag Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
var Version = buildVersion() always overwrites ldflags at init time. Switch to an empty var with an init() guard so -X ldflags take precedence. Re-add the Makefile VERSION ldflag (without Commit, which no longer exists). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Revert the "dev" suppression — always show the version string regardless of its value. Restore Makefile and version.go to match main. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Display as "rshell (v0.0.10)" or "rshell (dev)" instead of "rshell v0.0.10". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…dd-allowed_commands
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.
Summary
helpbuiltin now shows a header with the rshell version and builtin counthelpshows a compact "Disabled builtins:" list andhelp --allshows both sections as full description tables--allis used, shows "All builtins are allowed in this session."Before / After
1.
./rshell --allowed-commands "rshell:echo,rshell:help,rshell:ls" -c 'help'Only 3 builtins are allowed. Running
helpwithout--all.Before:
After:
2.
./rshell --allowed-commands "rshell:echo,rshell:help,rshell:ls" -c 'help --all'Only 3 builtins are allowed. Running
help --allto see full descriptions for disabled builtins too.Before:
After:
3.
./rshell --allow-all-commands -c 'help'All builtins are allowed. Running
helpwithout--all.Before:
After:
4.
./rshell --allow-all-commands -c 'help --all'All builtins are allowed. Running
help --all.Before:
After:
Test plan
--allflag, restricted "Disabled builtins:" outputstdout_contains)go test ./...— 43 packages, 0 failures)internal/version.Versionadded to allowlists)🤖 Generated with Claude Code