max-context-share 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. max_context_share-0.1.0/.gitignore +33 -0
  2. max_context_share-0.1.0/PKG-INFO +257 -0
  3. max_context_share-0.1.0/README.md +246 -0
  4. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/manifest.json +236 -0
  5. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/1password/SKILL.md +70 -0
  6. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/1password/references/cli-examples.md +29 -0
  7. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/1password/references/get-started.md +17 -0
  8. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/apple-notes/SKILL.md +77 -0
  9. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/apple-reminders/SKILL.md +118 -0
  10. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/bear-notes/SKILL.md +107 -0
  11. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/blogwatcher/SKILL.md +69 -0
  12. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/blucli/SKILL.md +47 -0
  13. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/bluebubbles/SKILL.md +131 -0
  14. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/camsnap/SKILL.md +45 -0
  15. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/canvas/SKILL.md +198 -0
  16. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/clawhub/SKILL.md +77 -0
  17. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/coding-agent/SKILL.md +316 -0
  18. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/discord/SKILL.md +197 -0
  19. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/eightctl/SKILL.md +50 -0
  20. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/gemini/SKILL.md +43 -0
  21. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/gh-issues/SKILL.md +881 -0
  22. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/gifgrep/SKILL.md +79 -0
  23. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/github/SKILL.md +163 -0
  24. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/gog/SKILL.md +116 -0
  25. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/goplaces/SKILL.md +52 -0
  26. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/healthcheck/SKILL.md +245 -0
  27. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/himalaya/SKILL.md +257 -0
  28. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/himalaya/references/configuration.md +184 -0
  29. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/himalaya/references/message-composition.md +199 -0
  30. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/imsg/SKILL.md +122 -0
  31. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/max_skills/README.md +10 -0
  32. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/max_skills/metaclaw/SKILL.md +414 -0
  33. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/max_skills/metaclaw/references/architecture.md +385 -0
  34. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/max_skills/metaclaw/references/cli-reference.md +463 -0
  35. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/max_skills/metaclaw/references/troubleshooting.md +406 -0
  36. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/max_skills/tinker/SKILL.md +348 -0
  37. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/max_skills/tinker/references/cli-reference.md +365 -0
  38. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/max_skills/tinker/references/cookbook-recipes.md +432 -0
  39. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/max_skills/tinker/references/troubleshooting.md +319 -0
  40. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/mcporter/SKILL.md +61 -0
  41. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/metaclaw/SKILL.md +414 -0
  42. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/metaclaw/references/architecture.md +385 -0
  43. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/metaclaw/references/cli-reference.md +463 -0
  44. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/metaclaw/references/troubleshooting.md +406 -0
  45. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/model-usage/SKILL.md +69 -0
  46. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/model-usage/references/codexbar-cli.md +33 -0
  47. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/model-usage/scripts/model_usage.py +320 -0
  48. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/model-usage/scripts/test_model_usage.py +40 -0
  49. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/nano-pdf/SKILL.md +38 -0
  50. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/node-connect/SKILL.md +142 -0
  51. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/notion/SKILL.md +174 -0
  52. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/obsidian/SKILL.md +81 -0
  53. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/openai-whisper/SKILL.md +38 -0
  54. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/openai-whisper-api/SKILL.md +62 -0
  55. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/openai-whisper-api/scripts/transcribe.sh +85 -0
  56. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/openhue/SKILL.md +112 -0
  57. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/oracle/SKILL.md +125 -0
  58. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/ordercli/SKILL.md +78 -0
  59. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/peekaboo/SKILL.md +190 -0
  60. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/sag/SKILL.md +87 -0
  61. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/session-logs/SKILL.md +139 -0
  62. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/sherpa-onnx-tts/SKILL.md +103 -0
  63. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
  64. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/skill-creator/SKILL.md +372 -0
  65. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/skill-creator/license.txt +202 -0
  66. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/skill-creator/scripts/init_skill.py +378 -0
  67. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/skill-creator/scripts/package_skill.py +139 -0
  68. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/skill-creator/scripts/quick_validate.py +159 -0
  69. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/skill-creator/scripts/test_package_skill.py +160 -0
  70. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/skill-creator/scripts/test_quick_validate.py +72 -0
  71. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/slack/SKILL.md +144 -0
  72. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/songsee/SKILL.md +49 -0
  73. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/sonoscli/SKILL.md +65 -0
  74. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/spotify-player/SKILL.md +64 -0
  75. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/summarize/SKILL.md +87 -0
  76. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/things-mac/SKILL.md +86 -0
  77. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/tinker/SKILL.md +348 -0
  78. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/tinker/references/cli-reference.md +365 -0
  79. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/tinker/references/cookbook-recipes.md +432 -0
  80. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/tinker/references/troubleshooting.md +319 -0
  81. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/tmux/SKILL.md +170 -0
  82. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/tmux/scripts/find-sessions.sh +112 -0
  83. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/tmux/scripts/wait-for-text.sh +83 -0
  84. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/trello/SKILL.md +108 -0
  85. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/video-frames/SKILL.md +46 -0
  86. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/video-frames/scripts/frame.sh +81 -0
  87. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/voice-call/SKILL.md +45 -0
  88. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/wacli/SKILL.md +72 -0
  89. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/weather/SKILL.md +129 -0
  90. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/bundled/xurl/SKILL.md +461 -0
  91. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/workspace/habit-reminder/SKILL.md +162 -0
  92. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/skills/workspace/habit-reminder/references/messages.md +117 -0
  93. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/workspace/AGENTS.md +212 -0
  94. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/workspace/BOOTSTRAP.md +55 -0
  95. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/workspace/HEARTBEAT.md +7 -0
  96. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/workspace/IDENTITY.md +23 -0
  97. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/workspace/SOUL.md +36 -0
  98. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/workspace/TOOLS.md +40 -0
  99. max_context_share-0.1.0/example/2026-03-27_16-24-11-openclaw-context/workspace/USER.md +19 -0
  100. max_context_share-0.1.0/example/sample-context.tar.gz +0 -0
  101. max_context_share-0.1.0/max-context-share-skill/SKILL.md +191 -0
  102. max_context_share-0.1.0/max-context-share-skill/references/cli-reference.md +207 -0
  103. max_context_share-0.1.0/max-context-share-skill/references/troubleshooting.md +159 -0
  104. max_context_share-0.1.0/pyproject.toml +40 -0
  105. max_context_share-0.1.0/src/max_context_share/__init__.py +11 -0
  106. max_context_share-0.1.0/src/max_context_share/cli.py +233 -0
  107. max_context_share-0.1.0/src/max_context_share/config_fragment.py +254 -0
  108. max_context_share-0.1.0/src/max_context_share/export_bundle.py +362 -0
  109. max_context_share-0.1.0/src/max_context_share/import_bundle.py +417 -0
  110. max_context_share-0.1.0/src/max_context_share/manifest.py +129 -0
  111. max_context_share-0.1.0/src/max_context_share/paths.py +220 -0
  112. max_context_share-0.1.0/tests/__init__.py +1 -0
  113. max_context_share-0.1.0/tests/test_cli.py +197 -0
  114. max_context_share-0.1.0/tests/test_config_fragment.py +188 -0
  115. max_context_share-0.1.0/tests/test_export.py +260 -0
  116. max_context_share-0.1.0/tests/test_import.py +352 -0
  117. max_context_share-0.1.0/tests/test_manifest.py +145 -0
  118. max_context_share-0.1.0/tests/test_paths.py +123 -0
