Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
3a79286
feat: add commands
ogzhanolguncu Jul 14, 2025
30531e7
feat: allow configuring name,desc and version
ogzhanolguncu Jul 14, 2025
53e33f9
feat: pass env to cli
ogzhanolguncu Jul 14, 2025
cc55b1d
feat: match the initial impl
ogzhanolguncu Jul 14, 2025
82d3393
feat: add new progress aniamtion
ogzhanolguncu Jul 14, 2025
d05bce4
feat: add tracker step for each phase
ogzhanolguncu Jul 14, 2025
9e1b02a
refactor: improve animations and errors
ogzhanolguncu Jul 15, 2025
aa7cde2
feat: use proper orchestrafor managing steps and trackers
ogzhanolguncu Jul 15, 2025
454828e
refactor: rename build to run
ogzhanolguncu Jul 15, 2025
f058067
refactor: remove UI logic from api
ogzhanolguncu Jul 15, 2025
7e1a3b4
chore: remove redundant commands
ogzhanolguncu Jul 15, 2025
238c658
refactor: remove ui bloat
ogzhanolguncu Jul 15, 2025
e8ab3dc
feat: add colors for make it distinguishable
ogzhanolguncu Jul 15, 2025
2cd7fa4
Merge branch 'main' into ENG-1903
ogzhanolguncu Jul 15, 2025
9152767
fix: steps
ogzhanolguncu Jul 15, 2025
52fe00d
fix: code rabbit issues
ogzhanolguncu Jul 15, 2025
f80dd82
feat: add proper flag parsing logic
ogzhanolguncu Jul 16, 2025
496a994
refactor: show help if required args are missing
ogzhanolguncu Jul 16, 2025
b8f964f
feat: add missing commands
ogzhanolguncu Jul 16, 2025
1f5b476
fix: code rabbit comments
ogzhanolguncu Jul 16, 2025
74f407a
refactor: fix redundancy
ogzhanolguncu Jul 16, 2025
2a8f0ed
Merge branch 'main' into ENG-1903
ogzhanolguncu Jul 16, 2025
c93dfdd
feat: add config generation
ogzhanolguncu Jul 16, 2025
ecbe3f2
chore: fmt
ogzhanolguncu Jul 16, 2025
5a83cce
Merge branch 'main' of github.com:unkeyed/unkey into add-config-gener…
ogzhanolguncu Jul 17, 2025
d6e0edd
fix: change final output of success
ogzhanolguncu Jul 17, 2025
550d22f
feat: replace old cli with new cli
ogzhanolguncu Jul 17, 2025
9f90f23
Merge branch 'main' of github.com:unkeyed/unkey into add-config-gener…
ogzhanolguncu Jul 21, 2025
2040a9a
fix: ui order
ogzhanolguncu Jul 21, 2025
11510ce
fix: docker errors
ogzhanolguncu Jul 21, 2025
4b2ed82
refactor: improve error handling
ogzhanolguncu Jul 21, 2025
2e450ef
refactor: move constants to top
ogzhanolguncu Jul 21, 2025
1e9f186
refactor: add some delay to version poll
ogzhanolguncu Jul 21, 2025
7f73b9c
refactor: replace old cli with new one
ogzhanolguncu Jul 21, 2025
395fb5f
fix: code rabit issues
ogzhanolguncu Jul 21, 2025
6ef87a2
fix: coderabbit issue
ogzhanolguncu Jul 21, 2025
2796519
docs: explain artificial delay
chronark Jul 22, 2025
86f0c40
fix: PR comments
ogzhanolguncu Jul 22, 2025
117d081
Merge branch 'add-config-generation-to-cli' of github.com:unkeyed/unk…
ogzhanolguncu Jul 22, 2025
b17db16
fix: coderabbit comment
ogzhanolguncu Jul 22, 2025
dedb385
fix: use hardcoded strings for temp docker build
ogzhanolguncu Jul 22, 2025
399f4e5
feat: generate docs from cli
ogzhanolguncu Jul 22, 2025
24d070f
feat: also call sub commands when generating
ogzhanolguncu Jul 22, 2025
94247ae
Merge branch 'main' of github.com:unkeyed/unkey into generate-docs-fr…
ogzhanolguncu Jul 23, 2025
65dec03
refactor: improve mdxs
ogzhanolguncu Jul 23, 2025
2e29e62
fix: sub command generation
ogzhanolguncu Jul 23, 2025
797092b
chore: test generated files
ogzhanolguncu Jul 24, 2025
a693277
chore: trigger build
ogzhanolguncu Jul 24, 2025
9b27bd4
chore: trigger build
ogzhanolguncu Jul 24, 2025
39c3960
chore: trigger test
ogzhanolguncu Jul 24, 2025
8657647
chore: trigger another one
ogzhanolguncu Jul 24, 2025
85ca42a
chore: triggering.
ogzhanolguncu Jul 24, 2025
cefbf68
chore: generate cli commands docs
ogzhanolguncu Jul 24, 2025
586fe95
Merge branch 'main' into generate-docs-from-cli
ogzhanolguncu Jul 24, 2025
d2a182a
fix: remove unused code
ogzhanolguncu Jul 24, 2025
8ab6269
refactor: errors
ogzhanolguncu Jul 24, 2025
ff4dfe7
refactor: add example comments
ogzhanolguncu Jul 24, 2025
d16d202
refactor: add more descriptive comments
ogzhanolguncu Jul 24, 2025
f2ace8c
refactor: use compiled regex table
ogzhanolguncu Jul 24, 2025
b0a7cb3
fix: get rid of enVars
ogzhanolguncu Jul 24, 2025
b178f77
fix: get rid of special mdx escapes
ogzhanolguncu Jul 25, 2025
531b456
fix: descriptions
ogzhanolguncu Jul 25, 2025
4653fba
chore: replace generated docs
ogzhanolguncu Jul 25, 2025
1682029
Merge branch 'main' into generate-docs-from-cli
ogzhanolguncu Jul 25, 2025
caa6742
Update index.mdx
chronark Jul 28, 2025
7bf50d0
docs: move cli to its own section
chronark Jul 28, 2025
5860eea
[autofix.ci] apply automated fixes
autofix-ci[bot] Jul 28, 2025
f05805d
refactor: improve table look
ogzhanolguncu Jul 28, 2025
cebfeaf
refactor: update quick referrence
ogzhanolguncu Jul 28, 2025
a72993e
[autofix.ci] apply automated fixes
autofix-ci[bot] Jul 28, 2025
7c3e569
Merge branch 'main' into generate-docs-from-cli
ogzhanolguncu Jul 28, 2025
f36af39
fix: build
ogzhanolguncu Jul 28, 2025
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
4 changes: 2 additions & 2 deletions apps/engineering/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ pnpm dev
yarn dev
```

Open http://localhost:3000 with your browser to see the result.
Open <http://localhost:3000> with your browser to see the result.

## Learn More

To learn more about Next.js and Fumadocs, take a look at the following
resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js.
features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
- [Fumadocs](https://fumadocs.vercel.app) - learn about Fumadocs
12 changes: 10 additions & 2 deletions apps/engineering/app/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { source } from "@/app/source";
import { Banner } from "fumadocs-ui/components/banner";
import { Tab, Tabs } from "fumadocs-ui/components/tabs";
import defaultMdxComponents from "fumadocs-ui/mdx";
import { DocsBody, DocsDescription, DocsPage, DocsTitle } from "fumadocs-ui/page";
import type { Metadata } from "next";

import { notFound } from "next/navigation";

export default async function Page(props: {
Expand Down Expand Up @@ -32,7 +33,14 @@ export default async function Page(props: {
<DocsDescription>{page.data.description}</DocsDescription>

<DocsBody>
<MDX components={{ ...defaultMdxComponents }} />
<MDX
components={{
...defaultMdxComponents,
Tabs,
Tab,
Banner,
}}
/>
</DocsBody>
</DocsPage>
);
Expand Down
2 changes: 1 addition & 1 deletion apps/engineering/content/docs/architecture/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"description": "How does Unkey work",
"icon": "Pencil",
"root": false,
"pages": ["index", "---Services---"]
"pages": ["index", "services"]
}
12 changes: 11 additions & 1 deletion apps/engineering/content/docs/architecture/services/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,15 @@
"title": "Services",
"icon": "Pencil",
"root": false,
"pages": ["vault", "clickhouse", "clickhouse-proxy"]
"pages": [
"api",
"clickhouse",
"clickhouse-proxy",
"deploy",
"healthcheck",
"quotacheck",
"run",
"vault",
"version"
]
}
191 changes: 191 additions & 0 deletions apps/engineering/content/docs/cli/deploy/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
---
title: "Deploy"
description: "Deploy a new version or initialize configuration"
---
Build and deploy a new version of your application, or initialize configuration.

The deploy command handles the complete deployment lifecycle: from building Docker images to deploying them on Unkey's infrastructure. It automatically detects your Git context, builds containers, and manages the deployment process with real-time status updates.

## Initialization Mode

Use --init to create a configuration template file. This generates an unkey.json file with your project settings, making future deployments simpler and more consistent across environments.

## Deployment Process

1. Load configuration from unkey.json or flags
2. Build Docker image from your application
3. Push image to container registry
4. Create deployment version on Unkey platform
5. Monitor deployment status until active

## Command Syntax

```bash
unkey deploy [flags]
```

## Examples

### Initialize new project configuration

```bash
unkey deploy --init
```

### Initialize with custom location

```bash
unkey deploy --init --config=./my-project
```

### Force overwrite existing configuration

```bash
unkey deploy --init --force
```

### Standard deployment (uses ./unkey.json)

```bash
unkey deploy
```

### Deploy from specific config directory

```bash
unkey deploy --config=./production
```

### Override workspace from config file

```bash
unkey deploy --workspace-id=ws_production_123
```

### Deploy with custom build context

```bash
unkey deploy --context=./api
```

### Local development (build only, no push)

```bash
unkey deploy --skip-push
```

### Deploy pre-built image

```bash
unkey deploy --docker-image=ghcr.io/user/app:v1.0.0
```

### Verbose output for debugging

```bash
unkey deploy --verbose
```

## Flags

<Callout type="info" title="--config">
Directory containing unkey.json config file

- **Type:** string
</Callout>

<Callout type="info" title="--init">
Initialize configuration file in the specified directory

- **Type:** boolean
- **Default:** `false`
</Callout>

<Callout type="info" title="--force">
Force overwrite existing configuration file when using --init

- **Type:** boolean
- **Default:** `false`
</Callout>

<Callout type="info" title="--workspace-id">
Workspace ID

- **Type:** string
- **Environment:** `UNKEY_WORKSPACE_ID`
</Callout>

<Callout type="info" title="--project-id">
Project ID

- **Type:** string
- **Environment:** `UNKEY_PROJECT_ID`
</Callout>

<Callout type="info" title="--context">
Build context path

- **Type:** string
</Callout>

<Callout type="info" title="--branch">
Git branch

- **Type:** string
- **Default:** `"main"`
</Callout>

<Callout type="info" title="--docker-image">
Pre-built docker image

- **Type:** string
</Callout>

<Callout type="info" title="--dockerfile">
Path to Dockerfile

- **Type:** string
- **Default:** `"Dockerfile"`
</Callout>

<Callout type="info" title="--commit">
Git commit SHA

- **Type:** string
</Callout>

<Callout type="info" title="--registry">
Container registry

- **Type:** string
- **Default:** `"ghcr.io/unkeyed/deploy"`
- **Environment:** `UNKEY_REGISTRY`
</Callout>

<Callout type="info" title="--skip-push">
Skip pushing to registry (for local testing)

- **Type:** boolean
- **Default:** `false`
</Callout>

<Callout type="info" title="--verbose">
Show detailed output for build and deployment operations

- **Type:** boolean
- **Default:** `false`
</Callout>

<Callout type="info" title="--control-plane-url">
Control plane URL

- **Type:** string
- **Default:** `"http://localhost:7091"`
</Callout>

<Callout type="info" title="--auth-token">
Control plane auth token

- **Type:** string
- **Default:** `"ctrl-secret-token"`
</Callout>
35 changes: 35 additions & 0 deletions apps/engineering/content/docs/cli/healthcheck/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: "Healthcheck"
description: "Perform an HTTP healthcheck against a given URL"
---
This command sends an HTTP GET request to the specified URL and validates the response. It exits with code 0 if the server returns a 200 status code, otherwise exits with code 1.

## Use Cases

This is useful for health monitoring in CI/CD pipelines, service availability checks, load balancer health probes, and infrastructure monitoring scripts.

## Command Syntax

```bash
unkey healthcheck
```

## Examples

### Check if a service is healthy

```bash
unkey healthcheck https://api.unkey.dev/health
```

### Check local service

```bash
unkey healthcheck http://localhost:8080/health
```

### Use in monitoring script

```bash
unkey healthcheck https://example.com/api/status || echo 'Service is down!'
```
4 changes: 4 additions & 0 deletions apps/engineering/content/docs/cli/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: "CLI"
description: "Single binary for everything"
---
6 changes: 6 additions & 0 deletions apps/engineering/content/docs/cli/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"title": "CLI",
"icon": "Pencil",
"root": false,
"pages": ["deploy", "healthcheck", "quotacheck", "run", "version"]
}
64 changes: 64 additions & 0 deletions apps/engineering/content/docs/cli/quotacheck/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: "Quotacheck"
description: "Check for exceeded quotas"
---
Check for exceeded quotas and optionally send Slack notifications.

This command monitors quota usage by querying ClickHouse for current usage metrics and comparing them against configured limits in the primary database. When quotas are exceeded, it can automatically send notifications via Slack webhook.

## Configuration

The command requires ClickHouse and database connections to function. Slack notifications are optional but recommended for production monitoring.

## Command Syntax

```bash
unkey quotacheck [flags]
```

## Examples

### Check quotas without notifications

```bash
unkey quotacheck --clickhouse-url clickhouse://localhost:9000 --database-dsn postgres://user:pass@localhost/db
```

### Check quotas with Slack notifications

```bash
unkey quotacheck --clickhouse-url clickhouse://localhost:9000 --database-dsn postgres://user:pass@localhost/db --slack-webhook-url https://hooks.slack.com/services/...
```

### Using environment variables

```bash
CLICKHOUSE_URL=... DATABASE_DSN=... SLACK_WEBHOOK_URL=... unkey quotacheck
```

<Banner type="warn">
Some flags are required for this command to work properly.
</Banner>
Comment on lines +39 to +41
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Banner is too vague – list the actual required flags.

Stating “Some flags are required” forces the reader to hunt for which ones. Spell them out directly to improve scannability.

-<Banner type="warn">
-Some flags are required for this command to work properly.
-</Banner>
+<Banner type="warn" title="Required flags">
+The following flags must be provided: `--clickhouse-url` and `--database-dsn`.
+</Banner>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Banner type="warn">
Some flags are required for this command to work properly.
</Banner>
<Banner type="warn" title="Required flags">
The following flags must be provided: `--clickhouse-url` and `--database-dsn`.
</Banner>
🤖 Prompt for AI Agents
In apps/engineering/content/docs/cli/quotacheck/index.mdx around lines 39 to 41,
the warning banner is too vague by stating only that some flags are required.
Replace the generic message with a clear list of the actual required flags for
the command to improve clarity and help users quickly identify what is needed
without searching elsewhere.


## Flags

<Callout type="info" title="--clickhouse-url (required)">
URL for the ClickHouse database

- **Type:** string
- **Environment:** `CLICKHOUSE_URL`
</Callout>

<Callout type="info" title="--database-dsn (required)">
DSN for the primary database

- **Type:** string
- **Environment:** `DATABASE_DSN`
</Callout>

<Callout type="info" title="--slack-webhook-url">
Slack webhook URL to send notifications

- **Type:** string
- **Environment:** `SLACK_WEBHOOK_URL`
</Callout>
Loading
Loading