Repository navigation
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f481e89. Configure here.
| format!("{}{}=\"{}\"", prefix, key, escaped) | ||
| } else { | ||
| format!("{}{}={}", prefix, key, val) | ||
| } |
There was a problem hiding this comment.
Dotenv writer leaves $ unescaped
High Severity
format_dotenv_line does not treat $ as special, so create --dotenv writes CLICKHOUSE_PASSWORD in a form that dotenvy and other dotenv loaders expand. The write still succeeds and the password is omitted from command output, so the stored credential can be silently wrong.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit f481e89. Configure here.
Add `cloud service dotenv` to write an existing service's host, ports, user and TLS setting to .env (or .env.local), without a password, and `cloud service create --dotenv [FILE]` to write the same settings plus the one-time password. With --dotenv, the password goes only to the file and is left out of human and JSON output; the target is checked before the service is created, and a write that still fails afterwards prints the password as before and exits 1. Move the .env writer helpers from local into the dotenv module, shared by the local and Cloud dotenv paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sdairs
force-pushed
the
feat/1164-cloud-service-dotenv
branch
from
October 30, 2026 17:27
f481e89 to
8316f5b
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Closes #1164.
What
cloud service dotenv [ID] [--name NAME] [--local]writes an existing service's connection settings to.env(or.env.local):CLICKHOUSE_HOST,CLICKHOUSE_PORT(native TLS),CLICKHOUSE_HTTP_PORT,CLICKHOUSE_USER=default,CLICKHOUSE_SECURE=true. It never writes a password, because the API only returns one at create/reset. It's a read command, so it works with OAuth.cloud service create --dotenv [FILE](.envwhen FILE is omitted) writes the same keys plus the one-timeCLICKHOUSE_PASSWORD. Once the file is written, the password is left out of stdout in both human and JSON output, so it never reaches an agent's context or transcript. In JSON,passwordis removed and adotenv: {file, keys}object is added.Safety around the one-time password
cloud service dotenv <id>later. Existing keys not written by the command are kept, so a password written at create survives a laterservice dotenv.Notes
local server dotenv(CLICKHOUSE_PORTis the native port).CLICKHOUSE_SECUREis new and Cloud-only, because Cloud endpoints require TLS. The mcp-clickhouse port difference stays with Design reusable connection profiles and MCP-compatible export #800..envwriter helpers moved fromsrc/local/mod.rstosrc/dotenv.rs(with their tests) and gainedwrite_vars, whichlocal server dotenv,local postgres dotenvand both new paths now share. Local behaviour is unchanged.--localonservice dotenvmirrors the local dotenv commands.create --dotenvtakes a path instead, since the file is chosen at the moment the password exists.--dotenvoncloud service reset-password, the other place a password is returned.Tests
--localdefault, read classification, bare/valued/=-form--dotenv, a following flag not taken as the file, not repeatable.write_varscreating or editing a file in place..envedit that keeps an existing password,--local, the no-endpoints failure writing nothing,create --dotenvwriting the password and keeping it off stdout/stderr (JSON and human),createwithout the flag unchanged, and a bad target rejected with no request sent.Docs: Cloud service guide ("Write connection settings to
.env") and the automation output table.🤖 Generated with Claude Code
Note
Medium Risk
Renaming local
servertoclickhousebreaks existing scripts, and the newlatest.txtpublish path is on the critical path for every user update.Overview
This PR bundles several user-facing and infrastructure changes beyond a single feature.
Release and self-update: The release workflow gains a Publish latest.txt job that writes
clickhousectl/latest.txtto builds.clickhouse.com after uploads, only advancing to newervX.Y.Ztags and verifying the CDN serves the value. Agent docs andrelease.ymlcomments now describeclickhousectl updateandinstall.shreading that file (with GitHubreleases/latestas fallback).Local CLI rename: User-facing examples and help switch from
clickhousectl local server …tolocal clickhouse …(start/stop, init flows, issue templates, README). Help tests pinclickhousein the local subcommand order.Cloud module layout (#1157):
cloud/organizationsbecomes a directory (cli.rs,client.rs,byoc.rs,members.rs,org,roles,mod.rs) with permissions and dispatch unchanged in spirit but split by command family.cloud/mod.rsdrops the standaloneservice_queryexport (query code lives underservices/).cloud/cli.rsreorders top-level cloud subcommands (e.g. Postgres after service, udf/key moved) and adds a test locking help order. Agent/skills docs describe the directory pattern for large domains and tightenconvert_error_for_lookupguidance.API library sync: OpenAPI refresh adds ClickStack log fields
eventNameExpression/severityNumberExpressionand ClickPipe MongoDB per-tablemongoConfig(persistDeletedDocuments). Models, converters, and tests follow;clickhousectl cloud clickpipe--table-mapping-jsonacceptsmongoConfigwith validation tests.Smaller fixes: Postgres container recovery refactors discovery into
discover_project_postgres_blocking;local inittest reflects thatlocal server listno longer creates.clickhouse(#1077)..git-blame-ignore-revsadds commits from the services/postgres/organizations splits.Reviewed by Cursor Bugbot for commit 8316f5b. Bugbot is set up for automated code reviews on this repo. Configure here.