Skip to content

Use CLI instead of bash script & package for assistant#8

Open
russellpierce wants to merge 5 commits intomutable-state-inc:mainfrom
russellpierce:cli
Open

Use CLI instead of bash script & package for assistant#8
russellpierce wants to merge 5 commits intomutable-state-inc:mainfrom
russellpierce:cli

Conversation

@russellpierce
Copy link
Contributor

@russellpierce russellpierce commented Jan 30, 2026

This PR contains three improvements.

  • How the skill interacts with ensue now allows for better progressive discovery via use of a CLI rather than a bash script wrapping the API.
  • It includes a repackage_skill.sh script. 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).
  • The SKILL.md now includes instructions about using HEREDOC syntax to wrap complex JSON. This reduces the rate with which a model needs to thrash to deal with escaping issues in non-trivial payloads.

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.

russellpierce and others added 4 commits January 30, 2026 09:21
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>
@russellpierce russellpierce changed the title Use CLI instead of bash script & package for assistant DRAFT: Use CLI instead of bash script & package for assistant Jan 30, 2026
@russellpierce russellpierce marked this pull request as draft January 30, 2026 16:05
@russellpierce
Copy link
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.

@russellpierce russellpierce marked this pull request as ready for review January 31, 2026 19:08
@russellpierce
Copy link
Contributor Author

Issue resolved, ready for review again.

@russellpierce russellpierce changed the title DRAFT: Use CLI instead of bash script & package for assistant Use CLI instead of bash script & package for assistant Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant