> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/CyberStrikeus/CyberStrike/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom commands

> Create reusable slash commands that invoke pre-written prompts with optional templating.

Commands are reusable prompts you invoke by typing `/command-name` in the CyberStrike TUI. They let you encode common workflows — like running an OWASP assessment or generating a pentest report — as a single keystroke.

## File location

Place command files in `.cyberstrike/commands/`:

```
.cyberstrike/
  commands/
    owasp-assessment.md
    report.md
    sqli-test.md
```

Global commands (available in all projects) go in `~/.cyberstrike/commands/`.

CyberStrike scans both `command/` and `commands/` subdirectories automatically.

## Command file format

A command file is a Markdown file with optional YAML frontmatter. The Markdown body is the prompt template sent to the agent.

```markdown theme={null}
---
description: Run full OWASP WSTG assessment
agent: web-application
---

Perform a comprehensive OWASP Web Security Testing Guide assessment on {{target}}.
Test all applicable WSTG categories and provide a full report with CVSS scores.
```

The file name (without `.md`) becomes the command name. A file named `owasp-assessment.md` is invoked with `/owasp-assessment`.

### Frontmatter fields

<AccordionGroup>
  <Accordion title="description">
    A short description shown in the command picker when you type `/`. Optional but recommended.
  </Accordion>

  <Accordion title="agent">
    The agent to run this command with. Must match an agent name (e.g. `web-application`, `internal-network`, or a custom agent). If omitted, the currently active agent is used.
  </Accordion>

  <Accordion title="model">
    Override the model for this command. Uses the same `provider/model` format as agent configuration.
  </Accordion>

  <Accordion title="subtask">
    Set to `true` to run the command as a background subtask rather than in the current session. Useful for long-running assessments that should not block the main session.
  </Accordion>
</AccordionGroup>

## Template variables

Use `{{variable}}` syntax in the command body to create dynamic prompts. CyberStrike will prompt you to fill in each variable before running the command.

```markdown theme={null}
---
description: Test a specific endpoint for injection vulnerabilities
agent: web-application
---

Test the endpoint {{url}} for all injection vulnerability classes:
- SQL injection (error-based, blind, time-based)
- NoSQL injection
- Command injection
- SSTI

Use the HTTP method {{method}} and report any findings with PoC payloads.
```

When you run `/injection-test`, CyberStrike prompts for `url` and `method` before dispatching the prompt.

## Registering commands in `cyberstrike.json`

You can also define commands inline in `cyberstrike.json` under the `"command"` key:

```json theme={null}
{
  "command": {
    "quick-recon": {
      "template": "Run passive reconnaissance on {{target}}. Enumerate subdomains, check for exposed services, and review certificate transparency logs.",
      "description": "Quick passive recon on a target",
      "agent": "web-application"
    },
    "cvss-score": {
      "template": "Assign a CVSS 3.1 score to the following vulnerability finding:\n\n{{finding}}\n\nProvide the vector string and a breakdown of each metric.",
      "description": "Score a vulnerability with CVSS 3.1"
    }
  }
}
```

<Note>
  Commands defined in `cyberstrike.json` and commands defined as `.md` files are merged. If both define the same name, the `.md` file takes precedence.
</Note>

## Using commands

Type `/` in the TUI input to open the command picker. Start typing to filter by name or description, then press Enter to select.

<Steps>
  <Step title="Open the command picker">
    Type `/` in the input field. A list of available commands appears.
  </Step>

  <Step title="Select a command">
    Type to filter, then press Enter to select.
  </Step>

  <Step title="Fill in template variables">
    If the command uses `{{variables}}`, you'll be prompted to enter values for each one.
  </Step>

  <Step title="The agent runs the prompt">
    The rendered prompt is sent to the configured agent (or the current active agent if none is set).
  </Step>
</Steps>

## Subtask commands

Setting `subtask: true` runs the command as a background task, spawning a child session that does not block your current session.

```markdown theme={null}
---
description: Run a full WSTG assessment in the background
agent: web-application
subtask: true
---

Perform a complete OWASP WSTG assessment of {{target}}.
Cover all WSTG test categories. When complete, write a findings report to `findings-{{target}}.md`.
```

Use subtask commands for time-consuming assessments where you want to continue working in the main session while the task runs.

## Example commands

<CodeGroup>
  ```markdown owasp-assessment.md theme={null}
  ---
  description: Run full OWASP WSTG assessment
  agent: web-application
  ---

  Perform a comprehensive OWASP Web Security Testing Guide assessment on {{target}}.
  Test all applicable WSTG categories and provide a full report with CVSS scores.
  ```

  ```markdown ad-attack.md theme={null}
  ---
  description: Run Active Directory attack chain
  agent: internal-network
  ---

  Execute an Active Directory attack chain against {{domain}}.
  Start with enumeration (users, groups, SPNs), then attempt Kerberoasting,
  AS-REP roasting, and check for ACL misconfigurations. Report all findings.
  ```

  ```markdown report.md theme={null}
  ---
  description: Generate a pentest report from findings
  ---

  Review all vulnerability findings in this session and produce a professional
  penetration testing report with the following sections:

  1. Executive Summary
  2. Scope and Methodology
  3. Findings (sorted by CVSS score, highest first)
  4. Recommendations
  5. Appendix: Raw Evidence
  ```
</CodeGroup>
