Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .beads/dolt-monitor.pid.lock
Empty file.
41 changes: 34 additions & 7 deletions QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,48 @@ This guide gets you from zero to a working stacked PR flow fast.
## Optional: Enable AI Assistant

```bash
# 1) add one API key to your shell profile
dub ai env --gemini-key "<your-gemini-key>"
# or:
dub ai env --gateway-key "<your-ai-gateway-key>"
# 1) guided setup for Gemini, AI Gateway, or Amazon Bedrock
dub ai setup

# 2) reload your shell
# 2) reload your shell using the command DubStack prints
source ~/.zshrc

# 3) enable assistant for this repo
dub config ai-assistant on

# 4) optional: enable AI defaults
# 4) pin the provider for this repository
dub config ai-provider gemini
# or:
dub config ai-provider gateway
# or:
dub config ai-provider bedrock

# 5) optional: enable AI defaults
dub config ai-defaults create on
dub config ai-defaults submit on
dub config ai-defaults flow on

# 5) ask a question
# 6) ask a question
dub ai ask "Summarize this stack from trunk to current branch"

# optional: inspect recent dub command history/context
dub history --limit 20
```

For Bedrock teams using AWS SSO or role-based auth, the secure non-interactive setup looks like this:

```bash
dub ai env \
--bedrock-profile "bw-sso" \
--bedrock-region "us-west-2" \
--bedrock-model "us.anthropic.claude-sonnet-4-6"

dub config ai-provider bedrock
```

DubStack does not add or manage AWS secret key environment variables for Bedrock.
`dub ai setup` and `dub ai env` print the exact activation command to run after updating your shell profile.

Optional template setup:

```bash
Expand Down Expand Up @@ -136,6 +155,10 @@ Open PR in browser:
dub pr # current branch PR
dub pr 123 # explicit PR
dub pr feat/x # explicit branch

# product shortcuts
dub docs # DubStack docs
dub repo # current repository GitHub page
```

## 5) Respond to Feedback
Expand Down Expand Up @@ -284,6 +307,8 @@ dub undo
| `dub co` | Interactive checkout |
| `dub ss` | Submit stack PRs |
| `dub pr` | Open PR in browser |
| `dub docs` | Open the DubStack docs site |
| `dub repo` | Open the current repository GitHub page |
| `dub sync` | Sync local state with remote |
| `dub doctor` | Run stack health checks |
| `dub ready` | Run pre-submit checklist |
Expand All @@ -298,6 +323,8 @@ dub undo
| `dub continue` / `dub abort` | Resume/cancel interrupted operations |
| `dub undo` | Undo last create/restack |
| `dub config ai-assistant on` | Enable repo-local AI assistant |
| `dub config ai-provider bedrock` | Pin the repo-local AI provider |
| `dub ai setup` | Guided provider/model/env setup |
| `dub ai ask "..."` | Ask AI assistant (streaming + constrained read-only repo shell tool) |
| `dub flow --ai -a` | Stage, preview, create, and submit with AI |
| `dub history` | Show recent Dub command history |
Expand Down
88 changes: 83 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ dub ss

# 5) Open PR for current branch
dub pr

# 6) Open docs or the current repository homepage
dub docs
dub repo
```

For a more detailed walkthrough, see [`QUICKSTART.md`](./QUICKSTART.md).
Expand All @@ -120,6 +124,22 @@ Notes:
- `dub create` auto-initializes state if needed.
- Running `dub init` manually is still useful for explicit setup.

### `dub docs`

Open the DubStack docs site in your browser.

```bash
dub docs
```

### `dub repo`

Open the current repository GitHub page in your browser.

```bash
dub repo
```

### `dub create [branch]`

Create a branch stacked on top of the current branch.
Expand Down Expand Up @@ -611,6 +631,36 @@ dub config ai-defaults submit on
dub config ai-defaults flow on
```

### `dub config ai-provider [auto|gemini|gateway|bedrock]`

Manage the repo-local AI provider selection.

```bash
# inspect current provider
dub config ai-provider

# pin this repository to Bedrock
dub config ai-provider bedrock

# return to backward-compatible auto selection
dub config ai-provider auto
```