@@ -0,0 +1,33 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.egg-info/
6
+ *.egg
7
+ dist/
8
+ build/
9
+ .venv/
10
+ *.whl
11
+
12
+ # uv
13
+ uv.lock
14
+
15
+ # Testing
16
+ .pytest_cache/
17
+ htmlcov/
18
+ .coverage
19
+ coverage.xml
20
+
21
+ # IDE
22
+ .vscode/
23
+ .idea/
24
+ *.swp
25
+ *.swo
26
+
27
+ # OS
28
+ .DS_Store
29
+ Thumbs.db
30
+
31
+ # Archives (keep example/)
32
+ *.tgz
33
+ *.log
@@ -0,0 +1,257 @@
1
+ Metadata-Version: 2.4
2
+ Name: max-context-share
3
+ Version: 0.1.0
4
+ Summary: Export/import OpenClaw skills, workspace context files, and config fragments as portable .tar.gz bundles
5
+ License-Expression: MIT
6
+ Requires-Python: >=3.10
7
+ Requires-Dist: aiofiles>=23.0
8
+ Requires-Dist: click>=8.0
9
+ Requires-Dist: pydantic>=2.0
10
+ Description-Content-Type: text/markdown
11
+
12
+ # max-context-share
13
+
14
+ CLI tool to export and import OpenClaw skills, workspace context files, and config fragments as a portable `.tar.gz` bundle.
15
+
16
+ > **Note:** This is the Python rewrite of the original TypeScript version. Bundles are **fully compatible** between both versions.
17
+
18
+ ## Running the CLI
19
+
20
+ ### Option A: via pip / uv (recommended)
21
+
22
+ ```bash
23
+ # Install with pip
24
+ pip install max-context-share
25
+
26
+ # Or install with uv
27
+ uv pip install max-context-share
28
+
29
+ # Run
30
+ max-ctx export
31
+ max-ctx import ./sample-context.tar.gz
32
+ ```
33
+
34
+ ### Option B: run directly from source
35
+
36
+ Clone or download this repo, then:
37
+
38
+ ```bash
39
+ # 1. Enter the project directory
40
+ cd max-context-share
41
+
42
+ # 2. Create venv and install with uv
43
+ uv venv .venv --python=3.10
44
+ uv sync
45
+
46
+ # 3. Run via uv
47
+ uv run max-ctx export
48
+ uv run max-ctx import ./sample-context.tar.gz
49
+
50
+ # Or activate the venv and run directly
51
+ source .venv/bin/activate
52
+ max-ctx export --dry-run
53
+ ```
54
+
55
+ ---
56
+
57
+ ## Usage
58
+
59
+ ### Export
60
+
61
+ Package your local OpenClaw skills, workspace files, and config fragment into a shareable archive:
62
+
63
+ ```bash
64
+ # Export everything (all skills + workspace files + config)
65
+ max-ctx export
66
+
67
+ # Specify output path
68
+ max-ctx export --output /tmp/my-context.tar.gz
69
+
70
+ # Export specific skills only
71
+ max-ctx export --skills github,weather,habit-reminder
72
+
73
+ # Exclude workspace files or config fragment
74
+ max-ctx export --no-workspace
75
+ max-ctx export --no-config-fragment
76
+
77
+ # Preview what would be exported
78
+ max-ctx export --dry-run
79
+
80
+ # JSON output (useful for scripting)
81
+ max-ctx export --dry-run --json
82
+ ```
83
+
84
+ ### Import
85
+
86
+ Import an archive into your local OpenClaw installation:
87
+
88
+ ```bash
89
+ # Import with merge strategy (default: skip existing)
90
+ max-ctx import /tmp/my-context.tar.gz
91
+
92
+ # Overwrite existing skills and workspace files
93
+ max-ctx import /tmp/my-context.tar.gz --overwrite
94
+
95
+ # Import only skills, skip workspace files
96
+ max-ctx import /tmp/my-context.tar.gz --no-workspace
97
+
98
+ # Preview what would be imported
99
+ max-ctx import /tmp/my-context.tar.gz --dry-run
100
+ ```
101
+
102
+ > **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 ...`.
103
+
104
+ ---
105
+
106
+ ## Bundle Format
107
+
108
+ The generated `.tar.gz` contains:
109
+
110
+ ```
111
+ <timestamp>-openclaw-context/
112
+ manifest.json # Metadata: schema version, skills list, etc.
113
+ skills/
114
+ bundled/ # Skills shipped with openclaw
115
+ <slug>/
116
+ SKILL.md
117
+ ...
118
+ managed/ # Installed via `openclaw skills install`
119
+ <slug>/
120
+ personal-agents/ # ~/.agents/skills/
121
+ <slug>/
122
+ project-agents/ # <workspace>/.agents/skills/
123
+ <slug>/
124
+ workspace/ # <workspace>/skills/
125
+ <slug>/
126
+ workspace/
127
+ AGENTS.md
128
+ SOUL.md
129
+ TOOLS.md
130
+ IDENTITY.md
131
+ USER.md
132
+ HEARTBEAT.md
133
+ BOOTSTRAP.md
134
+ MEMORY.md
135
+ config-fragment.json # Safe config subset (no secrets)
136
+ ```
137
+
138
+ ### Config Fragment
139
+
140
+ The config fragment only includes safe, non-secret fields from `openclaw.json`:
141
+
142
+ - `agents.defaults` — model, thinking preferences
143
+ - `agents.list[].skills` — per-agent skill allowlists
144
+ - `skills.allowBundled` / `skills.limits`
145
+
146
+ Credentials, tokens, OAuth settings, gateway config, and any field containing `secret`, `token`, `key`, `password`, `auth`, or `credential` are **never exported**.
147
+
148
+ ---
149
+
150
+ ## Skill Sources
151
+
152
+ OpenClaw loads skills from multiple locations. `max-ctx export` scans all of them:
153
+
154
+ | Source | Path | Description |
155
+ |--------|------|-------------|
156
+ | `bundled` | `<openclaw-pkg>/skills/` | Shipped with openclaw (auto-detected via `which openclaw`) |
157
+ | `managed` | `~/.openclaw/skills/` | Installed via `openclaw skills install` |
158
+ | `personal-agents` | `~/.agents/skills/` | Personal skills shared across all workspaces |
159
+ | `project-agents` | `<workspace>/.agents/skills/` | Project-local skills (can be committed to git) |
160
+ | `workspace` | `<workspace>/skills/` | Workspace-local skills |
161
+
162
+ Precedence on conflict (same slug): `workspace` > `project-agents` > `personal-agents` > `managed` > `bundled`.
163
+
164
+ ---
165
+
166
+ ## Merge Strategies
167
+
168
+ | Mode | Skills | Workspace files |
169
+ |------|--------|-----------------|
170
+ | `--merge` (default) | Skip existing slugs, print warning | Skip existing files, print notice |
171
+ | `--overwrite` | Replace existing slugs entirely | Overwrite existing files |
172
+
173
+ ---
174
+
175
+ ## Paths
176
+
177
+ Paths are resolved from environment variables (same conventions as OpenClaw core):
178
+
179
+ | Path | Default | Override |
180
+ |------|---------|---------|
181
+ | State directory | `~/.openclaw/` | `OPENCLAW_STATE_DIR` |
182
+ | Workspace | `~/.openclaw/workspace/` | `OPENCLAW_PROFILE` |
183
+ | Managed skills | `~/.openclaw/skills/` | — |
184
+ | Config file | `~/.openclaw/openclaw.json` | — |
185
+ | Bundled skills | auto-detected from `openclaw` binary | `OPENCLAW_BUNDLED_SKILLS_DIR` |
186
+
187
+ Profile support: if `OPENCLAW_PROFILE=prod`, workspace resolves to `~/.openclaw/workspace-prod/`.
188
+
189
+ ---
190
+
191
+ ## Python API (Sync + Async)
192
+
193
+ You can also use `max-context-share` as a library:
194
+
195
+ ```python
196
+ from max_context_share.export_bundle import (
197
+ ExportOptions, run_export, async_run_export,
198
+ )
199
+ from max_context_share.import_bundle import (
200
+ ImportOptions, run_import, async_run_import,
201
+ )
202
+
203
+ # Sync
204
+ result = run_export(ExportOptions(dry_run=True))
205
+ print(result.skills)
206
+
207
+ # Async
208
+ import asyncio
209
+ result = asyncio.run(
210
+ async_run_export(ExportOptions(dry_run=True))
211
+ )
212
+ ```
213
+
214
+ ---
215
+
216
+ ## Example
217
+
218
+ An example bundle is included in the `example/` directory:
219
+
220
+ ```bash
221
+ # Inspect the example bundle
222
+ tar tf example/sample-context.tar.gz
223
+
224
+ # Do a dry-run import to see what would change
225
+ max-ctx import example/sample-context.tar.gz --dry-run
226
+ ```
227
+
228
+ ---
229
+
230
+ ## Development
231
+
232
+ ```bash
233
+ # Setup
234
+ uv venv .venv --python=3.10
235
+ uv sync
236
+
237
+ # Lint
238
+ uv run ruff check src/ tests/
239
+
240
+ # Test (60 tests across 6 modules)
241
+ uv run pytest -v
242
+
243
+ # Run from source
244
+ uv run max-ctx --help
245
+ uv run max-ctx export --dry-run
246
+ ```
247
+
248
+ ---
249
+
250
+ ## Cross-Compatibility
251
+
252
+ Bundles created by the Python version are **fully compatible** with the TypeScript version and vice versa:
253
+
254
+ - `manifest.json` uses identical camelCase keys (`schemaVersion`, `createdAt`, `workspaceFiles`, `hasConfigFragment`)
255
+ - Archive directory layout is identical
256
+ - Same 8 workspace files, same skill source precedence
257
+ - Same config fragment safe-field extraction
@@ -0,0 +1,246 @@
1
+ # max-context-share
2
+
3
+ CLI tool to export and import OpenClaw skills, workspace context files, and config fragments as a portable `.tar.gz` bundle.
4
+
5
+ > **Note:** This is the Python rewrite of the original TypeScript version. Bundles are **fully compatible** between both versions.
6
+
7
+ ## Running the CLI
8
+
9
+ ### Option A: via pip / uv (recommended)
10
+
11
+ ```bash
12
+ # Install with pip
13
+ pip install max-context-share
14
+
15
+ # Or install with uv
16
+ uv pip install max-context-share
17
+
18
+ # Run
19
+ max-ctx export
20
+ max-ctx import ./sample-context.tar.gz
21
+ ```
22
+
23
+ ### Option B: run directly from source
24
+
25
+ Clone or download this repo, then:
26
+
27
+ ```bash
28
+ # 1. Enter the project directory
29
+ cd max-context-share
30
+
31
+ # 2. Create venv and install with uv
32
+ uv venv .venv --python=3.10
33
+ uv sync
34
+
35
+ # 3. Run via uv
36
+ uv run max-ctx export
37
+ uv run max-ctx import ./sample-context.tar.gz
38
+
39
+ # Or activate the venv and run directly
40
+ source .venv/bin/activate
41
+ max-ctx export --dry-run
42
+ ```
43
+
44
+ ---
45
+
46
+ ## Usage
47
+
48
+ ### Export
49
+
50
+ Package your local OpenClaw skills, workspace files, and config fragment into a shareable archive:
51
+
52
+ ```bash
53
+ # Export everything (all skills + workspace files + config)
54
+ max-ctx export
55
+
56
+ # Specify output path
57
+ max-ctx export --output /tmp/my-context.tar.gz
58
+
59
+ # Export specific skills only
60
+ max-ctx export --skills github,weather,habit-reminder
61
+
62
+ # Exclude workspace files or config fragment
63
+ max-ctx export --no-workspace
64
+ max-ctx export --no-config-fragment
65
+
66
+ # Preview what would be exported
67
+ max-ctx export --dry-run
68
+
69
+ # JSON output (useful for scripting)
70
+ max-ctx export --dry-run --json
71
+ ```
72
+
73
+ ### Import
74
+
75
+ Import an archive into your local OpenClaw installation:
76
+
77
+ ```bash
78
+ # Import with merge strategy (default: skip existing)
79
+ max-ctx import /tmp/my-context.tar.gz
80
+
81
+ # Overwrite existing skills and workspace files
82
+ max-ctx import /tmp/my-context.tar.gz --overwrite
83
+
84
+ # Import only skills, skip workspace files
85
+ max-ctx import /tmp/my-context.tar.gz --no-workspace
86
+
87
+ # Preview what would be imported
88
+ max-ctx import /tmp/my-context.tar.gz --dry-run
89
+ ```
90
+
91
+ > **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 ...`.
92
+
93
+ ---
94
+
95
+ ## Bundle Format
96
+
97
+ The generated `.tar.gz` contains:
98
+
99
+ ```
100
+ <timestamp>-openclaw-context/
101
+ manifest.json # Metadata: schema version, skills list, etc.
102
+ skills/
103
+ bundled/ # Skills shipped with openclaw
104
+ <slug>/
105
+ SKILL.md
106
+ ...
107
+ managed/ # Installed via `openclaw skills install`
108
+ <slug>/
109
+ personal-agents/ # ~/.agents/skills/
110
+ <slug>/
111
+ project-agents/ # <workspace>/.agents/skills/
112
+ <slug>/
113
+ workspace/ # <workspace>/skills/
114
+ <slug>/
115
+ workspace/
116
+ AGENTS.md
117
+ SOUL.md
118
+ TOOLS.md
119
+ IDENTITY.md
120
+ USER.md
121
+ HEARTBEAT.md
122
+ BOOTSTRAP.md
123
+ MEMORY.md
124
+ config-fragment.json # Safe config subset (no secrets)
125
+ ```
126
+
127
+ ### Config Fragment
128
+
129
+ The config fragment only includes safe, non-secret fields from `openclaw.json`:
130
+
131
+ - `agents.defaults` — model, thinking preferences
132
+ - `agents.list[].skills` — per-agent skill allowlists
133
+ - `skills.allowBundled` / `skills.limits`
134
+
135
+ Credentials, tokens, OAuth settings, gateway config, and any field containing `secret`, `token`, `key`, `password`, `auth`, or `credential` are **never exported**.
136
+
137
+ ---
138
+
139
+ ## Skill Sources
140
+
141
+ OpenClaw loads skills from multiple locations. `max-ctx export` scans all of them:
142
+
143
+ | Source | Path | Description |
144
+ |--------|------|-------------|
145
+ | `bundled` | `<openclaw-pkg>/skills/` | Shipped with openclaw (auto-detected via `which openclaw`) |
146
+ | `managed` | `~/.openclaw/skills/` | Installed via `openclaw skills install` |
147
+ | `personal-agents` | `~/.agents/skills/` | Personal skills shared across all workspaces |
148
+ | `project-agents` | `<workspace>/.agents/skills/` | Project-local skills (can be committed to git) |
149
+ | `workspace` | `<workspace>/skills/` | Workspace-local skills |
150
+
151
+ Precedence on conflict (same slug): `workspace` > `project-agents` > `personal-agents` > `managed` > `bundled`.
152
+
153
+ ---
154
+
155
+ ## Merge Strategies
156
+
157
+ | Mode | Skills | Workspace files |
158
+ |------|--------|-----------------|
159
+ | `--merge` (default) | Skip existing slugs, print warning | Skip existing files, print notice |
160
+ | `--overwrite` | Replace existing slugs entirely | Overwrite existing files |
161
+
162
+ ---
163
+
164
+ ## Paths
165
+
166
+ Paths are resolved from environment variables (same conventions as OpenClaw core):
167
+
168
+ | Path | Default | Override |
169
+ |------|---------|---------|
170
+ | State directory | `~/.openclaw/` | `OPENCLAW_STATE_DIR` |
171
+ | Workspace | `~/.openclaw/workspace/` | `OPENCLAW_PROFILE` |
172
+ | Managed skills | `~/.openclaw/skills/` | — |
173
+ | Config file | `~/.openclaw/openclaw.json` | — |
174
+ | Bundled skills | auto-detected from `openclaw` binary | `OPENCLAW_BUNDLED_SKILLS_DIR` |
175
+
176
+ Profile support: if `OPENCLAW_PROFILE=prod`, workspace resolves to `~/.openclaw/workspace-prod/`.
177
+
178
+ ---
179
+
180
+ ## Python API (Sync + Async)
181
+
182
+ You can also use `max-context-share` as a library:
183
+
184
+ ```python
185
+ from max_context_share.export_bundle import (
186
+ ExportOptions, run_export, async_run_export,
187
+ )
188
+ from max_context_share.import_bundle import (
189
+ ImportOptions, run_import, async_run_import,
190
+ )
191
+
192
+ # Sync
193
+ result = run_export(ExportOptions(dry_run=True))
194
+ print(result.skills)
195
+
196
+ # Async
197
+ import asyncio
198
+ result = asyncio.run(
199
+ async_run_export(ExportOptions(dry_run=True))
200
+ )
201
+ ```
202
+
203
+ ---
204
+
205
+ ## Example
206
+
207
+ An example bundle is included in the `example/` directory:
208
+
209
+ ```bash
210
+ # Inspect the example bundle
211
+ tar tf example/sample-context.tar.gz
212
+
213
+ # Do a dry-run import to see what would change
214
+ max-ctx import example/sample-context.tar.gz --dry-run
215
+ ```
216
+
217
+ ---
218
+
219
+ ## Development
220
+
221
+ ```bash
222
+ # Setup
223
+ uv venv .venv --python=3.10
224
+ uv sync
225
+
226
+ # Lint
227
+ uv run ruff check src/ tests/
228
+
229
+ # Test (60 tests across 6 modules)
230
+ uv run pytest -v
231
+
232
+ # Run from source
233
+ uv run max-ctx --help
234
+ uv run max-ctx export --dry-run
235
+ ```
236
+
237
+ ---
238
+
239
+ ## Cross-Compatibility
240
+
241
+ Bundles created by the Python version are **fully compatible** with the TypeScript version and vice versa:
242
+
243
+ - `manifest.json` uses identical camelCase keys (`schemaVersion`, `createdAt`, `workspaceFiles`, `hasConfigFragment`)
244
+ - Archive directory layout is identical
245
+ - Same 8 workspace files, same skill source precedence
246
+ - Same config fragment safe-field extraction