MORG-13: Add option to use Claude CLI for AI prompts instead of Anthropic API#42
Closed
developerdavi wants to merge 12 commits intomainfrom
Closed
MORG-13: Add option to use Claude CLI for AI prompts instead of Anthropic API#42developerdavi wants to merge 12 commits intomainfrom
developerdavi wants to merge 12 commits intomainfrom
Conversation
Adds a `claude-cli` backend that calls the local `claude -p` binary instead of hitting the Anthropic API, so users with a Claude subscription but no API key can use AI features (standup, PR descriptions, PR review). - New `ClaudeCLIProvider` implementing `AIProvider` via `claude --print` - `aiProvider` field in `GlobalConfigSchema` (`anthropic-api` | `claude-cli`) - Registry `ai()` returns `ClaudeCLIProvider` when `aiProvider === 'claude-cli'` - Config wizard gains an AI provider `select` prompt; `--show` displays it - Standup error message updated to be provider-agnostic - 9 integration tests for `ClaudeCLIProvider`
clack v1.1 password() can return undefined for empty input; add ?? '' fallback (matching text()) to prevent "Cannot read properties of undefined (reading 'trim')" errors in the config wizard.
--tools is not available in all claude CLI versions; drop it since --print alone is sufficient for text-only completions.
Large prompts (e.g. PR diffs) stall when passed as a CLI argument; piping via stdin handles arbitrary-length input cleanly.
When morg is invoked from within Claude Code, the CLAUDECODE env var is set. The claude binary refuses to run nested sessions and exits with an error. Strip it (and CLAUDE_CODE_ENTRYPOINT) from the child process environment so morg can call claude --print from any context.
Replace the single-line text() prompt for PR body with an @inquirer/editor prompt that opens $EDITOR, allowing full multi-line editing of AI-generated PR descriptions.
These are supported by claude CLI >=2.1.69. The flags were removed during debugging but work correctly with the current version.
Drop the 700KB+ inquirer dependency. The editor() prompt writes initial content to a temp file, opens $VISUAL/$EDITOR/vi with inherited stdio, and reads back the result — same UX, zero new deps.
- Move AI provider select before the API key prompt - Only show the Anthropic API key prompt when user picks 'anthropic-api' - Add 'None (disable AI features)' as a first-class option
Single 'Integrations to enable' multiselect (Jira / Notion / Slack) replaces three separate yes/no prompts. Credentials are only asked for selected providers. Jira and Notion are grouped with a 'tickets provider' hint so users know only one can be active per project.
… support - SYSTEM_PR_DESCRIPTION: enforce ## Ticket / ## Summary / ## Test plan structure with explicit "no title/preamble" instruction - SYSTEM_PR_REVIEW: explicit **What it does** / **Potential concerns** / **Overall assessment** sections - SYSTEM_STANDUP: **Yesterday** / **Today** / **Blockers** structure - prDescriptionPrompt: add ticketId + ticketUrl params; builds linked ticket reference ([ID](url): title) when URL is available - BranchSchema: add ticketUrl field (nullable, default null) - start.ts: store ticket.url as ticketUrl when creating branch entry - track.ts: include ticketUrl: null in new branch entries - pr.ts: pass ticketId + ticketUrl to prDescriptionPrompt
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.
No description provided.