### `dub config ai-model [model] --provider <provider>`

Manage repo-local model overrides by provider.

```bash
# inspect current Bedrock override
dub config ai-model --provider bedrock

# set a repo-local override
dub config ai-model "us.anthropic.claude-sonnet-4-6" --provider bedrock

# clear the repo-local override
dub config ai-model --provider bedrock --clear
```

### `dub ai ask <prompt...>`

Ask DubStack's AI assistant using streaming output (`streamText`).
Expand All @@ -625,10 +675,14 @@ In TTY mode, response text streams live while status/tool activity lines are ren
To inspect your repository, `dub ai ask` can invoke a constrained shell tool limited to a strict allow-list of safe, read-only commands (for example `git status`, `dub doctor`, `dub ready`) when command output is needed.
The assistant cannot execute arbitrary shell commands; requests outside this allow-list are rejected, and additional safety checks block destructive command patterns.

Provider/key selection:
- If `DUBSTACK_GEMINI_API_KEY` is set, DubStack uses direct Google provider access with model from `DUBSTACK_GEMINI_MODEL` (default: `gemini-3-flash-preview`).
- Otherwise, if `DUBSTACK_AI_GATEWAY_API_KEY` is set, DubStack uses Vercel AI Gateway with model from `DUBSTACK_AI_GATEWAY_MODEL` (default: `google/gemini-3-flash`).
- If both are set, DubStack prefers `DUBSTACK_GEMINI_API_KEY`.
Provider/model selection:
- Repo config from `dub config ai-provider ...` wins when set to `gemini`, `gateway`, or `bedrock`.
- Repo-local model overrides from `dub config ai-model ...` win for that provider when present.
- In `auto` mode, DubStack preserves the legacy fallback order: Gemini, then AI Gateway, then Bedrock.
- Gemini uses `DUBSTACK_GEMINI_API_KEY` with optional `DUBSTACK_GEMINI_MODEL` override.
- AI Gateway uses `DUBSTACK_AI_GATEWAY_API_KEY` with optional `DUBSTACK_AI_GATEWAY_MODEL` override.
- Bedrock uses `DUBSTACK_BEDROCK_AWS_REGION`, `DUBSTACK_BEDROCK_MODEL`, and optional `DUBSTACK_BEDROCK_AWS_PROFILE`.
- Bedrock support uses AWS credential-chain auth only. DubStack does not manage AWS secret key environment variables.

Thinking is enabled by default for Gemini 3 Flash.

Expand Down Expand Up @@ -656,9 +710,25 @@ pnpm evals:export
The first suite lives at `packages/cli/evals/dub-flow-metadata.eval.ts` and evaluates the pure `generateFlowMetadata(...)` helper used by `dub flow`.
It mixes deterministic contract checks with an AI judge scorer so prompt changes are measured against staged diff fidelity, template preservation, and reviewer usefulness.

### `dub ai setup`

Run the guided setup flow for Gemini, AI Gateway, or Amazon Bedrock.

```bash
dub ai setup
```

The setup wizard helps you:
- choose the repo-local provider
- choose a curated model or enter a custom model ID
- write global provider defaults into your shell profile
- optionally store a repo-local model override

When the wizard writes env vars, DubStack loads them into the current `dub` process and prints the exact command to run in your shell to activate them immediately.

### `dub ai env`

Write DubStack AI keys/models into your shell profile (macOS/Linux shells).
Write DubStack AI provider settings into your shell profile (macOS/Linux shells).

```bash
# write Gemini key
Expand All @@ -673,6 +743,12 @@ dub ai env --gemini-model "gemini-2.5-pro-preview"
# write Gateway model override
dub ai env --gateway-model "google/gemini-2.5-pro"

# write Bedrock profile + region + model
dub ai env \
--bedrock-profile "bw-sso" \
--bedrock-region "us-west-2" \
--bedrock-model "us.anthropic.claude-sonnet-4-6"

# write both
dub ai env --gemini-key "<gemini-key>" --gateway-key "<gateway-key>"

Expand All @@ -687,6 +763,8 @@ Supported automatic profile detection:
- `zsh` → `~/.zshrc`
- `bash` → `~/.bashrc` (or `~/.bash_profile` fallback)

After writing exports, DubStack prints the exact activation command to run in your shell so the new values take effect immediately in your terminal session.

### `dub history`

Inspect recent Dub command history used for troubleshooting context.
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/commands/create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dub create -ai

## AI Mode

When using `--ai` or `-ai`, DubStack analyzes your staged changes and generates a descriptive branch name and conventional commit message. This requires an AI key configured via `dub ai env`.
When using `--ai` or `-ai`, DubStack analyzes your staged changes and generates a descriptive branch name and conventional commit message. Configure the provider with `dub ai setup` or `dub ai env`, then enable the assistant with `dub config ai-assistant on`.

If your repository enables AI create defaults, `--no-ai` lets you force manual mode for a single invocation.

Expand Down
12 changes: 12 additions & 0 deletions apps/docs/content/docs/commands/docs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: dub docs
description: Open the DubStack docs site in your browser.
---

## Usage

```bash
dub docs
```

`dub docs` opens the canonical DubStack documentation site in your default browser.
2 changes: 2 additions & 0 deletions apps/docs/content/docs/commands/meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"title": "Commands",
"pages": [
"docs",
"repo",
"create",
"modify",
"checkout",
Expand Down
14 changes: 14 additions & 0 deletions apps/docs/content/docs/commands/repo.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: dub repo
description: Open the current repository GitHub page in your browser.
---

## Usage

```bash
dub repo
```

`dub repo` resolves the current branch upstream remote first, falls back to `origin`, normalizes common SSH and HTTPS GitHub remotes, and opens the repository homepage in your default browser.

If the current repository does not use GitHub remotes, DubStack fails clearly instead of opening the wrong URL.
2 changes: 2 additions & 0 deletions apps/docs/content/docs/commands/submit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ dub submit --path stack --fix

When AI submit defaults are enabled for the repository, `--no-ai` lets you force a manual PR body update for one run. AI submit only writes the PR description body; the PR title still comes from the last commit message.

Configure the provider with `dub ai setup` or `dub ai env`, then enable the assistant with `dub config ai-assistant on`.

If your repository includes a GitHub pull request template, DubStack asks AI to preserve that template structure when generating the PR description body. Supported locations include `.github/pull_request_template.md`, `.github/PULL_REQUEST_TEMPLATE.md`, `.github/PULL_REQUEST_TEMPLATE/*.md`, `docs/pull_request_template.md`, and `pull_request_template.md`.

```bash
Expand Down
22 changes: 17 additions & 5 deletions apps/docs/content/docs/getting-started/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ Get from zero to a working stacked PR flow fast.
## Optional: Enable AI Assistant

```bash
# Add one API key to your shell profile
dub ai env --gemini-key "<your-gemini-key>"
# or:
dub ai env --gateway-key "<your-ai-gateway-key>"
# Guided setup for Gemini, AI Gateway, or Amazon Bedrock
dub ai setup

# Reload your shell
# Reload your shell with the command DubStack prints
source ~/.zshrc

# Enable assistant for this repo
dub config ai-assistant on

# Pin the provider for this repository
dub config ai-provider bedrock

# Optional: enable AI defaults
dub config ai-defaults create on
dub config ai-defaults submit on
Expand All @@ -45,6 +46,17 @@ dub config ai-defaults flow on
dub ai ask "Summarize this stack from trunk to current branch"
```

For Bedrock teams using AWS SSO or role-based auth, DubStack supports:

```bash
dub ai env \
--bedrock-profile "bw-sso" \
--bedrock-region "us-west-2" \
--bedrock-model "us.anthropic.claude-sonnet-4-6"
```

`dub ai setup` and `dub ai env` both print the exact activation command to run after updating your shell profile.

If you want DubStack AI to follow your repository's formatting, also set up:

- a PR template in `.github/pull_request_template.md` or `.github/PULL_REQUEST_TEMPLATE/*.md`
Expand Down
Loading