diff --git a/docs/src/content/docs/getting-started/configuration.mdx b/docs/src/content/docs/getting-started/configuration.mdx index 4bebe14..1b7d312 100644 --- a/docs/src/content/docs/getting-started/configuration.mdx +++ b/docs/src/content/docs/getting-started/configuration.mdx @@ -118,6 +118,9 @@ export REDMINE_AUTH_METHOD=apikey # opt out of the startup update check export REDMINE_NO_UPDATE_CHECK=1 +# refuse all requests that modify data (read-only mode) +export REDMINE_READ_ONLY=1 + # hard-disable the optional system keyring export REDMINE_NO_KEYRING=1 ``` @@ -135,15 +138,42 @@ Flags take precedence over config values and environment variables. | `--profile` | Use a specific auth profile | | `--config` | Config file path (default `~/.redmine-cli.yaml`) | | `--no-color` | Disable colored output | +| `--read-only` | Refuse all requests that modify data on the server | | `-v, --verbose` | Enable debug logging | +## Read-only mode + +Point the CLI at a production Redmine without any risk of changing data. When enabled, every request that would modify the server is refused before it is sent; all listing, viewing, and searching commands keep working. + +Enable it in any of three ways (precedence: flag > environment variable > config): + +```bash +redmine --read-only issues list # single invocation +export REDMINE_READ_ONLY=1 # whole shell session +``` + +```yaml title="~/.redmine-cli.yaml" +profiles: + prod: + server: https://redmine.example.com + auth_method: apikey + api_key: your-api-key + read_only: true +``` + +Pass `--read-only=false` to override the environment variable or a `read_only: true` profile for a single invocation. + + + ## Inspect current config ```bash redmine config ``` -Prints the active profile, server, auth method, default project, and output format. +Prints the active profile, server, auth method, default project, output format, and read-only state. ## Next diff --git a/docs/src/content/docs/guides/ai-agents.mdx b/docs/src/content/docs/guides/ai-agents.mdx index 696e9a3..9285dfe 100644 --- a/docs/src/content/docs/guides/ai-agents.mdx +++ b/docs/src/content/docs/guides/ai-agents.mdx @@ -39,7 +39,7 @@ The full skill source: [`skills/redmine-cli/SKILL.md`](https://github.com/aarond - **Transport:** stdio by default. The host can spawn `redmine mcp serve` and talk JSON-RPC over its standard streams, or you can pass `--http :8080` to expose the same server over streamable HTTP. - **Authentication:** the active profile is used by default. Override with `--profile `, `--server` / `--api-key`, or the `REDMINE_*` environment variables -- exactly like every other subcommand. -- **Read-only by default.** Mutating tools (create / update / delete, comment, close, reopen, and similar write operations) are registered only when `--enable-writes` is passed. Without the flag they never appear in `tools/list`. +- **Read-only by default.** Mutating tools (create / update / delete, comment, close, reopen, and similar write operations) are registered only when `--enable-writes` is passed. Without the flag they never appear in `tools/list`. For a second, transport-level guarantee, set [read-only mode](/getting-started/configuration/#read-only-mode) (`read_only: true` in the profile or `REDMINE_READ_ONLY=1`) -- it blocks every write at the HTTP layer, even when `--enable-writes` is passed. - **Configurable surface.** `--enable-groups` / `--disable-groups` constrain the registered tools to specific categories (`issues`, `wiki`, `time`, ...). For sharper control, `--enable-tools` / `--disable-tools` allow- or deny-list individual tool names. Run `redmine mcp tools` to print the full catalog.