Repository navigation
Cloud deploy: say why a deploy failed, keep credentials out of output; draft deploy skill - #553
Open
fabriciojs wants to merge 9 commits into
Open
fabriciojs wants to merge 9 commits into
fabriciojs wants to merge 9 commits into
Conversation
- Print the deploy's error, hint and detail from the status API, and the logs URL as soon as the deploy is created (and again on failure). - timedout is a final state; a failed status poll retries with backoff instead of waiting out the 15-minute timeout. - Send x-kool-client (claude-code, AI_AGENT, gemini-cli, copilot-cli, cursor, ci or human) so the panel can tell which deploys an agent ran. - --verbose and echoed command lines redact credential fields and token-like values (new core/redact); help and errors prefer KOOL_API_TOKEN over --token, which shows in the process list. - Log out of the Kool registry only, after the push; a failed logout no longer fails a deploy that already pushed. Label docker login failures. - An interrupt after the deploy started prints the deploy id and logs URL instead of dying silently; the rollout continues. - kool cloud exec accepts a leading --; setup's reference link is fixed; the stale embedded kool.deploy.yml template (rejected by the validator) is removed. Commands reference docs regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A short skill for coding agents deploying to Kool Cloud, with references for Laravel, Next.js (Prisma + SQLite), Vite/React SPAs, Node and static sites, plus the always-loaded AGENTS.md snippet kool create and kool cloud setup could write. Every kool.cloud.yml example passes the CLI validator; every Dockerfile passes docker build --check. Draft for review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved redaction flaws can expose quoted passwords and credential-bearing deployment diagnostics in user-visible output.
5 open issues
What changed in this PR
This PR improves Kool Cloud deploy diagnostics and credential handling in the CLI, and adds draft deployment guidance for coding agents. The new skill and agent snippet are not yet wired into commands.
Changes:
- Adds failure details, earlier logs links, polling retries, timeout recognition, interrupt reporting, and registry-specific cleanup.
- Adds credential redaction and client identification, improves token guidance, and supports
cloud exec SERVICE -- CMD. - Adds stack-specific deployment guides, refreshes command documentation, and removes the unused legacy template.
| File | Description |
|---|---|
templates/kool.deploy.yml |
Removes the unused legacy template. |
templates/agents/AGENTS.kool.md |
Adds a draft agent guidance snippet. |
skills/kool-cloud-deploy/SKILL.md |
Adds the draft deployment workflow and troubleshooting guide. |
skills/kool-cloud-deploy/references/static.md |
Adds static-site deployment examples. |
skills/kool-cloud-deploy/references/spa.md |
Adds Vite/React build and routing guidance. |
skills/kool-cloud-deploy/references/node.md |
Adds Node API deployment guidance. |
skills/kool-cloud-deploy/references/nextjs.md |
Adds Next.js, Prisma, and SQLite guidance. |
skills/kool-cloud-deploy/references/laravel.md |
Adds Laravel deployment guidance. |
services/cloud/build.go |
Labels login errors and scopes registry logout. |
services/cloud/build_test.go |
Tests login errors and logout behavior. |
services/cloud/api/endpoint.go |
Redacts verbose output and adds client headers. |
services/cloud/api/endpoint_test.go |
Tests headers and verbose credential redaction. |
services/cloud/api/deploy_status.go |
Expands the deploy status response fields. |
services/cloud/api/deploy_status_test.go |
Tests status decoding and nullable fields. |
services/cloud/api/client.go |
Detects agent, CI, and human clients. |
services/cloud/api/client_test.go |
Tests client detection and sanitization. |
docs/05-Commands-Reference/kool-cloud.md |
Documents environment-based authentication. |
docs/05-Commands-Reference/kool-cloud-setup.md |
Refreshes inherited token guidance. |
docs/05-Commands-Reference/kool-cloud-logs.md |
Refreshes inherited token guidance. |
docs/05-Commands-Reference/kool-cloud-help.md |
Refreshes inherited token guidance. |
docs/05-Commands-Reference/kool-cloud-exec.md |
Updates separator syntax and token guidance. |
docs/05-Commands-Reference/kool-cloud-destroy.md |
Refreshes inherited token guidance. |
docs/05-Commands-Reference/kool-cloud-deploy.md |
Refreshes inherited token guidance. |
core/shell/shell.go |
Redacts echoed command arguments. |
core/shell/shell_test.go |
Tests credential redaction in command echoes. |
core/redact/redact.go |
Adds JSON, text, and argument redaction helpers. |
core/redact/redact_test.go |
Tests redaction and preservation of non-secret values. |
commands/cloud.go |
Recommends environment tokens in help and errors. |
commands/cloud_test.go |
Tests token guidance and precedence. |
commands/cloud_setup.go |
Corrects the configuration reference URL. |
commands/cloud_deploy.go |
Improves polling, diagnostics, and interrupt reporting. |
commands/cloud_deploy_test.go |
Tests deploy outcomes, retries, and signals. |
commands/cloud_deploy_exec.go |
Handles the separator after the service name. |
commands/cloud_deploy_exec_test.go |
Tests separator handling and command forwarding. |
Review effort: Balanced
password='...' was left as it was, and a double-quoted value with a space showed everything after it. A quoted value now runs through its closing quote, skipping escaped characters, before falling back to the unquoted pattern; blank values are still kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They are printed on the ordinary error path, not only with --verbose, and may quote the app's own output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The loading indicator printed its completion message for failed and timed-out deploys too, right before the failure. Only a successful deploy keeps it now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After a timeout or an interrupt the status poller kept running and printing, which shows when kool cloud deploy runs inside another kool command. Polling now stops, with its sleep and its request, as soon as waiting ends, and a single status check gives up after 30 seconds so a hung request is retried like any other failed check. Endpoint gains SetContext, which cancels the request once done. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The example's .dockerignore left out nginx.conf, which the Dockerfile copies, so the build failed. It stays in the context now and is removed from the web root after COPY . so it isn't published. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers running, success (with a service size left null and with WordPress credentials), failed and timed out deploys with and without an error, a response without a services list, and responses carrying the optional hint and detail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`kool cloud destroy` sent DELETE /deploy/destroy, a path the API does not serve, so it failed with a 404 instead of scheduling the environment for deletion. The endpoint is DELETE /deploy, as the CLI called it before 3.0.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.



