Skip to content

Conversation

@abrookins
Copy link
Collaborator

@abrookins abrookins commented Nov 18, 2025

Add support for providing a pre-generated token value to the token add CLI command.

  • Introduce a new --token option for agent-memory token add
  • Reuse existing hashing, storage, and expiration logic for provided tokens
  • Preserve existing behavior when --token is not specified (token is generated as before)
  • Integrate provided tokens with the existing JSON output mode (token field reflects the provided value)
  • Add tests to verify behavior and ensure generate_token is not called when --token is supplied

Copilot AI review requested due to automatic review settings November 18, 2025 01:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for pre-generated tokens in the agent-memory token add CLI command, along with JSON output format support for token management commands.

  • Introduces a new --token option to accept pre-generated token values instead of auto-generating them
  • Adds --format option (text/json) to all token management commands (add, list, show) for programmatic consumption
  • Refactors command logic to return data structures that can be formatted as JSON or text

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
agent_memory_server/cli.py Adds --token and --format options to token commands; refactors add/list/show commands to support both text and JSON output formats
tests/test_token_cli.py Adds comprehensive tests for JSON output mode and pre-generated token functionality across add, list, and show commands

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@abrookins abrookins changed the base branch from main to feature/token-cli-json-output November 18, 2025 01:28
@abrookins abrookins merged commit f8a475c into feature/token-cli-json-output Nov 18, 2025
18 checks passed
@abrookins abrookins deleted the feature/token-add-custom-token branch November 18, 2025 01:46
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.

2 participants