---
name: straion-config
description: >-
  Show or change the Straion settings for this project or for all projects.
  Use `/straion-config`, `/straion-config <key>`, `/straion-config <key>
  <value>`, or `/straion-config --unset <key>`. Add `--global` to change the
  settings for all projects.
argument-hint: '[<key> [<value>] | --unset <key>] [--global]'
disable-model-invocation: true
allowed-tools: Bash(straion config *)
---

# Straion Config

This skill runs `straion config`. The CLI sets the keys, the values, and the
validation.

## Scope

1. Run all commands from the directory where the session started.
2. Do not edit `~/.straion/config.json` directly.

A write without `--global` changes the current directory and its
subdirectories.

## Command

Arguments: `$ARGUMENTS`

| Arguments       | Command                                                    |
| --------------- | ---------------------------------------------------------- |
| none            | `straion config list`, then `straion config list --global` |
| `<key>`         | `straion config <key>`                                     |
| `<key> <value>` | `straion config <key> <value>`                             |
| `--unset <key>` | `straion config --unset <key>`                             |

1. Find the arguments in the table. Run the command for those arguments.
2. Add `--global` only when the arguments include `--global`.
3. Do not change the key or the value. Put each one in quotes.
4. Do one write only.
5. Do not run other commands.

If the arguments are a sentence:

1. Run `straion config list`.
2. Find the key that the sentence identifies.
3. If no key in the list agrees with the sentence, ask the user.

## Output

- No arguments: Show two tables, "Project" and "Global". Each table has the
  columns "Key" and "Value". Show `(unset)` when a key has no value. A project
  value replaces the global value.
- Read: Show the value. Exit code 1 means that the key has no value.
- Write or unset: Show the CLI confirmation. Then run `straion config list`
  and show the new value.
- Write or unset of `audit.mode`: Tell the user that the change starts at the
  next hook call. A restart is not necessary. Rules from earlier `find-rules`
  calls do not need a verdict. If the new mode is `gate`, rules from the next
  `find-rules` call need a verdict before the turn can end.
- Write or unset of `automode`: Tell the user that the change starts at the
  next hook call. The rules index comes only at the start of a session. To get
  it, start a new session.
- Error: Show the CLI message without changes. Do not try again with a
  different key or value.
