Use CLI instead of bash script & package for assistant#8
Open
russellpierce wants to merge 5 commits intomutable-state-inc:mainfrom
Open
Use CLI instead of bash script & package for assistant#8russellpierce wants to merge 5 commits intomutable-state-inc:mainfrom
russellpierce wants to merge 5 commits intomutable-state-inc:mainfrom
Conversation
Remove the copied ensue-api.sh from skills/ensue-memory/scripts/ after zipping, keeping the working directory clean while still including the script in the distributed archive. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Author
|
A couple minor issues to nail down before merging. E.g. The path for the assistant mode still isn't quite right. There are some lingering JSON-first examples of using the CLI. |
Contributor
Author
|
Issue resolved, ready for review again. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains three improvements.
repackage_skill.shscript. This repackages the skill to work with Claude's assistant - the structure of a skill within a claude plugin ends up enough different that directly packing the skill for use with the assistant does not seem to work. For example, in assistant skills there is no CLAUDE_PLUGIN_ROOT env var, no env var management at all actually (hard to hold a secret there so we encourage the use of a key file instead), the script directory is held relative to the plugin root rather than the skill root (i.e. where SKILL.md is).Why use a CLI?
I believe that one of the main strengths of a unified memory system is the capacity for progressive disclosure. In this spirit, I propose that we ought not front load skill instructions more than absolutely required. Using the API via bash script required that we front load instructions on how to use the API (or leave the agent potentially unaware of some ensue features). LLMs have many examples of using *nix shell script idiomatic CLIs in their training data. It appears that generally they are better at calling CLIs than tools or making direct API calls.
Proposed Solution
This PR contains an entirely self-contained copy of the ensure-cli. This leverages the meta-discovery of the MCP server and conventions familiar to LLMs that allow for discovery of features and usage information on an as-needed basis. The bash API script has been kept in the repo for backwards compatibility and to allow more direct RPC calls if needed.
One challenge for using the ensue-cli in a skill was the need to install python packages that might otherwise conflict with the environment (or manually manage a venv). I've wrapped the ensue-cli so that on execution it automatically will install and leverage pipx for dependency management.