Summary
kool cloud deploynow says why a deploy failed and keeps credentials out of its output. This PR also fixes rough edges a coding agent hit while deploying three typical apps with the released CLI, and adds a draft deploy skill for agents.Deploy failures
error,hintanddetailfrom the status API.timedoutis a final state. A failed status poll retries with backoff instead of waiting out the 15-minute timeout.docker loginfailures.x-kool-clientheader so the panel can tell which deploys a coding agent ran. The values areclaude-code,AI_AGENT,gemini-cli,copilot-cli,cursor,ciorhuman, and each is detected only from markers the tool documents.Credentials
--verboseused to print the registry login and password from the deploy response. Now--verboseand echoed command lines redact credential fields and token-like values (newcore/redact).KOOL_API_TOKENover--token, which shows in the process list.--tokenstill works.Smaller fixes
kool cloud exec SERVICE -- CMDworks.kool cloud setuplinks to the right kool.cloud.yml reference page.templates/kool.deploy.ymlis removed: nothing referenced it, and the validator rejected it.Draft: kool-cloud-deploy skill
skills/kool-cloud-deploy/holds a short skill with references for Laravel, Next.js (Prisma + SQLite), Vite/React SPAs, Node and static sites.templates/agents/AGENTS.kool.mdis a 3 KB always-loaded snippet thatkool create/kool cloud setupcould write.kool.cloud.ymlexample passes the CLI's validator, and every Dockerfile passesdocker build --check.The real error line,
hintanddetailcome from a panel change in https://github.com/kool-dev/web-cloud-panel/pull/127 (private). Against the current panel, the CLI prints whatever error the panel sends today.Testing
gofmt -l .is clean, andgo build ./...andgo vet ./...pass.go test ./...passes with 0 failures, including the new tests for redaction, client detection, the status shape, logout, exec--and signal handling.golangci-lintv2.15.0 reports 0 issues.docker.login,docker.passwordand an envDB_PASSWORDprint as[REDACTED]under--verbose;🤖 Generated with Claude Code