Codecache cli
Use when an agent needs to store, retrieve, search, update, or attach local code snippets through the `cache` CLI from the `codecache-cli` package. Triggers include requests to save reusable code, search a local snippet vault, keep agent memory in a local SQLite database, attach notes or files to snippets, bootstrap a vault, or automate snippet workflows with `cache add`, `cache search`, `cache get`, `cache snippet`, `cache attachment`, `cache status`, or `cache vault`.From its SKILL.md
npx -y skills add tanRdev/codecache-cli --skill codecache-cliAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.7 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it
codecache-cli
Use cache as a local-first snippet database for coding agents. Prefer it when the user wants reusable local memory without a hosted service.
Quick Start
- Confirm the CLI exists with
cache helporcommand -v cache. - Resolve the vault path.
- If the vault is missing, initialize it with
cache init --vault PATH --set-default. - Prefer explicit
--vault PATHin automation, even if a default vault exists. - Use JSON output for machine reads and
--rawwhen only snippet code is needed.
Vault Workflow
Create or select a vault
cache init --vault ~/codecache --set-default
cache status --vault ~/codecache
cache vault show
cache vault use ~/codecache
Rules:
- Read commands require an initialized vault.
- Do not assume a missing path will be created by read commands.
- In multi-project automation, pass
--vault PATHexplicitly.
Core Commands
Add snippets
From a file:
cache add src/example.ts --vault ~/codecache --title "Example helper" --tag util --tag typescript
From stdin:
pbpaste | cache add - --vault ~/codecache --title "Clipboard snippet" --language typescript
Search snippets
cache search createReducer --vault ~/codecache --format json
cache snippet list react --vault ~/codecache --limit 5 --format json
Search matches:
- title
- description
- notes
- code
- tags
Retrieve snippets
Structured read:
cache get <snippet-id> --vault ~/codecache --format json
Raw code only:
cache get <snippet-id> --vault ~/codecache --raw
Update snippets
cache snippet update <snippet-id> src/example.ts --vault ~/codecache --title "Updated helper" --tag refined
Delete snippets
cache rm <snippet-id> --vault ~/codecache --yes
Deletion is intentionally guarded. Always pass --yes for destructive commands.
Attachments
Add an attachment:
cache attachment add <snippet-id> ./notes.md --vault ~/codecache
List attachments:
cache attachment list <snippet-id> --vault ~/codecache --format json
Export an attachment:
cache attachment get <attachment-id> --vault ~/codecache --output ./exported-notes.md
Delete an attachment:
cache attachment delete <attachment-id> --vault ~/codecache --yes
Output Rules
- Default TTY output is
human. - Default non-TTY output is
json. - Use
--format jsonfor machine-readable list and object reads. - Use
--format jsonlfor streaming list-like processing. - Use
--rawwhen only snippet code should be returned.
Recommended Agent Patterns
Save reusable code during implementation
When you produce a piece of code likely to be reused later, store it immediately:
cache add path/to/file.ts --vault PATH --title "Short clear title" --tag project-name --tag domain
Search before reinventing
Before implementing a helper, search the local vault:
cache search "query terms" --vault PATH --format json
Pull exact code into context
When a snippet looks relevant, fetch only the code:
cache get <snippet-id> --vault PATH --raw
Keep notes alongside snippets
Use description, notes, tags, or attachments to store context that will help later retrieval.
Safety Rules
- Do not omit
--yeson destructive commands. - Do not assume a vault exists; verify with
cache status --vault PATH. - Treat
io_erroras an environment or filesystem problem, not a CLI logic bug. - Treat
validation_erroras incorrect input or missing arguments. - Prefer explicit paths when operating in temporary workspaces, CI, or agent sandboxes.
Troubleshooting
Vault is not initialized
Run:
cache init --vault PATH --set-default
Missing source file or output path failure
Check the filesystem path first. The CLI reports these as io_error.
Empty search results
Try:
- fewer terms
- symbol names from the code
- known tags
cache snippet list --limit 20 --format json
Response Shape
When using this skill, prefer to report:
- the exact
cachecommand you ran - the vault path used
- the snippet id or attachment id created or retrieved
- any
validation_error,not_found, orio_errorexactly as returned
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.