> For the complete documentation index, see [llms.txt](https://cyr1en.gitbook.io/commandprompter/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cyr1en.gitbook.io/commandprompter/features/post-command.md).

# Post Command

Post-command tags dispatch additional commands after a prompt flow completes or is cancelled. A post-command-only string does not start a session; at least one prompt must be present.

## Inline syntax

| Form                  | Meaning                                      |
| --------------------- | -------------------------------------------- |
| `<!command>`          | Run after successful completion.             |
| `<!!command>`         | Run after cancellation.                      |
| `<!:100 command>`     | Run after completion with a 100-tick delay.  |
| `<!!:20 command>`     | Run after cancellation with a 20-tick delay. |
| `<!command @console>` | Force console execution.                     |
| `<!command @player>`  | Force player execution.                      |

`@console` and `@player` are whitespace-delimited tokens and may appear anywhere in the inline command body.

Inline answer references are zero-based:

```
/mute <Player?> <Reason?> <!broadcast {0} was muted: {1}>
```

An out-of-range inline `{N}` reference becomes an empty string, and repeated whitespace is collapsed.

## Executor inheritance

An inline command with no executor marker inherits the main command's dispatch context:

* A normal player command runs it as that player.
* Console Delegate runs it as console.
* Player Delegate runs it as the target player and inherits the permission attachment.

Explicit `@player` or `@console` overrides that inheritance. In particular, explicit `@player` does not carry a Player Delegate permission attachment.

## Preset post-commands

Reference a definition in `presets.json` with `<!@id>`. The preset's `execution_policy`, `execute_as`, and `delay_ticks` are authoritative. Parser hints such as `<!!@id>` or `<!:40@id>` do not override the preset.

Preset placeholders are one-based:

* `{input}` and `{input:1}`: first collected answer
* `{input:N}`: Nth collected answer
* `{player}`: the prompting/target player's name, even when the command executes as console
* `%...%`: PlaceholderAPI values when PlaceholderAPI is installed

Out-of-range preset `{input:N}` placeholders remain visible in the dispatched command for diagnosis. The same preset post-command ID is dispatched at most once during a lifecycle event.

```json
{
  "id": "audit",
  "command": "broadcast {player} selected {input:1}",
  "execution_policy": "on_complete",
  "execute_as": "console",
  "delay_ticks": 20
}
```

## Cancellation

`<!!command>` receives any answers collected before cancellation. A preset runs only when its configured `execution_policy` matches the actual session result, even if the reference used the opposite marker.

See [Presets Configuration](/commandprompter/configuration/presets.md) for the full JSON format.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cyr1en.gitbook.io/commandprompter/features/post-command.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
