-
Notifications
You must be signed in to change notification settings - Fork 613
feat: generate docs from cli #3646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3a79286
30531e7
53e33f9
cc55b1d
82d3393
d05bce4
9e1b02a
aa7cde2
454828e
f058067
7e1a3b4
238c658
e8ab3dc
2cd7fa4
9152767
52fe00d
f80dd82
496a994
b8f964f
1f5b476
74f407a
2a8f0ed
c93dfdd
ecbe3f2
5a83cce
d6e0edd
550d22f
9f90f23
2040a9a
11510ce
4b2ed82
2e450ef
1e9f186
7f73b9c
395fb5f
6ef87a2
2796519
86f0c40
117d081
b17db16
dedb385
399f4e5
24d070f
94247ae
65dec03
2e29e62
797092b
a693277
9b27bd4
39c3960
8657647
85ca42a
cefbf68
586fe95
d2a182a
8ab6269
ff4dfe7
d16d202
f2ace8c
b0a7cb3
b178f77
531b456
4653fba
1682029
caa6742
7bf50d0
5860eea
f05805d
cebfeaf
a72993e
7c3e569
f36af39
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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. | ||
|
|
||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ## 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 | ||
ogzhanolguncu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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> | ||
| 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. | ||
|
|
||
ogzhanolguncu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ## 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!' | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| title: "CLI" | ||
| description: "Single binary for everything" | ||
| --- |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "title": "CLI", | ||
| "icon": "Pencil", | ||
ogzhanolguncu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "root": false, | ||
| "pages": ["deploy", "healthcheck", "quotacheck", "run", "version"] | ||
| } | ||
| 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| ## 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> | ||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.