Matriosha Core CLI
Project description
╔══════════════════════════════════════════════════════════════════════════════════════════════╗
║ 10110010 01001101 00110101 11010010 01101001 10010111 00110011 01011010 11100010 ║
║ ║
║ ███╗ ███╗ █████╗ ████████╗ ██████╗ ██╗ ██████╗ ███████╗ ██╗ ██╗ █████╗ ║
║ ████╗ ████║ ██╔══██╗ ╚══██╔══╝ ██╔══██╗ ██║ ██╔═══██╗ ██╔════╝ ██║ ██║ ██╔══██╗ ║
║ ██╔████╔██║ ███████║ ██║ ██████╔╝ ██║ ██║ ██║ ███████╗ ███████║ ███████║ ║
║ ██║╚██╔╝██║ ██╔══██║ ██║ ██╔══██╗ ██║ ██║ ██║ ╚════██║ ██╔══██║ ██╔══██║ ║
║ ██║ ╚═╝ ██║ ██║ ██║ ██║ ██║ ██║ ██║ ╚██████╔╝ ███████║ ██║ ██║ ██║ ██║ ║
║ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ║
║ ║
║ 01011101 11001010 00101101 10100110 01110001 00011101 10011001 01101100 10101010 ║
╚══════════════════════════════════════════════════════════════════════════════════════════════╝
matriosha
“Visibility is a trap.”
— Michel Foucault, Discipline and Punish: The Birth of the Prison (1975)
Token-efficient memory infrastructure for humans and agents, with local-first encryption, user-owned data, and verifiable audit trails.
Table of Contents
- Why Matriosha
- Value Proposition
- Key Features
- Quick Start
- One-Shot Agent Connection Flow
- Usage Examples
- Local vs Managed Mode
- Architecture and Extensibility
- Documentation
- Development and Quality Gates
- Contributing
- Community and Support
- License
Why Matriosha
Most AI memory systems optimize for convenience, not sovereignty. Matriosha flips that default:
- Token-efficient memory layer: compact storage and retrieval flows designed for practical agent workloads.
- User ownership: your local vault, your passphrase, your control surface.
- Auditability: deterministic command paths and explicit action trails for security review.
Value Proposition
Matriosha helps you run memory + token workflows that are:
- Secure by default (local vault + encrypted artifacts)
- Operationally simple (clear CLI primitives)
- Future-proof (plugin contract for managed extensions)
Key Features
- Local-first encrypted vault initialization and verification
- Local agent token lifecycle: generate, inspect, list, revoke
- Local agent connection primitives for desktop/server/CI agents
- Pluggable architecture via
matriosha.pluginsentry points - Command-level JSON output support for automation
- CI-backed quality gates (ruff, mypy, pytest + coverage)
Quick Start
Prerequisites
- Python 3.11+
pip
Install from source (recommended for contributors)
git clone https://github.com/drizzoai-afk/matriosha.git
cd matriosha
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
Verify installation
matriosha --help
matriosha vault init --help
Initialize local secure workspace
matriosha vault init
matriosha vault verify
Generate a local token
matriosha token generate my-agent --local --scope write --expires 7d
One-Shot Agent Connection Flow
Use this when an agent needs a quick local bootstrap with minimal ceremony.
# 1) Initialize vault (one-time per profile)
matriosha vault init
# 2) Generate a local token for the agent
matriosha token generate my-agent --local --scope read --expires 24h
# 3) Connect agent in local mode
matriosha agent connect --local --name my-agent --kind server --token <PASTE_TOKEN>
For automation, prefer --json where available and pass secrets through secure environment handling rather than shell history.
Usage Examples
Script-friendly token generation
matriosha token generate ci-runner --local --scope admin --expires 30m --json
Inspect and revoke a token
matriosha token inspect <TOKEN_ID> --json
matriosha token revoke <TOKEN_ID> --json
Connect a desktop agent in plain output mode
matriosha --plain agent connect --local --name analyst-laptop --kind desktop --token <PASTE_TOKEN>
Local vs Managed Mode
| Capability | Local mode (--local) |
Managed mode (plugin-backed) |
|---|---|---|
| Data residency | User-controlled local environment | Service-managed environment |
| Token generation | Built into the CLI | Delegated via plugin hook (token_generate) |
| Agent connect | Built into the CLI | Delegated via plugin hook (agent_connect) |
| Billing/auth commands | Not in the CLI | Added by managed plugin |
| Offline operation | Yes | Usually no |
| Best for | Sovereign workflows, private dev, edge devices | Centralized fleet operations, hosted control planes |
If you call managed flows without a managed plugin installed, the CLI returns explicit guidance (e.g., install matriosha-managed or use --local).
Architecture and Extensibility
Matriosha keeps managed concerns out of the trust boundary. Extend behavior via plugin entrypoints:
- Entry point group:
matriosha.plugins - Hook model for selective command interception
- Clear contracts for token and agent command extension
See docs for hook names, behavior, and integration examples.
Documentation
- Plugin contract and hooks
- Dependency bootstrap and
matriosha init - Decoder plugin notes
- ADR index
- Security policy
Development and Quality Gates
pip install -e .[dev]
ruff check src tests
ruff format --check src tests
mypy --strict
pytest -q --cov --cov-report=term-missing
CI runs on pushes and pull requests to keep quality bars consistent.
Contributing
Contributions are welcome.
- Fork the repository
- Create a feature branch
- Add tests and docs for your change
- Run quality gates locally
- Open a pull request
Community and Support
- Open issues for bugs and feature requests
- Use PR discussions for design-level changes
- Security-sensitive reports: follow
SECURITY.md
License
Distributed under the BSD 3-Clause License. See LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file matriosha-0.1.0.tar.gz.
File metadata
- Download URL: matriosha-0.1.0.tar.gz
- Upload date:
- Size: 69.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c47c1d1d39d27a9d503697656fda842ddebc413988d98f32aebb94c937c2cd9
|
|
| MD5 |
b78f4d93e7eac55645a51bc5ff1ec6c1
|
|
| BLAKE2b-256 |
f07b7928c8fe0be7dffe87523d267109e5b4a6ddcf21d0fbdb97c160f7ae4825
|
File details
Details for the file matriosha-0.1.0-py3-none-any.whl.
File metadata
- Download URL: matriosha-0.1.0-py3-none-any.whl
- Upload date:
- Size: 79.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25904e8fd49b836e0334abd6b4e86048e064768cff7d84c274b70963c0e41551
|
|
| MD5 |
270eed01055465631e4d10b0fc1be806
|
|
| BLAKE2b-256 |
463a2a1c8f2fcae64595a405c47c1ad2019902329b34bd726611a10d2c208dc9
|