Skip to content

feat: add cli agent choice#23

Merged
leggetter merged 10 commits intohookdeck:mainfrom
FusionAuth:mooreds/add-cli-choice
Feb 5, 2026
Merged

feat: add cli agent choice#23
leggetter merged 10 commits intohookdeck:mainfrom
FusionAuth:mooreds/add-cli-choice

Conversation

@mooreds
Copy link
Contributor

@mooreds mooreds commented Feb 4, 2026

This PR adds the option for using a different CLI than claude. The default remains claude, but now you can pass in another cli tool if that's what you prefer.

Needed abstraction and support for the copilot CLI was added.

It also updates the documentation with information about using the new option.

@mooreds
Copy link
Contributor Author

mooreds commented Feb 4, 2026

Oops, I don't know how to edit the PR and add the feat: prefix. Sorry!

@leggetter leggetter changed the title Add cli choice feat: add cli agent choice Feb 4, 2026
@leggetter
Copy link
Collaborator

@claude please review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for using different CLI tools (not just Claude) to generate and review webhook skills. The implementation introduces a pluggable adapter system where each CLI tool can have its own configuration and command structure. The default remains claude for backward compatibility, but users can now specify alternative tools like copilot via the --cli flag.

Changes:

  • Added a CLI adapter system with interfaces and factory pattern for supporting multiple AI CLI tools
  • Renamed claude.ts to cli.ts and refactored it to be CLI-agnostic
  • Added adapters for Claude CLI and Copilot CLI
  • Threaded cliTool option through all relevant functions and types
  • Updated documentation with examples and instructions for using different CLI tools and adding new adapters

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
scripts/skill-generator/lib/types.ts Added cliTool field to BaseOptions interface
scripts/skill-generator/lib/reviewer.ts Updated imports and threaded cliTool option through review functions
scripts/skill-generator/lib/generator.ts Updated imports and threaded cliTool option through generation functions
scripts/skill-generator/lib/cli.ts Refactored from claude.ts to support multiple CLI tools via adapters
scripts/skill-generator/lib/cli-adapters/types.ts Defined interfaces for CLI adapter system
scripts/skill-generator/lib/cli-adapters/index.ts Implemented adapter registry and factory function
scripts/skill-generator/lib/cli-adapters/copilot.ts Added Copilot CLI adapter implementation
scripts/skill-generator/lib/cli-adapters/claude.ts Added Claude CLI adapter implementation
scripts/skill-generator/index.ts Added CLI tool options to commands and updated imports
CONTRIBUTING.md Updated prerequisites, added CLI tool usage examples, and documented how to add new CLI adapters
Comments suppressed due to low confidence (1)

scripts/skill-generator/lib/cli.ts:10

  • Unused import DEFAULT_MODEL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

