Skip to content

fix(init): say trail init, not graft init, when there's no terminal to ask on - #588

Open
rushabhnagda11 wants to merge 1 commit into
mainfrom
fix/trail-init-noninteractive-name
Open

rushabhnagda11 wants to merge 1 commit into
mainfrom
fix/trail-init-noninteractive-name

Conversation

@rushabhnagda11

Copy link
Copy Markdown

Found while rehearsing the new onboarding for the 2026-10-19 metrics review.

What

trail init with no TTY (run from a script, a pipe, or by a coding agent) printed:

graft init: no TTY to prompt on, and no --agents/--yes given — nothing written.
  graft init --agents claude copilot   # wire these
  graft init --yes                     # same, without spelling them out
  ...

formatNonInteractiveHelp hard-coded the graft spelling. It now goes through cmd(), like the rest of init's output, so trail init says trail init ….

Safety

  • graft init output is byte-for-byte unchanged (cmd() returns the graft spelling under graft, and the existing tests that assert graft init --agents claude cursor still pass).
  • Copy only, with no behaviour change. One new test covers the trail spelling.

Test

node --import tsx --test test/cli-picker.test.ts test/graft-to-trail.test.ts test/trail-name.test.ts: 55/55 pass.

🤖 Generated with Claude Code

…o ask on

`trail init` run from a script, a pipe or an agent printed
"graft init: no TTY to prompt on…" and suggested four `graft init` commands.
The help now names the command the way it was run; `graft init` prints
exactly what it did before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trailhq-graft

trailhq-graft Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🌱 graft blast radius

1 area changed → 1 area can be affected. 3 dependent symbols, depth 2.
Tests: 1 area updated its tests.
Tag: @anirudhkumar-nanonets — CLI Picker, CLI Commands · @shhdwi — CLI Commands

flowchart TB
  A0(("CLI Commands<br/>3 symbols"))
  classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
  class A0 reached;
Loading
Can be affected Symbols Nearest hop Reached from
CLI Commands 3 src/cli.ts:L1487-L1756 runInitCommand — calls, depth 1 CLI Picker
Who knows this code — 2 people across 2 areas
Area Who knows it
CLI Picker · changed @anirudhkumar-nanonets — 6 commits, last today
CLI Commands · affected @anirudhkumar-nanonets — 53 commits, last today · @shhdwi — 23 commits, last 2mo ago

Ownership is git history over each area's own files, weighted towards recent work (120-day half-life). Merge commits and bots are dropped, and you are dropped from your own PR. A name with no @ has no GitHub handle in its commit email — tag them by hand, or add a .mailmap entry. A suggestion from history, not a CODEOWNERS rule.

All 3 dependent symbols, grouped by area

CLI Commands — 3 symbols in 1 file

  • src/cli.ts:L1487-L1756 — runInitCommand (calls, depth 1)
    1553: console.error(formatNonInteractiveHelp(detectedIds));
  • src/cli.ts:L1-L2976 — cli.ts (calls, depth 2)
    88: import { compactWrites, formatNonInteractiveHelp, formatPlan, runPicker } from "./cli-picker.js";
  • src/cli.ts:L2185-L2395 — pushCommand (calls, depth 2)
Test signal per changed area — 1 ✓

Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.

  • ✓ CLI Picker — 1 of 1 reached · 1 test file changed here: test/cli-picker.test.ts

graft blast · origin/main...HEAD · depth 2 · 2 changed files

Open the interactive graph → — click an area to see its dependent symbols at file:line.

github-actions Bot added a commit that referenced this pull request Oct 13, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant