Reference: Command‑Line Interface
The lectic command is the primary way to interact with Lectic. It can read from a file or from standard input, and it offers flags to control how the result is printed or saved.
Usage
lectic [FLAGS] [OPTIONS]Subcommands
lectic lspStart the LSP server. Transport: stdio.lectic parseParse a lectic file into a JSON representation of the parsed file structure. Useful for programmatic analysis and modification.Flags:
--yaml: Emit YAML instead of JSON.--reverse: Ingest JSON (or YAML) output and reconstruct the original lectic file.
lectic modelsList available models for providers with detected API keys. Only providers with API keys in the environment are queried.
Flags and options
-v,--versionPrints the version string.-f,--file <PATH>Path to the conversation file (.lec) to process. If omitted, Lectic reads from standard input.-i,--inplace <PATH>Read from the given file and update it in place. Mutually exclusive with--file.-s,--shortOnly emit the newly generated assistant message, not the full updated conversation.-S,--ShortLike--short, but emits only the raw message text (without the:::Speakerwrapper).-H,--headerEmit only the YAML frontmatter of the input. With--inplace, this will overwrite the file to contain only the header (effectively resetting the conversation).-l,--log <PATH>Write detailed debug logs to the given file.-q,--quietSuppress printing the assistant’s response to stdout.-h,--helpShow help for all flags and options.
Constraints
- –inplace cannot be combined with –file.
- –header cannot be combined with –short or –Short.
- –quiet cannot be combined with –short or –Short.
Common examples
Generate the next message in a file and update it in place:
lectic -i conversation.lecRead from stdin and write the full result to stdout:
cat conversation.lec | lecticStream just the new assistant message:
lectic -s -f conversation.lecAdd a message from the command line and update the file:
echo "This is a new message." | lectic -i conversation.lecList available models for detected providers:
lectic modelsStart the LSP server (stdio transport):
lectic lspParse a file to JSON:
lectic parse -f conversation.lecRound-trip a file through parsing and reconstruction:
lectic parse -f conversation.lec | lectic parse --reverse