Skip to content

Open-source status page, incident response and uptime monitoring

feat: cli card (#1276)

Maximilian Kaskeff935d91fea4
diff --git a/apps/web/src/app/page.tsx b/apps/web/src/app/page.tsx
index 43637bbe3..3806914ee 100644
--- a/apps/web/src/app/page.tsx
+++ b/apps/web/src/app/page.tsx
@@ -1,5 +1,6 @@
import { MarketingLayout } from "@/components/layout/marketing-layout";
import { AlertCard } from "@/components/marketing/alert/card";
+import { CLICard } from "@/components/marketing/cli/card";
import { Hero } from "@/components/marketing/hero";
import { BottomCTA, MiddleCTA } from "@/components/marketing/in-between-cta";
import { LatestChangelogs } from "@/components/marketing/lastest-changelogs";
@@ -21,6 +22,7 @@ export default async function Page() {
<MiddleCTA />
<StatusPageCard />
<AlertCard />
+ <CLICard />
<BottomCTA />
<LatestChangelogs />
</div>
diff --git a/apps/web/src/components/marketing/cli/card.tsx b/apps/web/src/components/marketing/cli/card.tsx
new file mode 100644
index 000000000..07598a0d5
--- /dev/null
+++ b/apps/web/src/components/marketing/cli/card.tsx
@@ -0,0 +1,32 @@
+import { cardConfig } from "@/config/features";
+import {
+ CardContainer,
+ CardContent,
+ CardFeature,
+ CardFeatureContainer,
+ CardHeader,
+ CardIcon,
+ CardTitle,
+} from "../card";
+import { Terminal } from "./terminal";
+
+export function CLICard() {
+ const { icon, title, features } = cardConfig.cli;
+ return (
+ <CardContainer>
+ <CardHeader>
+ <CardIcon icon={icon} />
+ <CardTitle>{title}</CardTitle>
+ </CardHeader>
+ <CardContent>
+ <Terminal />
+ <CardFeatureContainer>
+ {features?.map((feature, i) => (
+ // biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
+ <CardFeature key={i} {...feature} />
+ ))}
+ </CardFeatureContainer>
+ </CardContent>
+ </CardContainer>
+ );
+}
diff --git a/apps/web/src/components/marketing/cli/terminal.tsx b/apps/web/src/components/marketing/cli/terminal.tsx
new file mode 100644
index 000000000..7478b6b32
--- /dev/null
+++ b/apps/web/src/components/marketing/cli/terminal.tsx
@@ -0,0 +1,45 @@
+"use client";
+
+import { useCopyToClipboard } from "@/hooks/use-copy-to-clipboard";
+import { cn } from "@/lib/utils";
+import { Button } from "@openstatus/ui";
+import { CheckIcon, CopyIcon } from "lucide-react";
+import type React from "react";
+
+const command = "openstatus monitors trigger 420";
+
+export function Terminal({ className, ...props }: React.ComponentProps<"pre">) {
+ const { copy, isCopied } = useCopyToClipboard();
+
+ function handleCopy() {
+ copy(command, { withToast: true });
+ }
+
+ return (
+ <div className="flex items-center w-full">
+ <pre
+ className={cn(
+ "bg-muted/50 w-full rounded-lg px-4 py-2 flex items-center gap-2 border",
+ className,
+ )}
+ {...props}
+ >
+ <code className="text-sm">
+ <span className="text-muted-foreground">$</span> {command}
+ </code>
+ <Button
+ variant="ghost"
+ size="icon"
+ onClick={handleCopy}
+ className="ml-auto -mr-2 hover:bg-transparent"
+ >
+ {isCopied ? (
+ <CheckIcon className="size-4" />
+ ) : (
+ <CopyIcon className="size-4" />
+ )}
+ </Button>
+ </pre>
+ </div>
+ );
+}
diff --git a/apps/web/src/config/features.ts b/apps/web/src/config/features.tsx
similarity index 81%
rename from apps/web/src/config/features.ts
rename to apps/web/src/config/features.tsx
index 8551295e5..77f3bdc3d 100644
--- a/apps/web/src/config/features.ts
+++ b/apps/web/src/config/features.tsx
@@ -1,4 +1,5 @@
import type { ValidIcon } from "@/components/icons";
+import { Terminal } from "@/components/marketing/cli/terminal";
export type Feature = {
icon: ValidIcon;
@@ -102,4 +103,28 @@ export const cardConfig = {
},
],
},
+ cli: {
+ icon: "terminal",
+ title: "CLI",
+ features: [
+ {
+ icon: "sparkles",
+ catchline: "No ClickOps",
+ description: (
+ <p>
+ Use your config file to manage or trigger your monitors. Never leave
+ your terminal.{" "}
+ <a
+ className="text-foreground"
+ href="https://docs.openstatus.dev/cli/getting-started/"
+ target="_blank"
+ rel="noreferrer"
+ >
+ Learn more
+ </a>
+ </p>
+ ),
+ },
+ ],
+ },
} satisfies Record<string, Feature>;