| name | git-mcp-memory-cli |
| description | Use git-mcp-memory from the command line to save, search, sync, inspect, and recover Git-backed AI memories. Trigger this skill when a user asks to use the git-mcp-memory CLI, persist or retrieve agent memory without MCP tools, verify memory repository state, handle push failures, run retry-push, or script JSON-first memory operations. |
git-mcp-memory CLI
Core Rules
- Prefer
/Users/towada/.local/bin/git-mcp-memory when it exists; otherwise use git-mcp-memory from PATH.
- Use
--output json unless the user explicitly asks for text or NDJSON.
- Do not use interactive prompts. If required input is missing, fail and report the structured error.
- Do not save secrets, API keys, private keys, tokens, personal information, customer names, or company names unless the local config explicitly permits the configurable category.
- Never repeat rejected secret values back to the user.
- Surface all
warnings from command responses. They are part of the operational state.
Command Selection
Use these commands for common tasks:
git-mcp-memory status --output json
git-mcp-memory schema --output json
git-mcp-memory save --workspace "$PWD" --title "Title" --content "Markdown body" --output json
git-mcp-memory save --workspace "$PWD" --title "Title" --content "Markdown body" --dry-run --output json
git-mcp-memory search "query" --workspace "$PWD" --limit 5 --output json
git-mcp-memory search "query" --all --limit 10 --output json
git-mcp-memory sync --output json
git-mcp-memory retry-push --output json
git-mcp-memory retry-push --dry-run --output json
Use --input json when constructing requests programmatically:
printf '%s\n' '{"current_workspace_path":"/path/to/project","title":"Title","content":"Markdown body"}' \
| git-mcp-memory save --input json --output json
Save Workflow
- Run
save --dry-run --output json when content is newly generated, long, or riskier than a small operational note.
- Confirm the response has
"ok": true and an embedding_dim greater than zero.
- Run
save --output json with the same title/content.
- Check:
data.pushed == true
data.indexed == true
warnings is empty
- If
pushed == false, do not retry by saving again. Use retry-push.
Search Workflow
Project search:
git-mcp-memory search "query" --workspace "/path/to/project" --limit 5 --output json
Cross-project search:
git-mcp-memory search "query" --all --limit 10 --output json
Reduce output only when needed:
git-mcp-memory search "query" --all --fields title,path --snippet-chars 300 --output json
If search returns sync_failed_local_results, report that results are based on local repository state and run:
git-mcp-memory retry-push --output json
Push Failure Recovery
If save returns a warning like push_failed:
- Treat the memory as locally committed but not remotely synchronized.
- Run:
git-mcp-memory retry-push --dry-run --output json
git-mcp-memory retry-push --output json
- If
retry-push still fails, report:
error_category
unpushed_commit_count
- whether search can continue locally
- Do not delete local commits automatically.
Status Checks
Use status --output json before or after risky operations. Important fields:
git_dir
remote_url
current_branch
unpushed_commit_count
dirty_working_tree
indexed_document_count
failed_embedding_count
assets_ready
embedding_model_ready
tokenizer_ready
onnx_runtime_ready
The healthy baseline is:
{
"unpushed_commit_count": 0,
"dirty_working_tree": false,
"failed_embedding_count": 0,
"assets_ready": true
}
On first use, assets_ready may be false because the command has not downloaded the ONNX model, tokenizer, and ONNX Runtime yet. Treat the first save, search, or sync as a setup operation that can take longer than usual, and surface download errors instead of retrying blindly.
Expected Failure Behavior
- Empty query:
validation_failed on query.
- Empty save content: command-level
content is required.
- Secret or private content:
content_rejected_by_security_policy.
- Push network/auth failure: local commit remains,
pushed:false, push_failed warning.
- Search during push failure: returns local results when possible, with
sync_failed_local_results.
Reporting
When reporting results to the user, include only the operationally useful fields:
- save:
project_id, path, commit_hash, pushed, indexed, warning codes
- search: top titles/paths/scores and any warning codes
- retry-push:
pushed, unpushed_commit_count, error_category
- status: dirty state, unpushed count, failed embedding count