Skip to main content

Agent package manager for .agents/ directories

Project description

mars

Mars is a package manager for agent directories. It installs agent profiles and skills from git and local sources into a .mars/ canonical store, records ownership in mars.lock, and copies managed content into configured target directories (.agents/, .claude/, .cursor/, etc.).

Quick Start

# Initialize with a target directory
mars init --link .claude

# Add sources
mars add haowjy/meridian-base
mars add haowjy/meridian-dev-workflow

# See what's installed
mars list

# Explain why an item is present
mars why reviewer

Why Mars

  • Install agents and skills from multiple sources into one managed tree
  • Resolve versions and transitive source dependencies before installation
  • Keep syncs safe: resolve full desired state, then apply atomically
  • Track ownership and checksums in mars.lock so managed and unmanaged files coexist
  • Copy managed content to multiple target directories (.agents/, .claude/, etc.)
  • Support day-to-day maintenance: upgrades, outdated checks, local overrides, rename rules, conflict resolution, repair flows
  • Package-distributed model aliases — no hardcoded builtins in the binary

Where Mars Fits

Mars is not an agent runtime. It sits underneath tools like Claude Code, Cursor, and Codex and manages the agent assets they read.

Alternative What Mars adds
Native .claude/agents Multi-source installs, versioning, lockfile-backed ownership, safer syncs, recovery
Skill installers Both agents and skills, explicit desired state in config, conflict handling, repair
Git submodules / vendored folders Real resolution, diff, plan, and apply pipeline

Install

Method Command
Cargo (crate) cargo install mars-agents
Cargo (latest main) cargo install --git https://github.com/haowjy/mars-agents
Python (pipx) pipx install mars-agents
Python (uv tool) uv tool install mars-agents
Python (pip) pip install mars-agents
npm npm install -g @haowjy/mars-agents
From source cargo install --path .

Prebuilt binaries: https://github.com/haowjy/mars-agents/releases

Platforms: macOS arm64/x64, Linux arm64/x64 (glibc). Others: build from source.

Source Inputs

Form Example
GitHub shorthand owner/repo or owner/repo@^1.0
HTTPS URL https://github.com/owner/repo
SSH URL git@github.com:owner/repo.git
Local path ../my-agents or /absolute/path

Commands

Area Commands
Source management add, remove, upgrade, outdated, override
Resolution Semver constraints, transitive deps, lockfile-backed replay
Install & reconcile sync, rename, resolve
Inspection list, why
Targets init [--link], managed target configuration via settings.targets
Model aliases models list, models refresh, models resolve
Validation & recovery check, doctor, repair
Cache cache info, cache clean

Global flags: --root <PATH>, --json.

How It Works

mars.toml + mars.lock (committed)
        ↓ mars sync
    .mars/ (canonical store, gitignored)
        ↓ copy to each target
    .agents/, .claude/, .cursor/ (committed, may contain non-mars content)

Every mutating command runs a typed pipeline:

