feat(cli): scaffold AGENTS.md and print next steps after deploy - #94
Closed
jonoirwinrsa wants to merge 1 commit into
Closed
feat(cli): scaffold AGENTS.md and print next steps after deploy#94jonoirwinrsa wants to merge 1 commit into
jonoirwinrsa wants to merge 1 commit into
Conversation
Shipping machine-readable commands does not mean agents will find them. Agents run --help to learn a command's flags, not to discover that a capability they had no reason to expect exists. Two changes put the commands in front of them. `cerebrium init` now writes an AGENTS.md alongside main.py and cerebrium.toml. Coding agents read that file at the start of a session without being asked, so it is the one place instructions are seen before any work begins. It covers verifying a deploy, right-sizing hardware from measured usage, and the traps that look like failures — scale-to-zero returning no containers, and config changes needing a redeploy. `cerebrium deploy` now ends with the commands worth running next. An agent reliably reads the output of the command it just ran, and a deploy exiting 0 only means the build succeeded, not that the app is serving. Next-step padding is measured on the uncoloured command, since padding a string that already carries escape codes skews every row. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
probably not the right thing |
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.
Why
#92 and #93 make the CLI machine-readable. Neither makes it discoverable. Agents run
--helpto learn a command's flags once they already suspect it exists — they don't run it speculatively to find out thatcerebrium metricsis a thing. Left alone, those two PRs would ship commands the intended audience never learns about.Two changes, both aimed at the moments an agent is already reading.
cerebrium initwrites anAGENTS.md. Agents read this at the start of a session unprompted, which makes it the only place instructions reliably land before any work begins. Generated forcerebrium init sentiment-api:It also covers the two things that read as failures but aren't: scale-to-zero meaning
containers listcorrectly returns nothing on an idle app, and hardware/dependency changes needing a redeploy.cerebrium deployends with next steps. An agent reliably reads the output of the command it just ran, anddeployexiting 0 only means the build succeeded — not that the app serves traffic.Decisions worth challenging
AGENTS.md, notCLAUDE.md. It's the vendor-neutral convention and Claude Code reads it, so one file covers more tools. If you'd rather write both, or append to an existingCLAUDE.mdwhen one is present, say so — it's a small change.initonly, so existing projects get nothing. Backfilling would mean either a new command (cerebrium agents init) or writing files into projects during unrelated commands, which I didn't want to do unasked. The deploy output covers existing projects in the meantime.Testing
go build,go vet,go test ./...clean. No golden files regenerated — deploy's success block prints to scrollback viatea.Printlnrather than throughView(), so nothing golden captures it.New tests cover the generated
AGENTS.md(names the right commands, no unfilled format verbs — a stray%!would ship a broken file to every new project) and next-step alignment in both coloured and plain modes. Rancerebrium initfor real and read the output file; it's reproduced above.The deploy output itself is unit-tested but I have not watched it print from a real deploy, since that means a live build.