Expand description
CLI layer — clap definitions + command dispatch.
Each subcommand is a separate module. The CLI layer:
- Parses args into typed commands
- Locates project root (walk up from cwd, or
--rootflag) - Calls library functions
- Formats output (human-readable by default,
--jsonfor machine) - Maps
MarsErrorto exit codes and stderr messages
Re-exports§
pub use crate::types::MarsContext;
Modules§
- add
mars add <dependency>— add or update a dependency, then sync.- adopt
mars adopt <path>— move unmanaged target content into.mars-src/, then sync.- cache
mars cache— manage the global source cache.- check
mars check [PATH]— validate a source package before publishing.- doctor
mars doctor— validate state consistency.- export
mars export— produce a JSON representation of the compile plan.- init
mars init [TARGET] [--link DIR...]— scaffold a mars project.- link
mars link <dir>— manage target directories materialized from.mars/.- list
mars list— show available agents and skills.- models
- CLI handlers for
mars modelssubcommands. - outdated
mars outdated— show available updates without applying.- output
- Shared output formatting for CLI commands.
- override_
cmd mars override— set a local dev override for a source.- remove
mars remove <dependency>— remove a dependency from config and prune its items.- rename
mars rename— rename a managed item.- repair
mars repair— rebuild state from lock + dependencies.- resolve_
cmd mars resolve— mark conflicts as resolved after user fixes them.- sync
mars sync— resolve + install (make reality match config).- upgrade
mars upgrade— upgrade dependencies to newest versions.- validate
mars validate— dry-run compiler that reports diagnostics without writing.- version
mars version <bump|X.Y.Z> [--push]— bump package version, commit, and tag.- why
mars why <name>— explain why an item is installed.
Structs§
- Cli
- mars — agent package manager for agent and skill packages.
Enums§
Constants§
- TOOL_
DIRS - Tool-specific directories that commonly need linking.
mars linkwarns if the target isn’t in TOOL_DIRS or WELL_KNOWN. - WELL_
KNOWN - Deprecated generic output directories still recognized for migration hints.
Functions§
- dispatch
- Dispatch a parsed CLI command to the appropriate handler and map errors to the final exit code.
- find_
agents_ root - Find mars project root by walking up from start path to filesystem root.
- is_
symlink - Check if a path is a symlink (uses symlink_metadata, doesn’t follow).