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
6 changes: 3 additions & 3 deletions puppy_kit/commands/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,11 @@ def test_credentials():
# Check if it's an auth error
error_msg = str(e).lower()
if "401" in error_msg or "403" in error_msg or "authentication" in error_msg:
console.print("[red] Auth FAILED[/red] — check DD_API_KEY and DD_APP_KEY")
console.print("[red]FAIL Auth FAILED[/red] — check DD_API_KEY and DD_APP_KEY")
sys.exit(2)
else:
# Other API errors
console.print(f"[red] API Error[/red] — {e}")
console.print(f"[red]FAIL API Error[/red] — {e}")
sys.exit(1)

# Success
Expand All @@ -299,7 +299,7 @@ def test_credentials():
except Exception:
site = "unknown"

console.print("[green] Auth OK[/green] — credentials are valid")
console.print("[green]OK Auth OK[/green] — credentials are valid")
console.print(f" Site: {site}")

# Try to get the API key from environment or config
Expand Down
2 changes: 1 addition & 1 deletion puppy_kit/commands/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def post_event(title, text, tags, priority):
with console.status("[cyan]Posting event...[/cyan]"):
result = client.events.create_event(body=event_req)

console.print(f"[green] Event posted: {result.event.id}[/green]")
console.print(f"[green]OK Event posted: {result.event.id}[/green]")
console.print(f"[bold]Title:[/bold] {result.event.title}")
if result.event.url:
console.print(f"[bold]URL:[/bold] {result.event.url}")
14 changes: 7 additions & 7 deletions puppy_kit/commands/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def unmute_monitor(monitor_id, scope):

client.monitors.update_monitor(monitor_id, body=MonitorUpdateRequest(**unmute_options))

console.print(f"[green] Monitor {monitor_id} unmuted[/green]")
console.print(f"[green]OK Monitor {monitor_id} unmuted[/green]")


@monitor.command(name="validate")
Expand All @@ -283,12 +283,12 @@ def validate_monitor(monitor_type, query):

# Check if result has errors
if hasattr(result, "errors") and result.errors:
console.print("[red] Monitor definition is invalid[/red]")
console.print("[red]FAIL Monitor definition is invalid[/red]")
for error in result.errors: # ty:ignore[not-iterable]
console.print(f" • {error}")
sys.exit(1)
else:
console.print("[green] Monitor definition is valid[/green]")
console.print("[green]OK Monitor definition is valid[/green]")


@monitor.command(name="create")
Expand Down Expand Up @@ -360,7 +360,7 @@ def create_monitor_cmd(
if fmt == "json":
click.echo(json.dumps(json_list_response(result.to_dict()), default=json_default))
else:
console.print(f"[green] Monitor {result.id} created[/green]")
console.print(f"[green]OK Monitor {result.id} created[/green]")
console.print(f"[bold]Name:[/bold] {result.name}")


Expand Down Expand Up @@ -431,7 +431,7 @@ def update_monitor_cmd(
if fmt == "json":
click.echo(json.dumps(json_list_response(result.to_dict()), default=json_default))
else:
console.print(f"[green] Monitor {monitor_id} updated[/green]")
console.print(f"[green]OK Monitor {monitor_id} updated[/green]")
console.print(f"[bold]Name:[/bold] {result.name}")


Expand All @@ -453,7 +453,7 @@ def mute_all_monitors(message):
with console.status("[cyan]Muting all monitors...[/cyan]"):
result = client.downtimes.create_downtime(body=downtime_body)

console.print("[green] All monitors muted[/green]")
console.print("[green]OK All monitors muted[/green]")
console.print(f"[dim]Downtime ID: {result.id}[/dim]")


Expand All @@ -478,5 +478,5 @@ def unmute_all_monitors():
client.downtimes.cancel_downtime(dt.id)

console.print(
f"[green] All monitors unmuted ({len(global_downtimes)} downtime(s) cancelled)[/green]"
f"[green]OK All monitors unmuted ({len(global_downtimes)} downtime(s) cancelled)[/green]"
)
8 changes: 7 additions & 1 deletion puppy_kit/mcp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,5 +558,11 @@ def dd_dashboards_get(dashboard_id: str) -> str:
# Entry point
# ---------------------------------------------------------------------------

if __name__ == "__main__":

def main() -> None:
"""Entry point for the puppy-mcp console script."""
mcp.run()


if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ dev = [
[project.scripts]
puppy = "puppy_kit.cli:run"
puppy-kit = "puppy_kit.cli:run"
puppy-mcp = "puppy_kit.mcp.server:main"

[project.urls]
Homepage = "https://github.com/WrenchAI/puppy-kit"
Expand Down
Loading