You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Later steps can use `AGENT_MEMORY_TOKEN` as the bearer token when calling the API.
113
+
114
+
#### Terraform example (register a pre-generated token)
115
+
116
+
If you generate tokens outside Redis Agent Memory Server (for example via a secrets manager), you can register them using `--token` so the server only ever stores a hash:
117
+
118
+
```hcl
119
+
variable "agent_memory_token" {
120
+
type = string
121
+
sensitive = true
122
+
}
123
+
124
+
resource "null_resource" "agent_memory_token" {
125
+
provisioner "local-exec" {
126
+
command = <<EOT
127
+
TOKEN_JSON=$(agent-memory token add \
128
+
--description "Terraform bootstrap" \
129
+
--token "${var.agent_memory_token}" \
130
+
--format json)
131
+
echo "$TOKEN_JSON" > agent-memory-token.json
132
+
EOT
133
+
}
134
+
}
135
+
```
136
+
137
+
In both cases, store the plaintext token in a secure secret store (GitHub Actions secrets, Terraform variables, Vault, etc.). The server will hash it before storing, and the CLI will only ever print the plaintext once.
-`--description TEXT` / `-d TEXT`: **Required**. Description for the token (e.g., "API access for service X")
143
143
-`--expires-days INTEGER` / `-e INTEGER`: **Optional**. Number of days until token expires. If not specified, token never expires.
144
+
-`--format [text|json]`: **Optional**. Output format. `text` (default) is human-readable; `json` is machine-readable and recommended for CI or scripting.
145
+
-`--token TEXT`: **Optional**. Use a pre-generated token value instead of having the CLI generate one. The CLI will hash and store the token but only prints the plaintext once.
Lists all authentication tokens, showing masked token hashes, descriptions, and expiration dates.
160
168
161
169
```bash
162
-
agent-memory token list
170
+
agent-memory token list [--format text|json]
163
171
```
164
172
173
+
When `--format json` is used, the command prints a JSON array of token summaries suitable for scripting and CI pipelines. The default `text` format produces human-readable output like the example below.
174
+
165
175
**Example Output:**
166
176
```
167
177
Authentication Tokens:
@@ -183,9 +193,11 @@ Expires: Never
183
193
Shows detailed information about a specific token. Supports partial hash matching for convenience.
184
194
185
195
```bash
186
-
agent-memory token show TOKEN_HASH
196
+
agent-memory token show TOKEN_HASH [--format text|json]
187
197
```
188
198
199
+
When `--format json` is used, the command prints a JSON object with token details (including status) suitable for scripting and CI pipelines. The default `text` format produces human-readable output.
200
+
189
201
**Arguments:**
190
202
191
203
-`TOKEN_HASH`: The token hash (or partial hash) to display. Can be the full hash or just the first few characters.
0 commit comments