Repository navigation
feat: make the interactive CLI an optional default feature - #172
Open
ferdingler wants to merge 2 commits into
Open
ferdingler wants to merge 2 commits into
ferdingler wants to merge 2 commits into
Conversation
The cli feature is on by default and the python feature turns it on, so default builds, the wheel, and the npm addon are unchanged. A library consumer that sets default-features = false no longer pulls in clap or rustyline; the strands-shell binary and the MCP binary tests need the feature, and the Lua REPL falls back to plain line input without it.
Are you comfortable with the direction? If so, I can take it out of draft. |
Collaborator
Author
I left my agent working overnight and came back to realize it mentioned your PR. Let me get familiar with these changes and I'll get back to you. But at quick glance, your proposal makes sense. |
…ture # Conflicts: # Cargo.toml
This branch has not been deployed
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.
Description
Anyone using Strands Shell as a Rust library gets the interactive CLI whether they want it or not. That drags in a terminal line editor and an argument parser that an embedded shell never uses, and there's no way to opt out.
This puts the CLI behind a
clifeature that's on by default, and thepythonfeature turns it on too since the wheel ships thestrands-shellcommand. So a plain build, the Python package, and the npm addon all behave exactly as they do today. A library consumer can now setdefault-features = falseand skip the CLI and the line editor. In that build thestrands-shellbinary isn't built, the MCP tests that drive it are skipped, and the Lua REPL falls back to plain line input like it already does on WASM. The one break: a dependent that already setsdefault-features = falseloses theclimodule and has to add theclifeature back. WASM is unaffected, since the line editor was already native-only. Box already turns the CLI off in its copy of Shell (here); this does the same upstream, but leaves it on by default so nothing changes for anyone else.I ran the full Rust suite both with default features and with the CLI turned off, and both pass; the CLI-off build has neither crate in its dependency tree. I also built the Python wheel and the Node addon and their test suites pass, and the installed Python
strands-shellcommand still runs. Clippy has the same warning count as main. I didn't build the WASM target locally. This touches the same files as the wasm-api draft (#145), and I didn't change the rustyline version myself; the bump to 19 (#166) came in from main.Related Issues
None.
Documentation PR
None.
Type of Change
New feature
Testing
How have you tested the change? Verify that the changes do not break functionality or introduce new warnings.
cargo test --workspace --all-targets,pytest tests/python,npm test)cargo fmtandcargo clippyChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.