Repository navigation
Add -e flag for non-interactive command execution - #407
Merged
Merged
Conversation
Supports `actionbase -e "show databases"` to run any REPL command without entering the interactive loop — analogous to `mysql -e`. Automatically enables plain mode (no prefix, no timing output) and exits 1 on failure. Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
… flags ParseArgs only handles --key prefixed flags; single-dash -e caused --authKey to consume the rest of the args as its value. Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
ParseArgs only handles --key flags, so -e was parsed as part of --authKey's value. Extract -e from os.Args before ParseArgs runs. Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
--host and --authKey flags override the env vars. Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
…--host) Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
Contributor
Author
|
Optimistic merge. |
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
Adds
-eflag and env var defaults so the CLI can be used non-interactively — analogous tomysql -e.Changes
cli/cmd/actionbase/main.go:-e "command"runs the command without entering the REPL, enables plain mode, exits 1 on failure;ACT_HOST/ACT_API_KEYenv vars as defaults for--host/--authKeycli/internal/util/print.go: addsIsPlainMode()accessorcli/internal/runner/actionbase_runner.go: suppresses timing output in plain modeHow to Test
AI Assistance