detect_environment
Resolves the current environment slug (dev, staging, prod) by checking QRING_ENV, NODE_ENV, .q-ring.json, and git branch. Returns detected env and source for logging or tool chaining.
Instructions
[project] Resolve which environment slug (e.g. 'dev', 'staging', 'prod') the current invocation should collapse to. Use before reading secrets when you want to mirror the same env q-ring would auto-pick (e.g. to log it, or to pass through to another tool); prefer passing an explicit env to get_secret/env_generate when you already know which env you want. Read-only; checks the QRING_ENV env var, NODE_ENV, the project's .q-ring.json, and the current git branch in priority order. Returns JSON { env, source } (e.g. { env: 'dev', source: 'NODE_ENV' }), or a plain message indicating that no env could be detected.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | No | Absolute path to the project root for project-scoped secrets and policy resolution. Defaults to the MCP server's current working directory when omitted. |