Skip to main content

Export/import OpenClaw skills, workspace context files, and config fragments as portable .tar.gz bundles

Project description

max-context-share

CLI tool to export and import OpenClaw skills, workspace context files, and config fragments as a portable .tar.gz bundle.

Note: This is the Python rewrite of the original TypeScript version. Bundles are fully compatible between both versions.

Running the CLI

Option A: via pip / uv (recommended)

# Install with pip
pip install max-context-share

# Or install with uv
uv pip install max-context-share

# Run
max-ctx export
max-ctx import ./sample-context.tar.gz

Option B: run directly from source

Clone or download this repo, then:

# 1. Enter the project directory
cd max-context-share

# 2. Create venv and install with uv
uv venv .venv --python=3.10
uv sync

# 3. Run via uv
uv run max-ctx export
uv run max-ctx import ./sample-context.tar.gz

# Or activate the venv and run directly
source .venv/bin/activate
max-ctx export --dry-run

Usage

Export

Package your local OpenClaw skills, workspace files, and config fragment into a shareable archive:

# Export everything (all skills + workspace files + config)
max-ctx export

# Specify output path
max-ctx export --output /tmp/my-context.tar.gz

# Export specific skills only
max-ctx export --skills github,weather,habit-reminder

# Exclude workspace files or config fragment
max-ctx export --no-workspace
max-ctx export --no-config-fragment

# Preview what would be exported
max-ctx export --dry-run

# JSON output (useful for scripting)
max-ctx export --dry-run --json

Import

Import an archive into your local OpenClaw installation:

# Import with merge strategy (default: skip existing)
max-ctx import /tmp/my-context.tar.gz

# Overwrite existing skills and workspace files
max-ctx import /tmp/my-context.tar.gz --overwrite

# Import only skills, skip workspace files
max-ctx import /tmp/my-context.tar.gz --no-workspace

# Preview what would be imported
max-ctx import /tmp/my-context.tar.gz --dry-run

Note: The config fragment is never written automatically. On import, its contents are printed so you can review and apply settings manually via openclaw config set ....


Bundle Format

The generated .tar.gz contains:

<timestamp>-openclaw-context/
  manifest.json              # Metadata: schema version, skills list, etc.
  skills/
    bundled/                 # Skills shipped with openclaw
      <slug>/
        SKILL.md
        ...
    managed/                 # Installed via `openclaw skills install`
      <slug>/
    personal-agents/         # ~/.agents/skills/
      <slug>/
    project-agents/          # <workspace>/.agents/skills/
      <slug>/
    workspace/               # <workspace>/skills/
      <slug>/
  workspace/
    AGENTS.md
    SOUL.md
    TOOLS.md
    IDENTITY.md
    USER.md
    HEARTBEAT.md
    BOOTSTRAP.md
    MEMORY.md
  config-fragment.json       # Safe config subset (no secrets)

Config Fragment

The config fragment only includes safe, non-secret fields from openclaw.json:

  • agents.defaults — model, thinking preferences
  • agents.list[].skills — per-agent skill allowlists
  • skills.allowBundled / skills.limits

Credentials, tokens, OAuth settings, gateway config, and any field containing secret, token, key, password, auth, or credential are never exported.


Skill Sources

OpenClaw loads skills from multiple locations. max-ctx export scans all of them:

Source Path Description
bundled <openclaw-pkg>/skills/ Shipped with openclaw (auto-detected via which openclaw)
managed ~/.openclaw/skills/ Installed via openclaw skills install
personal-agents ~/.agents/skills/ Personal skills shared across all workspaces
project-agents <workspace>/.agents/skills/ Project-local skills (can be committed to git)
workspace <workspace>/skills/ Workspace-local skills

Precedence on conflict (same slug): workspace > project-agents > personal-agents > managed > bundled.


Merge Strategies

Mode Skills Workspace files
--merge (default) Skip existing slugs, print warning Skip existing files, print notice
--overwrite Replace existing slugs entirely Overwrite existing files

Paths

Paths are resolved from environment variables (same conventions as OpenClaw core):

Path Default Override
State directory ~/.openclaw/ OPENCLAW_STATE_DIR
Workspace ~/.openclaw/workspace/ OPENCLAW_PROFILE
Managed skills ~/.openclaw/skills/
Config file ~/.openclaw/openclaw.json
Bundled skills auto-detected from openclaw binary OPENCLAW_BUNDLED_SKILLS_DIR

Profile support: if OPENCLAW_PROFILE=prod, workspace resolves to ~/.openclaw/workspace-prod/.


Python API (Sync + Async)

You can also use max-context-share as a library:

from max_context_share.export_bundle import (
    ExportOptions, run_export, async_run_export,
)
from max_context_share.import_bundle import (
    ImportOptions, run_import, async_run_import,
)

# Sync
result = run_export(ExportOptions(dry_run=True))
print(result.skills)

# Async
import asyncio
result = asyncio.run(
    async_run_export(ExportOptions(dry_run=True))
)

Example

An example bundle is included in the example/ directory:

# Inspect the example bundle
tar tf example/sample-context.tar.gz

# Do a dry-run import to see what would change
max-ctx import example/sample-context.tar.gz --dry-run

Development

# Setup
uv venv .venv --python=3.10
uv sync

# Lint
uv run ruff check src/ tests/

# Test (60 tests across 6 modules)
uv run pytest -v

# Run from source
uv run max-ctx --help
uv run max-ctx export --dry-run

Cross-Compatibility

Bundles created by the Python version are fully compatible with the TypeScript version and vice versa:

  • manifest.json uses identical camelCase keys (schemaVersion, createdAt, workspaceFiles, hasConfigFragment)
  • Archive directory layout is identical
  • Same 8 workspace files, same skill source precedence
  • Same config fragment safe-field extraction

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

max_context_share-0.1.0.tar.gz (391.3 kB view details)

Uploaded Source

Built Distribution

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

max_context_share-0.1.0-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file max_context_share-0.1.0.tar.gz.

File metadata

  • Download URL: max_context_share-0.1.0.tar.gz
  • Upload date:
  • Size: 391.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for max_context_share-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ed0accff9028a3e33310b3e39f7742cd745077d72fac370d2a19e081d9b6a884
MD5 338902ff9907c69d4a4dfffb48ebbb3c
BLAKE2b-256 663ed481d8ad9aacc910784a64d224889e6fed1b940113c98a5f9ea0e25938a2

See more details on using hashes here.

File details

Details for the file max_context_share-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for max_context_share-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 72eab6fe6a0fcbbfbcfc54fe6688e16501eb059be951aec565dc1c2ab39120d9
MD5 7d2f28104c40dda2905674c575cf5c0e
BLAKE2b-256 d69442a7f1e070a9947222ef8c8cd7972c78fc87390b1ae569fe6356474066b4

See more details on using hashes here.

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