Skip to content

feat(ai): add assistant context and command history#12

Merged
dubscode merged 1 commit intomainfrom
feat/ai-assistant-context-history
Feb 21, 2026
Merged

feat(ai): add assistant context and command history#12
dubscode merged 1 commit intomainfrom
feat/ai-assistant-context-history

Conversation

@dubscode
Copy link
Copy Markdown
Contributor

@dubscode dubscode commented Feb 21, 2026


🥞 DubStack

Copilot AI review requested due to automatic review settings February 21, 2026 18:28
@dubscode dubscode merged commit dd88390 into main Feb 21, 2026
6 checks passed
@dubscode dubscode deleted the feat/ai-assistant-context-history branch February 21, 2026 18:32
Copy link
Copy Markdown

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 AI assistant functionality to DubStack, enabling context-aware help through Google Gemini integration. It includes command history tracking with sensitive data redaction, repository-local configuration management, and utilities for setting up AI API keys.

Changes:

  • Implements command history capture system that records all dub commands with output redaction for sensitive data (API keys, tokens, etc.)
  • Adds AI assistant with context collection (branch state, git status, doctor output, recent command history) and streaming chat interface
  • Introduces repo-local configuration for enabling/disabling the AI assistant per repository

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/lib/history.ts Command history tracking with JSONL storage and sensitive data redaction patterns
src/lib/history.test.ts Tests for history append/read, command arg sanitization, and text redaction
src/lib/config.ts Repo-local config management (stored in .git/dubstack/config.json)
src/lib/config.test.ts Tests for config read/write and error handling
src/lib/ai-context.ts Collects repository context (branch, stack, doctor, history) for AI assistant
src/lib/ai-context.test.ts Tests for context collection and prompt building
src/commands/history.ts Command to display recent dub history with formatting
src/commands/history.test.ts Tests for history command output formatting
src/commands/config.ts Command to enable/disable AI assistant
src/commands/config.test.ts Tests for config command state management
src/commands/ai.ts AI assistant with Google Gemini and AI Gateway provider support
src/commands/ai.test.ts Tests for AI provider selection and streaming output
src/commands/ai-env.ts Utility to write API keys to shell profile files
src/commands/ai-env.test.ts Tests for env command with profile updates
src/index.ts CLI command registration and history capture hooks (preAction/postAction)
package.json Adds @ai-sdk/google and ai dependencies
pnpm-lock.yaml Lockfile updates for AI SDK dependencies
pnpm-workspace.yaml Explicitly adds packages field for workspace config
README.md Documentation for new AI commands (config, ask, env, history)
QUICKSTART.md Quick start guide for enabling and using AI assistant
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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

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