feat(tokenless): add init command for onboarding - #2148
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b11b98c1e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| Some(0) => DetectStatus::Ready, | ||
| Some(1) => DetectStatus::Installable, |
There was a problem hiding this comment.
Install when detect only proves the host is present
For qoder and codex, the existing adapter detect.sh scripts do not use this tri-state contract: qoder exits 0 when qodercli is found (ready to install), and codex exits 0 after checking only the tokenless binary. Mapping every exit 0 to Ready means a fresh tokenless init --framework qoder or --framework codex reports already installed/ready and returns before run_install, so the onboarding command never registers those adapters for users who have the framework CLI but not the tokenless plugin.
Useful? React with 👍 / 👎.
| match run_install(&adapter_dir, &fw.name, script) { | ||
| Ok(()) => println!("{} adapter installed successfully.", fw.name), | ||
| Err(e) => eprintln!("{} adapter installation failed: {}", fw.name, e), |
There was a problem hiding this comment.
Return failure when --all cannot install an adapter
When --all is used in the documented non-interactive path, any install script failure only prints stderr here and the function still returns Ok(()). CI/provisioning will treat setup as successful even though one or more requested adapters were not registered; accumulate failures and return a non-zero error after attempting the remaining installs.
Useful? React with 👍 / 👎.
| /// Detect installed agent frameworks and install tokenless adapters | ||
| Init { |
There was a problem hiding this comment.
Add the init command to the component README
This introduces a new tokenless init CLI command, but the diff only updates the user guide; src/tokenless/README.md and README_zh.md remain unchanged. The documentation standard requires new or modified CLI commands/flags to update both the component README summary and the user-guide reference, so users reading the package/component entry point will not see the new onboarding path. specs/documentation-standard.mdL260-L267
Useful? React with 👍 / 👎.
| ### Added | ||
|
|
||
| - `tokenless init` command: detects installed agent frameworks, reports adapter status (ready / installable / missing prerequisites), and runs the appropriate `install.sh` to register the tokenless adapter — providing a single entry point for community onboarding. |
There was a problem hiding this comment.
Keep changelog entries for release bump PRs
This feature commit adds an Unreleased changelog entry, but the documentation standard says daily feature/fix PRs should update README and user-guide only and reserves CHANGELOG edits for release version bump PRs that aggregate user-perceivable changes. Leaving this entry here will violate the repo's release documentation flow; remove it from this commit and let the next version bump collect it. specs/documentation-standard.mdL260-L272
Useful? React with 👍 / 👎.
| println!("\nAdapter directory: {}", adapter_dir.display()); | ||
|
|
||
| // --framework: check/install one specific framework | ||
| if let Some(name) = &framework { |
There was a problem hiding this comment.
Keep --list from triggering installs
When --list is combined with --framework, this framework branch runs before the later list_only check, so tokenless init --list --framework <installable> will execute the install script even though --list is documented as status-only. Make these modes mutually exclusive in clap or honor list_only before any install path.
Useful? React with 👍 / 👎.
| None => { | ||
| frameworks.push(FrameworkInfo { | ||
| name: name.clone(), | ||
| status: DetectStatus::NotChecked, |
There was a problem hiding this comment.
Include the cosh adapter in init installs
For manifest targets without actions (the tokenless cosh target is declared this way), this marks the framework as n/a, and the later install selection only includes Installable entries. As a result, npm users running the new onboarding command never get the supported copilot-shell extension installed by tokenless init --all or the interactive flow; add a cosh action/special-case or omit it from the init-supported frameworks.
Useful? React with 👍 / 👎.
| } | ||
| } | ||
|
|
||
| pub fn run(framework: Option<String>, all: bool, list_only: bool) -> Result<(), (String, i32)> { |
There was a problem hiding this comment.
Document the public init entry point
This new pub fn run is a public Rust item but has no rustdoc. The repo's Rust conventions require /// comments on all public items; either document the entry-point contract or narrow the visibility if it should stay internal.
AGENTS.md reference: AGENTS.md:L111-L115
Useful? React with 👍 / 👎.
1b11b98 to
ee336f5
Compare
Adds `tokenless init` — a community entry point that detects installed agent frameworks via each adapter's detect.sh, reports status (ready / installable / missing prereqs), and runs install.sh for the selected framework. Supports --framework, --all, --list flags and interactive selection when stdin is a terminal. Community users installing via npm no longer need to manually locate and run adapter install scripts; `tokenless init` guides them through framework detection and adapter registration in one step. Assisted-by: Qoder:1.0.45 Signed-off-by: 林生 <linyan.lin@alibaba-inc.com> Co-authored-by: multica-agent <github@multica.ai>
ee336f5 to
8835523
Compare
Summary
Adds a
tokenless initcommand that serves as the community entry point for adapter onboarding. The command detects installed agent frameworks by running each adapter'sdetect.sh, reports status (ready / installable / missing prerequisites), and runsinstall.shfor the selected framework.This addresses the "社区入口改造" (community entry transformation) requirement — community users installing tokenless via npm previously had to manually locate and run adapter install scripts. Now
tokenless initguides them through framework detection and adapter registration in one step.Flags
tokenless init --list— scan and display all framework statusestokenless init --framework <name>— install a specific adaptertokenless init --all— install all installable adapters (non-interactive)tokenless init— interactive selection when stdin is a terminalRelated Issue
no-issue: Multica ANO-1575 (Aone-84758065) Tokenless 社区入口改造
Type / Scope
Testing
cargo fmt --all -- --check— passcargo clippy --workspace --all-targets -- -D warnings— passcargo test --workspace— 375 tests, 0 failurestokenless init --list,--framework <name>(valid/invalid/ready),--all, no-adapter-directory error