-
-
Notifications
You must be signed in to change notification settings - Fork 5
Migrate to Commander.js and simplify terminal UI #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
8
commits into
main
Choose a base branch
from
copilot/migrate-to-commander-and-copilot
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>
Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>
Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>
Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Migrate Magic Commit to Commander.js and GitHub Copilot SDK
Migrate to Commander.js and simplify terminal UI
Jan 31, 2026
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the
Comment |
Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>
Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>
34 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replaces meow + Ink/React with Commander.js and direct terminal output (figlet/chalk/inquirer). Adds AI provider abstraction layer for GitHub Copilot SDK integration with OpenAI fallback.
Architecture Changes
CLI: meow → Commander.js
auth,commit,configsubcommands-s,-d) preserved with deprecation warningsUI: Ink/React → figlet + chalk + inquirer
Provider Abstraction: New
AIProviderclassFile Structure
Removed:
app.js,utils/{commit,openai}.jsCommand Structure
Notes
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
api.openai.com/usr/local/bin/node node dist/cli.js commit --file test-doc.md(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Magic Commit v0.3.0 - Complete Migration
Objective
Modernize Magic Commit by migrating from meow + Ink to Commander.js + GitHub Copilot SDK with a simplified terminal UI using figlet and chalk.
Requirements
1. Replace CLI Framework
meowpackagecommander(^12.0.0)source/cli.jsto use Commander.js2. Simplify UI/TUI
ink,ink-big-text,ink-gradient,ink-select-input,reactfrom dependenciesfiglet(^1.7.0) for ASCII art bannersinquirer(^9.2.0) for interactive promptschalkfrom devDependencies to dependencies3. Integrate GitHub Copilot SDK
@github/copilot-sdk(^1.0.0 or latest available)source/providers/ai-provider.js- Abstraction layer for Copilot + OpenAI4. New Command Structure
Commands to implement:
Legacy flags (with deprecation warnings):
5. File Structure
Create new files:
source/cli.js(update existing)source/commands/auth.jsauthenticateWithCopilot(token)- GitHub Copilot authauthenticateWithOpenAI(key)- OpenAI auth (legacy)showAuthStatus()- Display current auth statuslogout()- Clear all credentialssource/commands/commit.jscommitCommand(options)- Main commit logicprocessAllFiles(aiProvider, options)- Process all filesprocessFilesInteractively(aiProvider, options)- One-by-oneprocessFile(filePath, aiProvider, options)- Single filesource/commands/config.jsshowConfig()- Display current configresetConfig()- Reset to defaultssource/providers/ai-provider.jsclass AIProvider- Abstraction for AI providersgenerateCommitMessage(diff, filePath, options)- Main methodgenerateWithCopilot(diff, filePath, options)- Copilot implementationgenerateWithOpenAI(diff, filePath, options)- OpenAI implementation (existing logic)buildCleanCommitPrompt(diff, filePath)- Prompt template for Clean Commit formatsource/utils/ui.jsshowBanner()- Figlet ASCII art + chalk colorsshowCommitPreview(message, options)- Show generated messageconfirmCommit(message)- Inquirer prompt for confirmationpromptModelSelection()- Let user choose modelshowSuccess(message)- Success outputshowError(message)- Error outputsource/utils/git.jsgetChangedFiles()- List changed filesstageFile(filePath)- Stage specific filestageAll()- Stage all changesgetDiff(filePath)- Get diff for filecommit(message)- Execute git commitisGitRepository()- Check if in git reposource/utils/config-manager.jsconfpackagesetAuthMode(mode)- Set auth mode (copilot/openai)getAuthMode()- Get current auth modesetToken(provider, token)- Store tokengetToken(provider)- Retrieve tokenclearAll()- Clear all config6. Clean Commit Prompt
The AI provider must use this prompt template for generating commits: