Skip to content

Commit 912bfcf

Browse files
nhortonclaude
andauthored
feat: open success page after deepwork setup (#358)
* feat: open success page in browser after deepwork setup Opens https://www.deepwork.md/success in the user's default browser as the final step of `deepwork setup`. Uses Python's stdlib `webbrowser` module for cross-platform compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: add DW-REQ-005.6.8 requirement and test for success page Adds requirement that `deepwork setup` MUST open the success page in the user's default browser. Includes unit test with mocked webbrowser.open. Updates CHANGELOG. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: mock webbrowser.open in all setup CLI tests Adds an autouse fixture to TestSetupCLI so that tests don't actually open a browser window. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 09fa97b commit 912bfcf

4 files changed

Lines changed: 19 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
### Changed
1919

2020
- README install commands consolidated into a single `&&`-joined command ending with `/deepwork:new_user`
21+
- `deepwork setup` now opens `https://www.deepwork.md/success` in the default browser after completing configuration
2122

2223
### Fixed
2324

specs/deepwork/DW-REQ-005-cli-commands.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,4 @@ The DeepWork CLI provides five active commands: `serve` (starts the MCP server),
8787
5. The command MUST preserve existing settings (other plugins, permissions, etc.) when adding DeepWork entries.
8888
6. The command MUST create `~/.claude` and `settings.json` if they do not exist.
8989
7. When no supported platform is detected, the command MUST print a message indicating no platforms were found.
90+
8. After all platform configuration is complete, the command MUST open `https://www.deepwork.md/success` in the user's default browser.

src/deepwork/cli/setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""CLI command: deepwork setup."""
22

3+
import webbrowser
34
from pathlib import Path
45

56
import click
@@ -25,3 +26,5 @@ def setup() -> None:
2526
click.echo("Claude Code — already configured, no changes needed.")
2627
else:
2728
click.echo("No supported AI agent platforms detected (~/.claude not found).")
29+
30+
webbrowser.open("https://www.deepwork.md/success")

tests/unit/test_setup.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import json
66
from pathlib import Path
7+
from unittest.mock import patch
78

89
import click.testing
910
import pytest
@@ -109,6 +110,11 @@ def test_creates_claude_dir(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatc
109110
class TestSetupCLI:
110111
"""Tests for the setup CLI command itself."""
111112

113+
@pytest.fixture(autouse=True)
114+
def _mock_browser(self) -> None: # noqa: PT004
115+
with patch("deepwork.cli.setup.webbrowser.open"):
116+
yield
117+
112118
# THIS TEST VALIDATES A HARD REQUIREMENT (DW-REQ-005.6.1).
113119
# YOU MUST NOT MODIFY THIS TEST UNLESS THE REQUIREMENT CHANGES
114120
def test_setup_is_click_command(self) -> None:
@@ -132,3 +138,11 @@ def test_no_platform_detected(self, tmp_path: Path, monkeypatch: pytest.MonkeyPa
132138
result = runner.invoke(cli, ["setup"])
133139
assert result.exit_code == 0
134140
assert "No supported" in result.output
141+
142+
# THIS TEST VALIDATES A HARD REQUIREMENT (DW-REQ-005.6.8).
143+
# YOU MUST NOT MODIFY THIS TEST UNLESS THE REQUIREMENT CHANGES
144+
def test_opens_success_page(self, claude_home: Path) -> None:
145+
with patch("deepwork.cli.setup.webbrowser.open") as mock_open:
146+
runner = click.testing.CliRunner()
147+
runner.invoke(cli, ["setup"])
148+
mock_open.assert_called_once_with("https://www.deepwork.md/success")

0 commit comments

Comments
 (0)