HuaShen (化身)
Export and import opencode config, sessions, agents, skills, commands, plugins and MCP servers as portable bundles.
化身 (HuaShen) means "avatar / incarnation" — this tool lets your opencode identity travel between machines. Pack everything into a single .hsb (HuaShen Bundle, a tar.gz archive) and restore it elsewhere. Pick exactly what to carry: just config, just one session, or the whole shebang.
Install
pip install huashen
Or with pipx (recommended):
pipx install huashen
Provides two console commands: huashen and the short alias hs.
Quick start
# Export everything (config + all sessions + agents + skills + commands + auth)
huashen export -o my-avatar.hsb
# Export only config and skills, no secrets
huashen export -o lite.hsb --no-sessions --no-auth
# Export a single session by id (or by fuzzy title match)
huashen export -o one.hsb --session ses_08578bbd5ffeohc37zQcMhYNCP
huashen export -o one.hsb --session "prevent system sleep"
# List what is in a bundle without importing
huashen info my-avatar.hsb
# Import everything from a bundle (use --dry-run first to preview)
huashen import my-avatar.hsb --dry-run
huashen import my-avatar.hsb
huashen import my-avatar.hsb --only config,sessions --merge-sessions
What it can carry
| Component | Default | Flag to skip | Notes |
|---|---|---|---|
| Global config | ✓ | --no-config |
~/.config/opencode/opencode.json(.jsonc) + .gitignore |
| Project cfg | ✓ | --no-project-config |
./opencode.json(.jsonc) and .opencode/opencode.json if present |
| Agents | ✓ | --no-agents |
~/.config/opencode/agent(s)/ + .opencode/agent(s)/ |
| Commands | ✓ | --no-commands |
~/.config/opencode/command(s)/ + .opencode/command(s)/ |
| Skills | ✓ | --no-skills |
~/.config/opencode/skill(s)/ + .opencode/skill(s)/ |
| Plugins | ✓ | --no-plugins |
*.ts/*.js in .opencode/plugin(s)/ |
| MCP / auth | ✗ | n/a (opt-in) | auth.json and provider apiKey fields — off by default |
| Sessions | ✓ | --no-sessions |
SQLite rows for session/message/part/todo + event log |
| Logs | ✗ | n/a (opt-in) | --include-logs to also bundle opencode.log |
| Cache / repos | ✗ | n/a | Never exported (regenerable) |
Secrets (auth.json + inline apiKeys inside provider.*.options.apiKey) are off by default. Pass --with-auth to include them; the bundle is then printed with a red warning. Treat .hsb files containing auth like plaintext passwords.
Bundle layout
A .hsb is a tar.gz with this structure:
manifest.json # what's inside, versions, timestamps, checksums
config/
global/opencode.json
global/opencode.jsonc
global/.gitignore
project/opencode.json # only if a project config was found
agents/...
commands/...
skills/...
plugins/...
auth.json # only when --with-auth
sessions/
opencode.db.dump.sql # filtered SQL dump of session/message/part/todo/event
index.json # per-session metadata + which rows belong to it
logs/
opencode.log # only when --include-logs
Import modes
- Overwrite (default): replaces matching files/rows with the bundle's version.
- Merge sessions:
--merge-sessionskeeps existing sessions and only inserts ones whoseidis missing. Useful when importing a single session into an existing database. - Selective:
--only config,skills,agentsimports just those components from the bundle.
Exit codes
0success1generic error (bad bundle, IO failure)2nothing to do (e.g. export with everything disabled)3dry-run abort (intentional)
License
GPL-3.0-or-later. See LICENSE.
Metadata
Release files for huashen 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| huashen-0.1.0.tar.gz | 14.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| huashen-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.5 kB
Release files / huashen-0.1.0.tar.gz
| Download URL | huashen-0.1.0.tar.gz |
|---|---|
| Size | 14.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f646aa30c9f82830b8b01586b5130fc193cdb34bb0acbebc7bcac60cc3f1ff9
|
|
BLAKE2b-256 checksum How to use checksums |
b9334e95b1485503bb5720c45043322245fb5645602a2445bfe4fa5f719750f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / huashen-0.1.0-py3-none-any.whl
| Download URL | huashen-0.1.0-py3-none-any.whl |
|---|---|
| Size | 17.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
68a44545c2347b848dcf176df85ba7b1fccc42b2308cc1c771cf1ecc60095f9f
|
|
BLAKE2b-256 checksum How to use checksums |
fdd40f68b19ffb8a38f171024f7b4e86edcdc2bec2b29395cc6c3da331a0773c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Security for huashen 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.