Skip to content

feat(generate): implement registerCandidates to copy generated CLIs to user directory#310

Open
0xsline wants to merge 3 commits intojackwener:mainfrom
0xsline:feat/implement-register-candidates-clean
Open

feat(generate): implement registerCandidates to copy generated CLIs to user directory#310
0xsline wants to merge 3 commits intojackwener:mainfrom
0xsline:feat/implement-register-candidates-clean

Conversation

@0xsline
Copy link
Contributor

@0xsline 0xsline commented Mar 23, 2026

Summary

  • Implement the previously stubbed registerCandidates function in src/generate.ts
  • Generated CLI YAML files are now actually copied to the user's CLI directory (~/.opencli/clis/)
  • Reads candidates.json from the synthesize output directory to locate candidate YAML files
  • Supports filtering by name when opts.name is provided
  • Skips existing files with a warning to avoid overwriting user customizations
  • Creates the user CLI directory if it doesn't exist

Motivation

The registerCandidates function was a stub returning { ok: true, count: 0 }, meaning opencli generate and opencli record workflows completed without error but silently registered nothing. Users received misleading success feedback.

Test plan

  • 309/309 existing tests pass
  • opencli generate <url> now copies YAML to ~/.opencli/clis/
  • Running generate twice does not overwrite existing CLIs

0xsline added 3 commits March 24, 2026 00:00
…o user directory

- Read candidates.json index from synthesize output directory
- Copy matched YAML files to ~/.opencli/clis/ (or opts.userClis)
- Support optional name filter to register only a specific candidate
- Create user CLI directory if it does not exist
- Warn and skip files that already exist to avoid overwriting
- Remove TODO comment and stub implementation; return real count
Fix dead link in docs/adapters/index.md that references
/adapters/desktop/doubao-app but the page did not exist.
This was causing vitepress docs-build to fail.
- doubao-app.md: accept upstream version (table format)
- generate.ts: remove stale no-op stub comment (function is now implemented)
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.

1 participant