Skip to content

feat(tokenless): add init command for onboarding - #2148

Closed
Forrest-ly wants to merge 1 commit into
alibaba:mainfrom
Forrest-ly:feat/tokenless-init-command
Closed

feat(tokenless): add init command for onboarding#2148
Forrest-ly wants to merge 1 commit into
alibaba:mainfrom
Forrest-ly:feat/tokenless-init-command

Conversation

@Forrest-ly

Copy link
Copy Markdown
Collaborator

Summary

Adds a tokenless init command that serves as the community entry point for adapter onboarding. The command detects installed agent frameworks by running each adapter's detect.sh, reports status (ready / installable / missing prerequisites), and runs install.sh for 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 init guides them through framework detection and adapter registration in one step.

Flags

  • tokenless init --list — scan and display all framework statuses
  • tokenless init --framework <name> — install a specific adapter
  • tokenless init --all — install all installable adapters (non-interactive)
  • tokenless init — interactive selection when stdin is a terminal

Related Issue

no-issue: Multica ANO-1575 (Aone-84758065) Tokenless 社区入口改造

Type / Scope

  • feature
  • tokenless
  • docs

Testing

  • cargo fmt --all -- --check — pass
  • cargo clippy --workspace --all-targets -- -D warnings — pass
  • cargo test --workspace — 375 tests, 0 failures
  • Manual testing: tokenless init --list, --framework <name> (valid/invalid/ready), --all, no-adapter-directory error

@github-actions github-actions Bot added component:tokenless src/tokenless/ scope:documentation ./docs/|./*.md|./NOTICE labels Aug 3, 2026

@qoderai qoderai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本次审查范围内未发现需要修改的问题。


🤖 Generated by QoderView workflow run

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +126 to +127
Some(0) => DetectStatus::Ready,
Some(1) => DetectStatus::Installable,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +308 to +310
match run_install(&adapter_dir, &fw.name, script) {
Ok(()) => println!("{} adapter installed successfully.", fw.name),
Err(e) => eprintln!("{} adapter installation failed: {}", fw.name, e),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +146 to +147
/// Detect installed agent frameworks and install tokenless adapters
Init {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +10 to +12
### 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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)> {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@Forrest-ly
Forrest-ly force-pushed the feat/tokenless-init-command branch from 1b11b98 to ee336f5 Compare August 3, 2026 11:27
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>
@Forrest-ly
Forrest-ly force-pushed the feat/tokenless-init-command branch from ee336f5 to 8835523 Compare August 6, 2026 03:19
@Forrest-ly

Copy link
Copy Markdown
Collaborator Author

Closing in favor of #2264 which supersedes this with the same init command implementation under a cleaner branch. Please track progress on #2264.

@Forrest-ly Forrest-ly closed this Aug 6, 2026
@Forrest-ly
Forrest-ly deleted the feat/tokenless-init-command branch August 6, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:tokenless src/tokenless/ scope:documentation ./docs/|./*.md|./NOTICE

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant