Skip to content

fix(cli): line up the examples in fctl publish's and fctl review's help - #277

Merged
kalaspuff merged 1 commit into
mainfrom
fctl/292-indent-help-examples
Oct 25, 2026
Merged

kalaspuff merged 1 commit into
mainfrom
fctl/292-indent-help-examples

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Summary

fctl publish --help and fctl review --help printed parts of their help far to the right: their texts went on to new lines without a \, so the spaces that indent those lines in the source came out in the help. fctl publish --help printed its second sentence and its examples 22 to 24 spaces in, and fctl review --help four of its five examples 30 spaces in. Both now read like the other commands' help. They came in with #71 and #223.

A new test walks every command's help texts (descriptions, before and after help, and every argument's help) and fails on a line indented by more than 8 spaces, which is as far as any help indents on purpose (fctl review submit --help's JSON example). It fails on main's fctl publish and passes with this change. Found while working on the pull request below; it's separate so that it gets its own line in the release notes.

fctl review --help, ending with, before:

Examples:
  fctl review                          # the project's reviews, newest first
                              fctl review settings --on --effort high
                              fctl review start acme/web#12
                              fctl review threads                  # a review agent, in its sandbox
                              fctl review submit review.json       # a review agent, in its sandbox

After:

Examples:
  fctl review                          # the project's reviews, newest first
  fctl review settings --on --effort high
  fctl review start acme/web#12
  fctl review threads                  # a review agent, in its sandbox
  fctl review submit review.json       # a review agent, in its sandbox

fctl session

Their help texts went on to new lines without a `\`, so the spaces that
indent those lines in the source reached the help: `fctl publish --help`
printed its second sentence and its examples 22 to 24 spaces in, and
`fctl review --help` four of its five examples 30 spaces in. A test now
walks every command's help texts and fails on such indentation.
@kalaspuff
kalaspuff merged commit a065ffc into main Oct 25, 2026
10 checks passed
@kalaspuff
kalaspuff deleted the fctl/292-indent-help-examples branch October 25, 2026 18:13
kalaspuff pushed a commit that referenced this pull request Oct 25, 2026
## Summary

`fctl` without arguments, `fctl -h`, `fctl --help` and `fctl help` now
end with a paragraph for agents, after the examples: read
https://fctl.sh/llms.txt to learn fctl and this CLI, what they'll find
there, and https://fctl.sh/llms-full.txt for all of it in one file. An
agent that finds fctl on its PATH usually runs one of these first, so
that's where it now learns where its guide is. `fctl` alone prints the
short help, so the pointer is in the short help too, and `-h` shows it
as well.

It is one plain paragraph rather than an indented section because clap
wraps help text to the terminal's width without indenting continuation
lines; it reads cleanly at 60, 80 and 100 columns (100 is what agents
get outside a terminal). A unit test checks that all four outputs
contain it; I also checked that both URLs serve what the paragraph
lists.

`fctl`, ending with:

```
Examples:
  fctl login https://app.fctl.sh
  fctl run -p my-app "Add a dark mode toggle"
  fctl sessions --active
  fctl attach my-app#12
  fctl host install

Agents: read https://fctl.sh/llms.txt to learn fctl and this CLI: what fctl is, the words it uses,
how to drive it from a script or a tool call (access tokens, --json, exit codes, waiting for a
session), what to avoid, recipes, and links to every doc page as Markdown, all of them in one file
at https://fctl.sh/llms-full.txt.
```

A separate fix, found while writing this: `fctl publish --help` and
`fctl review --help` printed their examples with the source's
indentation.

- #277

## Worth confirming

- **Decision:** the pointer comes last, after the examples, where a
terminal leaves it just above the prompt. An agent that reads only the
first lines (`fctl --help | head`) won't see it.

[fctl session](https://app.fctl.sh/s/ses_01M5SSYJC8AZTVMF34HFYXXB8H)

Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant