Skip to content

feat(MORG-54): add morg ls and make default morg context-aware#45

Merged
developerdavi merged 6 commits intomainfrom
MORG-54
Mar 10, 2026
Merged

feat(MORG-54): add morg ls and make default morg context-aware#45
developerdavi merged 6 commits intomainfrom
MORG-54

Conversation

@developerdavi
Copy link
Owner

Ticket

MORG-54: Move current "morg" command to "morg ls"

Summary

  • Renamed renderStatus()renderBranches() in ui/output.ts to better reflect its purpose
  • Added src/commands/ls.ts: morg ls (alias: morg branches) now shows the multi-branch table — preserving the old morg default behavior
  • Exported runStatusDetail() from status.ts for use in the default action
  • Replaced default morg (no subcommand) with context-aware logic:
    • On a tracked branch → shows the rich single-branch detail panel (ticket, PR, CI, commits, diff)
    • On an untracked branch → shows morg ls table + hint: "not being tracked → morg track"
    • If repo is not initialized → falls back to renderBranches() gracefully

Test plan

  • morg ls → shows the branch table (same as old morg)
  • morg branches → same (alias)
  • morg on main (untracked) → shows branch table + "not being tracked" message
  • morg on a tracked feature branch → shows detailed status panel

- Rename `renderStatus()` → `renderBranches()` in `ui/output.ts` to better reflect what it renders
- Export `runStatusDetail()` from `status.ts`
- Add `src/commands/ls.ts`: `morg ls` / `morg branches` shows the multi-branch table (old default behavior)
- Replace default `morg` action with context-aware logic:
  - On a tracked branch → `runStatusDetail()` (rich single-branch view)
  - Otherwise → `renderBranches()` + "not being tracked" hint
… command structure

- Add 'ls' to shell-init COMMANDS array for tab completion
- README: update 'What it does' blurb and Status section to document morg/morg ls/morg status
- skill.md: update Viewing Status and workflow examples for new commands
- CLAUDE.md: add rule to always keep README, skill, and shell-init in sync when changing commands
@developerdavi developerdavi merged commit 17278d4 into main Mar 10, 2026
@developerdavi developerdavi deleted the MORG-54 branch March 10, 2026 15:49
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