Skip to content

feat(trust): add clx trust command for auto-allow mode#15

Merged
blackaxgit merged 1 commit intomainfrom
feat/trust-command
Mar 27, 2026
Merged

feat(trust): add clx trust command for auto-allow mode#15
blackaxgit merged 1 commit intomainfrom
feat/trust-command

Conversation

@blackaxgit
Copy link
Copy Markdown
Owner

Summary

  • Add clx trust on/off/status subcommands for managing auto-allow mode
  • Upgrade trust token from plain file to JSON with configurable duration, session scope, and metadata
  • Add trust_mode_max_duration and trust_mode_default_duration config fields
  • Backward compatible with existing trust_mode config

Usage

clx trust on                    # Enable for 1 hour (default)
clx trust on --duration 30m     # Enable for 30 minutes
clx trust on --duration 2h      # Enable for 2 hours
clx trust on --session          # Enable for current session only
clx trust off                   # Disable immediately
clx trust status                # Show status with remaining time
clx trust status --json         # Structured JSON output

Test plan

  • clx trust on creates JSON token and prints confirmation
  • clx trust on --duration 30m sets 30-minute expiry
  • clx trust off removes token immediately
  • clx trust status shows active/inactive with remaining time
  • clx trust status --json outputs valid structured JSON
  • PreToolUse hook reads JSON token and auto-allows when valid
  • 132 unit + 38 integration tests pass (4 new trust tests)
  • 0 clippy warnings, cargo fmt clean
  • Backward compatible with old token format

Generated with Claude Code

Add clx trust on/off/status subcommands to manage trust mode:
- clx trust on [--duration 30m/1h/2h/8h] [--session]
- clx trust off (immediate disable)
- clx trust status [--json]

Upgrades trust mode from plain file token to JSON token with:
- Configurable duration (5m-24h, default 1h)
- Session-scoped trust via --session flag
- Rich metadata (enabled_at, expires_at, enabled_by)
- Backward compatible with old token format

Config additions:
- trust_mode_max_duration (default 24h)
- trust_mode_default_duration (default 1h)

Includes 4 CLI integration tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@blackaxgit blackaxgit merged commit c24ac68 into main Mar 27, 2026
7 checks passed
@blackaxgit blackaxgit deleted the feat/trust-command branch March 27, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant