How grimoire-rs/grimoire works
Grimoire (grim) is a package manager for AI-agent configuration artifacts. Its main workflow declares artifacts, resolves registry references, pins content in grimoire.lock, fetches OCI content, then materializes client-specific files. The graph also preserves documented catalog browsing, publishing, export, hooks, TUI, and MCP capabilities. Edges are limited to relationships shown by the README or SOURCE INDEX; unsampled subsystem internals are represented at their existing directory paths.
Main entry points: add.rs Add workflow · resolver.rs Artifact resolver · installer.rs Install orchestration · main.rs CLI entry
Components 23
CLI and workflows
- CLI entry
src/main.rs - Command dispatch
src/command.rs - Add workflow
src/command/add.rs - Project declaration
src/config/declaration.rs
Resolution and registry
- Registry resolution
src/config/registry_resolve.rs - Artifact resolver
src/resolve/resolver.rs - OCI access
src/oci/access/registry_client.rs - Registry service
src/catalog/registry_catalog.rs - Registry authentication
src/auth.rs
Artifact lifecycle
- Lockfile
src/lock/grimoire_lock.rs - Lockfile I/O
src/lock/lock_io.rs - Artifact fetch
src/fetch.rs - Install orchestration
src/install/installer.rs - Export
src/export/stage.rs - Publish and release
src/command/publish.rs
Agent integrations
- Client transforms
src/install/client_target.rs - Agent configuration
src/install/vendor.rs - Hook workflows
src/command/hook/pipeline.rs
Discovery and interfaces
- Catalog search
src/catalog/catalog_service.rs - Search command
src/command/search.rs - Interactive browser
src/tui/app.rs - MCP server
src/mcp/server.rs
Other components
- User
Connections 22
- User → CLI entry: runs commands
README.md - CLI entry → Command dispatch: routes commands
src/main.rs - Command dispatch → Add workflow: dispatches add
src/main.rs - Add workflow → Project declaration: updates declaration
src/command/add.rs - Add workflow → Registry resolution: resolves registry
src/command/add.rs - Registry resolution → Artifact resolver: supplies references
- Artifact resolver → OCI access: queries OCI
src/resolve/resolver.rs - OCI access → Registry authentication: authenticates
src/oci/access/registry_client.rs - Artifact resolver → Lockfile: pins artifacts
src/resolve/resolver.rs - Lockfile I/O → Lockfile: loads and saves
src/lock/lock_io.rs - User → Install orchestration: runs install
README.md - Install orchestration → Artifact fetch: fetches artifacts
- Install orchestration → Client transforms: materializes targets
src/install/client_target.rs - Client transforms → Agent configuration: writes client layouts
src/install/client_target.rs - User → Search command: searches catalog
README.md - Search command → Catalog search: queries catalog
src/command/search.rs - Catalog search → Registry service: uses registry catalog
src/catalog/catalog_service.rs - User → Interactive browser: browses index
README.md - User → MCP server: connects MCP
- User → Hook workflows: manages hooks
- User → Export: exports artifacts
- User → Publish and release: publishes artifacts