CONTRIBUTING.md Outdated
- **[Claude CLI](https://docs.anthropic.com/en/docs/claude-cli)** — Install and authenticate with `claude login`
- **AI CLI Tool** — One of the following:
- [Claude CLI](https://docs.anthropic.com/en/docs/claude-cli) — Install and authenticate with `claude login` (default)
- [Copilot CLI](https://githubnext.com/projects/copilot-cli) — GitHub Copilot command-line tool
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The URL for the Copilot CLI points to githubnext.com which was GitHub's experimental playground. Please verify this is the correct and current URL for the GitHub Copilot CLI tool. The CLI may have moved to a different location or the project may have been deprecated or renamed. Consider checking the official GitHub Copilot documentation for the correct installation instructions.

Suggested change
- [Copilot CLI](https://githubnext.com/projects/copilot-cli) — GitHub Copilot command-line tool
- [Copilot CLI](https://docs.github.com/en/copilot/github-copilot-in-the-cli/github-copilot-in-the-cli) — GitHub Copilot command-line tool

Copilot uses AI. Check for mistakes.

import type { CliAdapter, CliAdapterOptions, CliCommandConfig } from './types';

const DEFAULT_MODEL = 'claude-opus-4-20250514';
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

DEFAULT_MODEL needs to be exported from this file since it's imported by cli-adapters/index.ts. Change const DEFAULT_MODEL to export const DEFAULT_MODEL to fix the import error.

Suggested change
const DEFAULT_MODEL = 'claude-opus-4-20250514';
export const DEFAULT_MODEL = 'claude-opus-4-20250514';

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not applicable any more.

.option('--config <file>', 'Load provider configs from YAML file')
.option('--model <model>', 'Claude model to use', DEFAULT_MODEL)
.option('--cli <tool>', `CLI tool to use (${AVAILABLE_CLI_TOOLS.join(', ')})`, DEFAULT_CLI_TOOL)
.option('--model <model>', 'Model to use', DEFAULT_MODEL)
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The default model is hardcoded to Claude's default ('claude-opus-4-20250514') regardless of which CLI tool is selected. When a user specifies --cli copilot without --model, they will get Claude's default model instead of Copilot's default model. Consider removing the default value from the --model option and passing undefined to the adapter when no model is specified, allowing each adapter to use its own appropriate default model.

Copilot uses AI. Check for mistakes.
.option('--config <file>', 'Load provider configs from YAML file')
.option('--model <model>', 'Claude model to use', DEFAULT_MODEL)
.option('--cli <tool>', `CLI tool to use (${AVAILABLE_CLI_TOOLS.join(', ')})`, DEFAULT_CLI_TOOL)
.option('--model <model>', 'Model to use', DEFAULT_MODEL)
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The default model is hardcoded to Claude's default ('claude-opus-4-20250514') regardless of which CLI tool is selected. When a user specifies --cli copilot without --model, they will get Claude's default model instead of Copilot's default model. Consider removing the default value from the --model option and passing undefined to the adapter when no model is specified, allowing each adapter to use its own appropriate default model.

Copilot uses AI. Check for mistakes.
@mooreds mooreds requested a review from Copilot February 5, 2026 03:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 115 to 116
// Re-export DEFAULT_MODEL from cli-adapters for backwards compatibility
export { DEFAULT_MODEL } from './cli-adapters';
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

This re-export creates a circular dependency concern since DEFAULT_MODEL is originally defined in cli-adapters/claude.ts but exported through cli-adapters/index.ts, then re-exported here. Consider removing this re-export and updating imports to use the canonical source from './cli-adapters' directly.

Copilot uses AI. Check for mistakes.
Comment on lines 8 to 14
import { claudeAdapter, DEFAULT_MODEL } from './claude';
import { copilotAdapter } from './copilot';

// Re-export types and default model
export type { CliAdapter, CliAdapterOptions, CliCommandConfig } from './types';
export { DEFAULT_MODEL };

Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

DEFAULT_MODEL is being exported from the index but is specific to the Claude adapter. This creates an implicit assumption that Claude's default model is the global default. Consider either defining DEFAULT_MODEL at the index level or having each adapter export its own default and letting the consumer choose which to use based on the selected CLI tool.

Suggested change
import { claudeAdapter, DEFAULT_MODEL } from './claude';
import { copilotAdapter } from './copilot';
// Re-export types and default model
export type { CliAdapter, CliAdapterOptions, CliCommandConfig } from './types';
export { DEFAULT_MODEL };
import { claudeAdapter } from './claude';
import { copilotAdapter } from './copilot';
// Re-export types
export type { CliAdapter, CliAdapterOptions, CliCommandConfig } from './types';

Copilot uses AI. Check for mistakes.
.option('--config <file>', 'Load provider configs from YAML file')
.option('--model <model>', 'Claude model to use', DEFAULT_MODEL)
.option('--cli <tool>', `CLI tool to use (${AVAILABLE_CLI_TOOLS.join(', ')})`, DEFAULT_CLI_TOOL)
.option('--model <model>', 'Model to use', undefined)
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The help text 'Model to use' is vague and doesn't indicate what happens when undefined (uses CLI tool's default). Consider changing to 'Model to use (defaults to CLI tool's default model)' for clarity.

Copilot uses AI. Check for mistakes.
.option('--config <file>', 'Load provider configs from YAML file')
.option('--model <model>', 'Claude model to use', DEFAULT_MODEL)
.option('--cli <tool>', `CLI tool to use (${AVAILABLE_CLI_TOOLS.join(', ')})`, DEFAULT_CLI_TOOL)
.option('--model <model>', 'Model to use', undefined)
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The help text 'Model to use' is vague and doesn't indicate what happens when undefined (uses CLI tool's default). Consider changing to 'Model to use (defaults to CLI tool's default model)' for clarity.

Copilot uses AI. Check for mistakes.
@mooreds mooreds requested a review from Copilot February 5, 2026 03:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 115 to 117
// Re-export DEFAULT_MODEL from cli-adapters for backwards compatibility
export { DEFAULT_MODEL } from './cli-adapters';

Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The DEFAULT_MODEL is being re-exported for backwards compatibility after being removed from this file, but this creates a duplicate export. Lines 115-116 re-export DEFAULT_MODEL from cli-adapters, while the original export on line 117 in the diff context was supposed to be removed. Remove the duplicate export statement.

Suggested change
// Re-export DEFAULT_MODEL from cli-adapters for backwards compatibility
export { DEFAULT_MODEL } from './cli-adapters';

Copilot uses AI. Check for mistakes.
.option('--config <file>', 'Load provider configs from YAML file')
.option('--model <model>', 'Claude model to use', DEFAULT_MODEL)
.option('--cli <tool>', `CLI tool to use (${AVAILABLE_CLI_TOOLS.join(', ')})`, DEFAULT_CLI_TOOL)
.option('--model <model>', "Model to use (defaults to CLI tool's default model)", undefined)
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The help text states 'defaults to CLI tool's default model', but doesn't indicate what those defaults are. Consider mentioning that Claude defaults to 'claude-opus-4-20250514' and Copilot to 'gpt-4o', or link to documentation where users can find this information.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we can assume folks know how to find the model for their given CLI.

@mooreds mooreds requested a review from Copilot February 5, 2026 03:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mooreds
Copy link
Contributor Author

mooreds commented Feb 5, 2026

@leggetter I think this is ready for human eyes or whatever the next step is :)

@leggetter
Copy link
Collaborator

Hi @mooreds! 👋

Thank you for this excellent foundation for the CLI adapter system! We've tested it extensively and found a few fixes needed for Copilot CLI compatibility:

  1. --allow-all-tools--allow-all: The former blocks URL fetches in non-interactive mode, which caused failures when the agent tried to fetch documentation
  2. Default model: Changed from gpt-4o to claude-sonnet-4 as gpt-5 has issues with web fetching
  3. CLI validation: Added Commander's choices() for better error messages

We've created PR #29 which builds on your work with these fixes. It includes Co-authored-by attribution in the commits.

We successfully generated two skills using both adapters:

Thanks again for the great work on the adapter architecture! 🙏

@leggetter leggetter merged commit e8f7fc5 into hookdeck:main Feb 5, 2026
22 checks passed
@mooreds
Copy link
Contributor Author

mooreds commented Feb 5, 2026

Excellent, glad it helped!

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