## 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:

- on a feature branch: uses current branch
- on the default/base branch with `--title`: derives a branch slug from the title
- interactive mode: prompts for a branch name

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:

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

What changed:

- Added `--no-branch` to `entire trail create`
- Skips branch creation/fetch/push for branchless trails
- Omits `branch_name` and `branch_action` from the create API request
- Rejects invalid combos like `--no-branch --branch ...` and `--no-branch --checkout`

Tests passing:

```bash
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.

- Branch: `support-branchless-trail-creation`
- Commit: `9ebc42c96` — `Add branchless trail creation`
- Trail ID: `019eefa1-9d8b-7753-a52a-0e40b62634b9`

PR URL from GitHub:

[https://github.com/entireio/cli/pull/new/support-branchless-trail-creation](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:
- PR Binary Size: success
- License Check: success
- Tests: success
- Lint: success

Also ran locally:
- `go test ./cmd/entire/cli`
- `mise run lint`

### Entire Trail review comment

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

```go
// 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:

- Added explicit skip in `prepareTrailCreateBranch` for branchless/empty branch cases.
- Added regression test: `TestPrepareTrailCreateBranchSkipsBranchlessTrail`.
- Amended and force-pushed branch.

Latest commit: `5921e409`

Checks are passing:
- PR Binary Size: success
- License Check: success
- Lint: success
- Tests: success

### Entire Trail review comment

ID: 019ef439-d59e-74bd-94a0-2621e85f2f8d
URL: [https://entire.io/gh/entireio/cli/trails/634/support-branchless-trail-creation](/content/gh/entireio/cli/trails/634/support-branchless-trail-creation/index.html)
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](/content/gh/entireio/cli/trails/634/support-branchless-trail-creation/index.html)
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:

- `--no-branch` + `--branch` rejection
- `--no-branch` + `--checkout` rejection
- interactive branchless flow
- full branchless `runTrailCreate` happy path asserting no `branch_name` / `branch_action` and no branch push

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

### Checks passing:

- PR Binary Size: success
- License Check: success
- Lint: success
- Tests: success

Local:

- `go test ./cmd/entire/cli`
- `mise run lint`

### Entire Trail review comment

ID: 019ef43a-3444-7e80-acf4-11d4f0700671
URL: [https://entire.io/gh/entireio/cli/trails/634/support-branchless-trail-creation](/content/gh/entireio/cli/trails/634/support-branchless-trail-creation/index.html)
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.

- Simplified `maybeCheckoutTrailCreateBranch` to use `shouldCheckout` directly.
- Amended and pushed: `9f09715fa`
- Resolved finding `019ef43a-3444-7e80-acf4-11d4f0700671`

### Checks passing:

- PR Binary Size: success
- License Check: success
- Lint: success
- Tests: success

Working tree is clean.
