Fix CLI after PR #66: multi-word search, missing commands, terminal rendering#91
Merged
Conversation
Co-authored-by: AdmGenSameer <154604600+AdmGenSameer@users.noreply.github.com>
Co-authored-by: AdmGenSameer <154604600+AdmGenSameer@users.noreply.github.com>
Co-authored-by: AdmGenSameer <154604600+AdmGenSameer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix critical bugs introduced by PR #66 merge
Fix CLI after PR #66: multi-word search, missing commands, terminal rendering
Dec 9, 2025
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
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.
Description
PR #66 introduced critical regressions: multi-word searches broke, three commands disappeared from CLI, and a 200-line argparse block conflicted with Typer implementation.
Related Issue
Issue details provided in problem statement.
Changes Made
Core Fixes
query: str→query: List[str]with space-joinsuggest,upgrade,webUI Improvements
PANEL_PADDINGconstant) to all Rich tables/panelsBefore:
After:
Metrics
Screenshots or GIFs (if applicable)
Commands now in help:
Checklist
.prettierrc(if present).Additional Notes
Verified with CodeQL (0 vulnerabilities) and code review. Multi-word searches tested:
archpkg search visual studio code,archpkg suggest video editing.Original prompt
Critical Issues After PR #66 Merge
Multiple serious bugs were introduced after merging PR #66. The CLI is broken and needs comprehensive fixes.
Issue 1: Missing
argparseImportError:
Location:
archpkg/cli.pyline 671Fix: Add
import argparseat the top of the file with other imports.Issue 2: Multi-word Search Queries Broken
Error:
Current code (line 586):
Fix: Change to accept multiple arguments and join them:
Then join with spaces inside the function.
Issue 3: The
searchCommand Has Broken/Duplicate LogicThe
searchcommand (starting at line 584) contains old argparse-based code mixed with new Typer code. Lines 601-803 contain a massive block of argparse code that:argparse.ArgumentParser(but argparse isn't imported)Fix: Remove the entire argparse block (lines 601-803) from the
searchcommand and implement proper Typer-based search logic.Issue 4: Missing
--webCommandThe web interface was added (
archpkg/web.py) but there's no command to launch it.Fix: Add a new Typer command:
Issue 5: Missing Commands in Help
The current
--helponly shows:search,update,config,list-installed,serviceMissing commands that should be restored/added:
suggest- Get app suggestions based on purpose (was in original code)upgrade- Upgrade archpkg from GitHub (was in original code)web- Launch web interface (new feature from PR feat: Add comprehensive package management features with web interface and update management #66)install- Direct package installation (if it existed before)Issue 6: Terminal Box Rendering on Small Screens
Rich panels and tables break on smaller terminal windows.
Fix: Add console width detection and adjust output:
Issue 7: Orphaned
else:Block (Syntax Error)Lines 1047-1067 contain an orphaned
else:block that causes a syntax error. This was identified earlier and needs to be removed.Summary of Required Changes in
archpkg/cli.py:import argparseat line 6 (or remove argparse usage entirely)searchcommand:List[str]for query to support multi-word searchessuggestcommand: Restore the suggest functionality as a proper Typer commandupgradecommand: Restore as a proper Typer commandwebcommand: New command to launch Flask web interfaceelse:block: Delete lines 1047-1067Reference: Original Working CLI Structure
The CLI should support these commands and options: