@getengram/cli
v0.3.4
Published
CLI for Engram — persistent memory for AI agents
Downloads
905
Maintainers
Readme
@getengram/cli
Command-line interface for Engram — persistent memory for AI agents.
Install
# npm
npm install -g @getengram/cli
# or run directly
npx @getengram/cli search "your query"Setup
# Authenticate
engram auth login engram_sk_live_YOUR_API_KEY
# Or use environment variable
export ENGRAM_API_KEY=engram_sk_live_YOUR_API_KEYCommands
Authentication
engram auth login <key> # Save API key
engram auth logout # Remove credentials
engram auth status # Show auth statusConversations
# List all conversations
engram conversations list
engram conversations list --agent my-agent --tags prod,deploy
# Create a conversation
engram conversations create --title "Deploy Log" --tags prod
# Get conversation with messages
engram conversations get conv_abc123
# Delete a conversation
engram conversations delete conv_abc123 --forceStore Messages
# Store a message
engram store -c conv_abc123 "Deployed v2.1.0 to production"
# Store with specific role
engram store -c conv_abc123 --role assistant "Deploy complete"
# Store tool output
engram store -c conv_abc123 --role tool --tool deploy "Success: v2.1.0"
# Pipe from stdin
echo "log output here" | engram store -c conv_abc123 --file -
# Store from file
engram store -c conv_abc123 --file ./deploy.logSearch
# Semantic search across all memory
engram search "when did we deploy v2"
# Limit results
engram search "error handling" --limit 5
# Search within a conversation
engram search "config change" --conversation conv_abc123
# Filter by tags
engram search "production issues" --tags prod,apiOutput Formats
Every command supports --json for machine-readable output:
engram conversations list --json
engram search "deploy" --json | jq '.results[0].score'Configuration
Credentials are stored in ~/.engram/config.json.
Environment Variables
| Variable | Description |
|----------|-------------|
| ENGRAM_API_KEY | API key (overrides saved config) |
| ENGRAM_BASE_URL | Custom endpoint (default: https://mcp.getengram.app) |
Examples
Log agent sessions
# Create a session
CONV=$(engram conversations create --title "Agent Run $(date +%F)" --json | jq -r '.conversationId')
# Store messages as the agent runs
engram store -c $CONV "User asked to refactor auth module"
engram store -c $CONV --role assistant "Analyzing auth module..."
engram store -c $CONV --role tool --tool code_review "Found 3 issues"
# Later, search across all sessions
engram search "auth module issues"Pipe build output
npm run build 2>&1 | engram store -c conv_builds --file -Export conversation as JSON
engram conversations get conv_abc123 --json > conversation.jsonLicense
MIT — getengram.app