load_config → resolve_graph → build_target → create_plan → apply_plan → sync_targets → finalize
  1. Resolve — fetch sources, discover transitive deps, merge model aliases from dependency tree
  2. Build target — discover items, apply filters, detect collisions
  3. Plan — diff desired state against lock + disk
  4. Apply — write resolved content to .mars/ (atomic writes via tmp+rename)
  5. Sync targets — copy from .mars/ to each configured target directory (never deletes files mars didn't create)
  6. Finalize — write lock, persist dependency model aliases, build report

Managed Layout

project/
  mars.toml          # Dependency config (committed)
  mars.lock          # Ownership registry (committed)
  mars.local.toml    # Dev overrides (gitignored)
  .mars/             # Canonical store (gitignored)
    agents/          # Resolved agent profiles
    skills/          # Resolved skills
    models-cache.json      # Cached model catalog
    models-merged.json     # Dependency-sourced model aliases
  .agents/           # Target directory (committed, may have non-mars content)
    agents/
    skills/
  .claude/           # Another target (committed)
    agents/
    skills/

Model Aliases

Model aliases are package-distributed — no builtins in the mars binary. Packages define aliases in their mars.toml under [models]:

# Pinned — explicit model ID
[models.opus]
harness = "claude"
model = "claude-opus-4-6"

# Auto-resolve — pattern matching against cached model catalog
[models.sonnet]
harness = "claude"
provider = "Anthropic"
match = ["sonnet"]
exclude = ["thinking"]

Merge precedence: consumer config > dependencies (declaration order, first wins).

mars models refresh          # Fetch model catalog from API
mars models list             # Show all aliases (deps + consumer config)
mars models resolve opus     # Resolve an alias to a concrete model ID

mars.toml Example

[dependencies.base]
url = "https://github.com/haowjy/meridian-base"
version = "^1.0"

[dependencies.dev]
path = "../my-dev-agents"

[dependencies.ops]
url = "https://github.com/acme/ops-agents"
only_skills = true

[models.opus]
harness = "claude"
provider = "Anthropic"
match = ["opus"]

[settings]
targets = [".agents", ".claude"]

After editing mars.toml, run mars sync to apply changes.

Documentation

Detailed documentation is in docs/:

  • Overview — Core concepts and quick start
  • Configurationmars.toml reference: all fields, filter modes, settings
  • CLI Reference — Every subcommand with flags, examples, and behavior
  • Sync Pipeline — How sync works: resolve → target → diff → apply → sync targets → finalize
  • Conflicts — Collision handling, merge, conflict resolution
  • Lock File — Lock file format and semantics
  • Local Development — Overrides, local paths, submodules
  • Troubleshootingmars doctor, mars repair, common problems

Design Constraints

  • Resolve first, then act. If resolution fails, nothing is mutated.
  • Config, lock, and installed files use atomic writes (tmp+rename).
  • mars.lock is the authority for what Mars manages.
  • Target directories are shared — mars never deletes files it didn't create.
  • User intent comes from explicit flags and arguments, not heuristics.
  • No builtin model aliases — all aliases come from packages or consumer config.

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

mars_agents-0.0.7.tar.gz (193.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mars_agents-0.0.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

mars_agents-0.0.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

mars_agents-0.0.7-py3-none-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

mars_agents-0.0.7-py3-none-macosx_10_12_x86_64.whl (2.4 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file mars_agents-0.0.7.tar.gz.

File metadata

  • Download URL: mars_agents-0.0.7.tar.gz
  • Upload date:
  • Size: 193.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mars_agents-0.0.7.tar.gz
Algorithm Hash digest
SHA256 f1020d8bc4c0d3f07bdd14b179e8df68aaa4b2bdbbe4ce248cc27d6563198464
MD5 9b55e8447df4527d10c7701c9b6a39dd
BLAKE2b-256 3d0b9489b987a2fdffb8db4fff4e1cf8ea65026e37e5cab7b7454cd095706312

See more details on using hashes here.

Provenance

The following attestation bundles were made for mars_agents-0.0.7.tar.gz:

Publisher: release.yml on haowjy/mars-agents

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mars_agents-0.0.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mars_agents-0.0.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e25a70594bc0420e5944d894d09f2020662220814709691fdc9a1a6819885670
MD5 e8bdc5dd5a97cb9a78042c9cd80545d1
BLAKE2b-256 3a10f6530663b3703e741aa12cbb027e9dcfb72dee24df1a396fee597ed61029

See more details on using hashes here.

Provenance

The following attestation bundles were made for mars_agents-0.0.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on haowjy/mars-agents

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mars_agents-0.0.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mars_agents-0.0.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b84e14f131a9adbe77c0feaf6071d1973d58f43c9b43c52a6843af2e0706c81e
MD5 9719ba866613a06569067102b7771e1e
BLAKE2b-256 7d6626366411485b853a1e0e88e017a1900200212c0415ebd9b412e89cff457c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mars_agents-0.0.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on haowjy/mars-agents

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mars_agents-0.0.7-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mars_agents-0.0.7-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 38eae68e36a18dbd320796d93965bdbd82411fb81ed52c20562c050800905a73
MD5 b2e8779fbf12ad15a3c558523681f4cf
BLAKE2b-256 e2cadf6d6df74ae8c58728fe7cdcbfa99bd67cf075c5cc16a4fe5fe0577b98e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for mars_agents-0.0.7-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on haowjy/mars-agents

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mars_agents-0.0.7-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mars_agents-0.0.7-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 77b89ca03b87ca338a3cad72e0b2ddb83838858d5c7c41a2a1abf8419a0e9a1e
MD5 4fb0b950871d91151465d67da8e3d5ed
BLAKE2b-256 55ab7b52279878f808f72676fc32e0cf3a7aefa02b8d71ad21482f127d320301

See more details on using hashes here.

Provenance

The following attestation bundles were made for mars_agents-0.0.7-py3-none-macosx_10_12_x86_64.whl:

Publisher: release.yml on haowjy/mars-agents

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page