Consent
Security toolkit for managing consent records — generate tokens, check strength, rotate credentials, audit logs, store and retrieve entries, manage policies, and produce compliance reports. All data remains on disk.
Commands
| Command |
Description |
consent generate <input> |
Generate a new entry and log it |
consent check-strength <input> |
Check strength of a given input and record the result |
consent rotate <input> |
Rotate a credential or token and log the change |
consent audit <input> |
Record an audit entry for compliance tracking |
consent store <input> |
Store a value securely in the local data log |
consent retrieve <input> |
Retrieve a previously stored value |
consent expire <input> |
Mark an entry as expired |
consent policy <input> |
Record or update a policy entry |
consent report <input> |
Generate a report entry for review |
consent hash <input> |
Hash a value and store the result |
consent verify <input> |
Verify a value against stored records |
consent revoke <input> |
Revoke a previously granted consent or credential |
consent stats |
Show summary statistics: entry counts, data size, first activity date |
consent export <fmt> |
Export all data in json, csv, or txt format |
consent search <term> |
Search across all logs for a keyword |
consent recent |
Show the 20 most recent activity entries |
consent status |
Health check: version, data dir, entry count, disk usage, last activity |
consent help |
Show help with all available commands |
consent version |
Show current version |
Command Behavior
- With arguments: Each command logs the input with a timestamp to its own dedicated log file (e.g.,
generate.log, audit.log)
- Without arguments: Each command displays the 20 most recent entries from its log file
Data Storage
- Default data directory:
~/.local/share/consent/
- Per-command logs:
$DATA_DIR/<command>.log (e.g., generate.log, audit.log, store.log)
- History log:
$DATA_DIR/history.log — master timeline of all activity
- Export files:
$DATA_DIR/export.<fmt> — generated by the export command
- All data is local plain-text. No network calls, no cloud sync.
Requirements
- Bash 4+ (uses
set -euo pipefail)
- No external dependencies or API keys required
- Works entirely offline — your data stays on your machine
When to Use
- Tracking consent and compliance — Record who consented to what and when with
store, audit, and policy for a simple compliance trail
- Credential rotation logging — Use
rotate and expire to log when credentials were changed or invalidated
- Security auditing — Run
audit entries and pull report data to review security posture over time
- Exporting compliance data — Use
export json or export csv to produce machine-readable records for external auditing tools
- Quick lookups and verification — Search across all logs with
search or verify specific entries with verify and hash
Examples
# Store a consent record
consent store "user:alice accepted terms-of-service v2.1"
# Audit a policy change
consent audit "updated data retention policy to 90 days"
# Generate a new token entry
consent generate "api-key-prod-2025"
# Rotate a credential and log it
consent rotate "db-password-main rotated"
# Check strength of a passphrase
consent check-strength "my-complex-passphrase-2025!"
# Export all data as JSON
consent export json
# Search across all logs
consent search "alice"
# View summary statistics
consent stats
# Health check
consent status
# Show recent activity
consent recent
How It Works
Each domain command (generate, audit, store, etc.) maintains its own log file in the data directory. Entries are stored as timestamp|value lines. The stats command aggregates counts across all log files. The export command merges all logs into a single file in your chosen format. Every action is also recorded in history.log as a master audit trail.
Tips
- Run any command without arguments to see its recent entries — great for quick review
- Use
consent recent to see a timeline of all activity across all commands
- Pipe exports to other tools:
consent export csv && cat ~/.local/share/consent/export.csv | head
- Combine
search with grep for complex queries: consent search "2025" | grep "policy"
- Run
consent help at any time for the full command reference
Powered by BytesAgain | bytesagain.com | hello@bytesagain.com
1---2name: consent3description: Build cookie consent banners and track opt-in compliance status. Use when implementing GDPR consent, auditing cookies, generating privacy banners.4license: MIT-05---6
7# Consent
8
9Security toolkit for managing consent records — generate tokens, check strength, rotate credentials, audit logs, store and retrieve entries, manage policies, and produce compliance reports. All data remains on disk.
10
11## Commands
12
13| Command | Description |
14|---------|-------------|
15| `consent generate <input>` | Generate a new entry and log it |
16| `consent check-strength <input>` | Check strength of a given input and record the result |
17| `consent rotate <input>` | Rotate a credential or token and log the change |
18| `consent audit <input>` | Record an audit entry for compliance tracking |
19| `consent store <input>` | Store a value securely in the local data log |
20| `consent retrieve <input>` | Retrieve a previously stored value |
21| `consent expire <input>` | Mark an entry as expired |
22| `consent policy <input>` | Record or update a policy entry |
23| `consent report <input>` | Generate a report entry for review |
24| `consent hash <input>` | Hash a value and store the result |
25| `consent verify <input>` | Verify a value against stored records |
26| `consent revoke <input>` | Revoke a previously granted consent or credential |
27| `consent stats` | Show summary statistics: entry counts, data size, first activity date |
28| `consent export <fmt>` | Export all data in `json`, `csv`, or `txt` format |
29| `consent search <term>` | Search across all logs for a keyword |
30| `consent recent` | Show the 20 most recent activity entries |
31| `consent status` | Health check: version, data dir, entry count, disk usage, last activity |
32| `consent help` | Show help with all available commands |
33| `consent version` | Show current version |
34
35### Command Behavior
36
37- **With arguments**: Each command logs the input with a timestamp to its own dedicated log file (e.g., `generate.log`, `audit.log`)
38- **Without arguments**: Each command displays the 20 most recent entries from its log file
39
40## Data Storage
41
42- Default data directory: `~/.local/share/consent/`
43- Per-command logs: `$DATA_DIR/<command>.log` (e.g., `generate.log`, `audit.log`, `store.log`)
44- History log: `$DATA_DIR/history.log` — master timeline of all activity
45- Export files: `$DATA_DIR/export.<fmt>` — generated by the `export` command
46- All data is local plain-text. No network calls, no cloud sync.
47
48## Requirements
49
50- Bash 4+ (uses `set -euo pipefail`)
51- No external dependencies or API keys required
52- Works entirely offline — your data stays on your machine
53
54## When to Use
55
561. **Tracking consent and compliance** — Record who consented to what and when with `store`, `audit`, and `policy` for a simple compliance trail
572. **Credential rotation logging** — Use `rotate` and `expire` to log when credentials were changed or invalidated
583. **Security auditing** — Run `audit` entries and pull `report` data to review security posture over time
594. **Exporting compliance data** — Use `export json` or `export csv` to produce machine-readable records for external auditing tools
605. **Quick lookups and verification** — Search across all logs with `search` or verify specific entries with `verify` and `hash`
61
62## Examples
63
64```bash
65# Store a consent record
66consent store "user:alice accepted terms-of-service v2.1"
67
68# Audit a policy change
69consent audit "updated data retention policy to 90 days"
70
71# Generate a new token entry
72consent generate "api-key-prod-2025"
73
74# Rotate a credential and log it
75consent rotate "db-password-main rotated"
76
77# Check strength of a passphrase
78consent check-strength "my-complex-passphrase-2025!"
79
80# Export all data as JSON
81consent export json
82
83# Search across all logs
84consent search "alice"
85
86# View summary statistics
87consent stats
88
89# Health check
90consent status
91
92# Show recent activity
93consent recent
94```
95
96## How It Works
97
98Each domain command (generate, audit, store, etc.) maintains its own log file in the data directory. Entries are stored as `timestamp|value` lines. The `stats` command aggregates counts across all log files. The `export` command merges all logs into a single file in your chosen format. Every action is also recorded in `history.log` as a master audit trail.
99
100## Tips
101
102- Run any command without arguments to see its recent entries — great for quick review
103- Use `consent recent` to see a timeline of all activity across all commands
104- Pipe exports to other tools: `consent export csv && cat ~/.local/share/consent/export.csv | head`
105- Combine `search` with grep for complex queries: `consent search "2025" | grep "policy"`
106- Run `consent help` at any time for the full command reference
107
108---
109
110Powered by BytesAgain | bytesagain.com | hello@bytesagain.com