Skip to content

fix(cli): support exporting the default root profile (#4366)#4370

Open
devorun wants to merge 1 commit intoNousResearch:mainfrom
devorun:patch-24
Open

fix(cli): support exporting the default root profile (#4366)#4370
devorun wants to merge 1 commit intoNousResearch:mainfrom
devorun:patch-24

Conversation

@devorun
Copy link
Copy Markdown
Contributor

@devorun devorun commented Mar 31, 2026

What does this PR do?

Fixes #4366

The Issue:
Running hermes profile export default crashes with a FileNotFoundError. The shutil.make_archive function was attempting to locate a directory named default inside the parent directory of ~/.hermes (which resolves to ~/default), resulting in an empty archive and an error because the directory is actually named .hermes.

The Fix:
Added special handling for the default profile. The command now creates a temporary directory, structures it as tempdir/default, and uses shutil.copytree to copy the root profile contents into it.
It intentionally ignores the profiles/ directory, gateway.pid, and sockets to prevent recursive copying of other profiles and runtime states. The archive is then generated safely from this temporary structure, allowing seamless exports and imports of the default profile.

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

How to Test

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform:

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

  • This skill is broadly useful to most users (if bundled) — see Contributing Guide
  • SKILL.md follows the standard format (frontmatter, trigger conditions, steps, pitfalls)
  • No external dependencies that aren't already available (prefer stdlib, curl, existing Hermes tools)
  • I've tested the skill end-to-end: hermes --toolsets skills -q "Use the X skill to do Y"

Screenshots / Logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant