Skip to content

feat: make the interactive CLI an optional default feature - #172

Open
ferdingler wants to merge 2 commits into
strands-agents:mainfrom
ferdingler:feat/optional-cli-feature
Open

ferdingler wants to merge 2 commits into
strands-agents:mainfrom
ferdingler:feat/optional-cli-feature

Conversation

@ferdingler

@ferdingler ferdingler commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

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 cli feature that's on by default, and the python feature turns it on too since the wheel ships the strands-shell command. So a plain build, the Python package, and the npm addon all behave exactly as they do today. A library consumer can now set default-features = false and skip the CLI and the line editor. In that build the strands-shell binary 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 sets default-features = false loses the cli module and has to add the cli feature 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-shell command 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.

  • I ran the relevant test suites for the bindings I touched (cargo test --workspace --all-targets, pytest tests/python, npm test)
  • If I touched Rust, I ran cargo fmt and cargo clippy

Checklist

  • I have read the CONTRIBUTING document
  • I have reviewed and understand every line of code in this PR, including any generated by AI tools, and I can explain why it works
  • My change is focused and reasonably small; I have split unrelated work into separate PRs
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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.
@ferdingler
ferdingler requested a review from a team as a code owner October 21, 2026 04:47
@ferdingler
ferdingler requested review from mkmeral and removed request for a team October 21, 2026 04:47
@andreaTP

Copy link
Copy Markdown

This touches the same files as the wasm-api draft

Are you comfortable with the direction? If so, I can take it out of draft.

@ferdingler

ferdingler commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator Author

This touches the same files as the wasm-api draft

Are you comfortable with the direction? If so, I can take it out of draft.

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.

@ferdingler ferdingler closed this Oct 21, 2026
@ferdingler ferdingler reopened this Oct 21, 2026
@ferdingler
ferdingler requested a review from a team as a code owner October 21, 2026 22:14

This branch has not been deployed

No deployments
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