feat(init): scaffold circleci init onboarding command#1290
Draft
Klaney wants to merge 1 commit into
Draft
Conversation
Lands the shell for the CLI onboarding flow (WEBXP-987). Registers a new top-level `init` subcommand that, from inside a git working tree, prints the four-phase preamble (scan → docker test → generate config → sign up) and stub `[1/3]/[2/3]/[3/3]` step lines that mirror the Figma prototype copy. Outside a git repo it returns a structured ExitBadArguments error with a `cd <path>` suggestion. Adds a permissive `gitremote.InsideWorkTree()` helper (vs. the stricter `Detect()`, which requires a parseable CircleCI remote that fresh `init` targets may not have). Real scan/test/generate/signup logic is owned by follow-up tickets and intentionally not inlined here. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
Author
Contributor
Author
|
Putting this into draft mode for now. Gonna work on the other commands first. And compose them together later if need be. |
Fab10-CircleCi
added a commit
that referenced
this pull request
May 15, 2026
Scaffolds the top-level `circleci init` command (WEBXP-987) and composes it with the existing reposcan (WEBXP-988) + new testrunner (WEBXP-989) work into a four-journey-item flow: [1/3] Scanning repository — real, via internal/reposcan [2/3] Running tests in Docker — real, via internal/testrunner [3/3] Generating config — stub, owned by WEBXP-990 Next: sign up for CircleCI — post-flow CTA per Figma Banner copy and step framing match the Figma onboarding board. gitremote.InsideWorkTree() guards execution. Extra args are rejected through the project's structured error pipeline (exit 2) instead of cobra's default rendering. Acceptance coverage: happy path, test-failure agent prompt, Docker unavailable, non-git repo, and extra-args rejection. The acceptance suite swaps the Docker runner for an in-memory fake via the CIRCLECI_INIT_FAKE_RUNNER env hook so CI does not need a Docker daemon. Supersedes draft PR #1290. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 15, 2026
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
Lands the command shell for the CLI onboarding flow (WEBXP-987) — the first slice of the CLI Onboarding (Phases 1–3) project.
circleci initcommand (single-verb, no subcommands).[1/3] / [2/3] / [3/3]step lines that mirror the Figma prototype copy. Exits 0.ExitBadArguments(exit 2) error with acd <path>suggestion.gitremote.InsideWorkTree()helper.gitremote.Detect()is too strict — it requires a parseable CircleCI remote that freshinittargets may not have yet.Local testing
Test plan
task testpasses (495 tests, includes new unit + acceptance suites)task checkis clean (lint, license headers,go mod tidy)circleci init --helplists all four onboarding phasescircleci initinside a git repo exits 0 and prints the welcome banner,[1/3] / [2/3] / [3/3]stub lines, and the signup CTA with the signup URLcircleci initoutside a git repo exits 2 and prints the "valid git repository" error with thecd <path>suggestioncircleci init foorejects extra args (cobra.NoArgs) with exit 2Out of scope (per WEBXP-987)
--jsonoutput (not a data-returning command)🤖 Generated with Claude Code