Skip to content
Version 1.0.0

Write a custom command

Drop a command file into your configuration and invoke it by name, in the IDE or at the terminal.

A command is a file holding a prompt you would otherwise retype several times a day: review a diff, prepare a code review, summarize a file.

The text of a command becomes your instruction at the moment you invoke it. The file therefore lives in your personal configuration: the developer’s instruction is the only source of control for a session (security white paper V3, section 5.2).

Create a .prompt file in the prompts folder of your personal configuration, ~/.lemniscate/prompts/. The name field in the front-matter gives the command its name; if it is absent, the name is the file name without its .prompt extension:

---
name: revue
description: Relire un fichier en visant un objectif
---
Relis $1 en visant $2. Signale ce qui casserait en production.

You invoke it with /revue in the IDE or at the terminal, on all your repositories.

What you type after the command name becomes its arguments:

What you write in the fileWhat it becomes
$1, $2, $3…the argument at that position
$ARGUMENTSeverything you typed
$$a literal dollar sign, for writing an amount

/revue src/parser.ts lisibilité gives: “Review src/parser.ts with a focus on readability.”

If the file contains no marker, what you type is appended to the end of the prompt.

A @ followed by a path designates a file in the open repository, whose content is attached to the request. The path starts at the repository root, not at the directory you run the command from:

Compare @src/parser.ts à ce que décrit @docs/format.md.

Content attached this way remains content read from the repository: it is marked as untrusted and presented to the model in an area separate from your instruction (security white paper V3, section 5.2).

A command can ask for more than the surface you invoke it from provides. In that case the command does not run, and the rejection names what is missing. The model never receives a truncated prompt.

What the file asks forIn the IDEAt the terminal
@un/fichier.ts from the repositoryyesyes
@problems, @openyesrejected: these are editor-window capabilities
The old brace syntax ({{{ input }}}, version: 1)yesrejected: the terminal does not carry that engine

A file outside the repository is rejected on both sides: the agent only sees the working copy of the open repository (security white paper V3, section 4.3).

Commands come from the prompts folder of your personal configuration. A built-in command (/help, /exit) keeps its name: dropping in a file does not replace it.

A .lemniscate/prompts/ folder present in a repository is part of the working copy. Its content is data the agent can read, marked as untrusted; it does not provide commands. To pick up a command a team has written there, read the file and copy it into your personal folder.

A command is not a standing instruction: its file only reaches the model when you type its name, and it is not attached to your other requests. For an instruction followed every time, see Write rules for the agent.

Your personal rules folder holds standing instructions, and it does not provide commands, except, in the IDE, for a file that asks for it with invokable: true in its front-matter.