Add Branchless Trail Creation · Entire

I can't create a trail without branch on the CLI right now?

Yes — the CLI currently requires a branch for entire trail create.

You can omit --branch, but the CLI will still choose one:

It cannot currently create a truly branchless trail. The implementation also pushes the branch before creating the trail, because the API request includes branch_name and uses branch_action: "link".

I want to be able to create a branchless trail though!

Implemented branchless trail creation.

Usage:

entire trail create --no-branch --title "Investigate flaky tests"

What changed:

Tests passing:

go test ./cmd/entire/cli

Create a trail

Created branchless trail:

Support branchless trail creation

ID: 019eef80-3535-7389-819f-47a6c5029020

Done — created branch, committed, pushed, and created a branch-backed trail.

PR URL from GitHub:

https://github.com/entireio/cli/pull/new/support-branchless-trail-creation

Make sure checks are passing.

Checks are passing on support-branchless-trail-creation at fc3274c98.

CI:

Also ran locally:

Entire Trail review comment

ID: 019eefac-3ab4-7e8d-97c6-d9b853812194 URL: https://entire.io/gh/entireio/cli/trails/634/support-branchless-trail-creation Severity: high Context: cmd/entire/cli/trail_cmd.go:717 Selected context:

// For branch-backed trails, always push the branch first: the trail binds to a

When noBranch is true, prepareTrailCreateBranch returns early with an empty branch name, but the caller unconditionally attempts to push the branch with pushBranchToOrigin(branch) where branch="". This will fail or behave incorrectly for branchless trails. The push should be skipped when noBranch is true or when branch is empty.

Addressed and resolved the review finding.

Changes:

Latest commit: 5921e409

Checks are passing:

Entire Trail review comment

ID: 019ef439-d59e-74bd-94a0-2621e85f2f8d URL: https://entire.io/gh/entireio/cli/trails/634/support-branchless-trail-creation Severity: medium Context: cmd/entire/cli/trail_cmd_test.go

Test coverage gap for the branchless paths. Only newTrailCreateRequest and the trivial early-return in prepareTrailCreateBranch are covered. The user-facing guardrails and flows are untested: validateTrailCreateFlagCombos (the --no-branch + --branch / --checkout rejections), the interactive branchless flow (runTrailCreateInteractive with noBranch=true), and a full branchless runTrailCreate happy path. trail_cmd_test.go already has an httptest harness, so a 'create branchless trail, assert the request omits branch fields and output says Created trail "X" (ID: ...)'.

Entire Trail review comment

ID: 019ef439-f40c-77e1-b2f0-99f8147c6719 URL: https://entire.io/gh/entireio/cli/trails/634/support-branchless-trail-creation Severity: medium Context: cmd/entire/cli/api/trail_types.go

Cross-repo server contract should be verified before merge. Branchless creation depends on the entire backend accepting a POST with neither branch_name nor branch_action and creating a branchless trail. This PR is CLI-only. Confirm the server side has landed (or is gated/feature-detected) before shipping, otherwise 'entire trail create --no-branch' will fail against production.

Addressed both review comments and resolved them in Entire.

Updated branch: support-branchless-trail-creation

Latest commit: bda18619b

Added tests for:

Server contract confirmed: branchless trail creation already worked against production with trail ID 019eef80-3535-7389-819f-47a6c5029020.

Checks passing:

Local:

Entire Trail review comment

ID: 019ef43a-3444-7e80-acf4-11d4f0700671 URL: https://entire.io/gh/entireio/cli/trails/634/support-branchless-trail-creation Severity: low Context: cmd/entire/cli/trail_cmd.go

Vestigial logic in maybeCheckoutTrailCreateBranch (~line 865, cosmetic). The 'checkout = true' reassignment inside the form block is now redundant since shouldCheckout already holds the answer. The function could just do 'if !shouldCheckout { return nil }' and drop the local 'checkout' variable entirely. Carried over from the original pre-refactor code; not worth blocking on.

Resolved the cosmetic finding.

Checks passing:

Working tree is clean.