Skip to content

Commit 18e5c3b

Browse files
authored
Merge pull request #96 from golf-mcp/asch/remove-api-boilerplate
Asch/remove api boilerplate
2 parents 69e6031 + 543b12f commit 18e5c3b

File tree

17 files changed

+21
-600
lines changed

17 files changed

+21
-600
lines changed

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ golf --version
6666
- `src/golf/auth/` - Authentication providers (OAuth, API keys)
6767
- `src/golf/telemetry/` - Usage tracking and OpenTelemetry instrumentation
6868
- `src/golf/metrics/` - Prometheus metrics collection
69-
- `src/golf/examples/` - Example projects (basic, api_key templates)
69+
- `src/golf/examples/` - Example projects (basic template)
7070
- `tests/` - Test suite with pytest
7171

7272
## Testing Framework

src/golf/cli/main.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def callback(
8282
def init(
8383
project_name: str = typer.Argument(..., help="Name of the project to create"),
8484
output_dir: Path | None = typer.Option(None, "--output-dir", "-o", help="Directory to create the project in"),
85-
template: str = typer.Option("basic", "--template", "-t", help="Template to use (basic or api_key)"),
8685
) -> None:
8786
"""Initialize a new GolfMCP project.
8887
@@ -92,7 +91,7 @@ def init(
9291
# Show the Golf logo for project initialization
9392
create_welcome_banner(__version__, console)
9493
console.print()
95-
create_command_header("Initialize Project", f"Creating {project_name} with {template} template", console)
94+
create_command_header("Initialize Project", f"Creating {project_name}", console)
9695

9796
# Import here to avoid circular imports
9897
from golf.commands.init import initialize_project
@@ -102,7 +101,7 @@ def init(
102101
output_dir = Path.cwd() / project_name
103102

104103
# Execute the initialization command (it handles its own tracking)
105-
initialize_project(project_name=project_name, output_dir=output_dir, template=template)
104+
initialize_project(project_name=project_name, output_dir=output_dir)
106105

107106

108107
# Create a build group with subcommands

src/golf/commands/init.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,16 @@
2727
def initialize_project(
2828
project_name: str,
2929
output_dir: Path,
30-
template: str = "basic",
3130
) -> None:
32-
"""Initialize a new GolfMCP project with the specified template.
31+
"""Initialize a new GolfMCP project.
3332
3433
Args:
3534
project_name: Name of the project
3635
output_dir: Directory where the project will be created
37-
template: Template to use (basic or api_key)
3836
"""
3937
try:
40-
# Validate template
41-
valid_templates = ("basic", "api_key")
42-
if template not in valid_templates:
43-
console.print(f"[bold red]Error:[/bold red] Unknown template '{template}'")
44-
console.print(f"Available templates: {', '.join(valid_templates)}")
45-
track_command(
46-
"init",
47-
success=False,
48-
error_type="InvalidTemplate",
49-
error_message=f"Unknown template: {template}",
50-
)
51-
return
38+
# Use the basic template by default
39+
template = "basic"
5240

5341
# Check if directory exists
5442
if output_dir.exists():

src/golf/examples/api_key/.env.example

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/golf/examples/api_key/README.md

Lines changed: 0 additions & 133 deletions
This file was deleted.

src/golf/examples/api_key/auth.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/golf/examples/api_key/golf.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/golf/examples/api_key/prompts/welcome.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/golf/examples/api_key/resources/current_time.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/golf/examples/api_key/resources/info.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)