caplets 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -17
- package/dist/index.js +6523 -6032
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -334,7 +334,8 @@ This repository includes polished working examples under [`caplets/`](caplets/):
|
|
|
334
334
|
- `repo-cli`: Read-oriented repository CLI workflows through `git` and package scripts.
|
|
335
335
|
- `github-cli`: Read-oriented GitHub workflows through the `gh` CLI.
|
|
336
336
|
|
|
337
|
-
Install every example from a repo's `caplets/` directory
|
|
337
|
+
Install every example from a repo's `caplets/` directory into the current project's
|
|
338
|
+
`./.caplets` directory:
|
|
338
339
|
|
|
339
340
|
```sh
|
|
340
341
|
caplets install spiritledsoftware/caplets
|
|
@@ -348,22 +349,20 @@ caplets install spiritledsoftware/caplets github linear
|
|
|
348
349
|
```
|
|
349
350
|
|
|
350
351
|
`caplets install` accepts a GitHub `owner/repo` shorthand, a Git URL, or a local repository path.
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
352
|
+
By default it writes to `./.caplets`, creating that directory when needed. Pass `-g` or
|
|
353
|
+
`--global` to write to your user Caplets root instead, which is
|
|
354
|
+
`${XDG_CONFIG_HOME:-~/.config}/caplets` on Unix-like platforms, `%APPDATA%\caplets` on Windows,
|
|
355
|
+
or the parent directory of `CAPLETS_CONFIG` when that environment variable is set. Existing
|
|
356
|
+
Caplets are not overwritten unless `--force` is passed.
|
|
354
357
|
|
|
355
358
|
On Unix-like platforms, relative `XDG_CONFIG_HOME` and `XDG_STATE_HOME` values are ignored.
|
|
356
359
|
|
|
357
|
-
Caplets
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
Later sources override earlier ones in this order: user `config.json`, user Caplet files,
|
|
366
|
-
project `config.json`, and, only when trusted, project Caplet files.
|
|
360
|
+
Caplets loads user Caplet files from the user Caplets root and project Caplet files from the
|
|
361
|
+
current working directory's `./.caplets` directory. Later sources override earlier ones in this
|
|
362
|
+
order: user `config.json`, user Caplet files, project `config.json`, and project Caplet files.
|
|
363
|
+
That means a project-local Caplet can intentionally replace a user-level Caplet with the same ID.
|
|
364
|
+
Use `caplets list` to see each Caplet's winning source; when a project Caplet shadows a user-level
|
|
365
|
+
Caplet, the list output includes a warning naming the shadowed path.
|
|
367
366
|
|
|
368
367
|
`caplets init` refuses to overwrite an existing config. To intentionally replace the file:
|
|
369
368
|
|
|
@@ -597,12 +596,33 @@ supported inside `args`, `env`, and `cwd` strings. Caplets performs basic requir
|
|
|
597
596
|
primitive-type validation before spawning. Results are returned as structured content with
|
|
598
597
|
`exitCode`, `stdout`, `stderr`, and `elapsedMs`; non-zero exits set `isError`.
|
|
599
598
|
|
|
600
|
-
Generate a
|
|
599
|
+
Generate and add a CLI Caplet manifest from a repository:
|
|
600
|
+
|
|
601
|
+
```sh
|
|
602
|
+
caplets add cli repo-tools --repo . --include git,gh,package
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
`caplets add` writes generated Markdown Caplet files to `./.caplets/<id>.md` by default.
|
|
606
|
+
Pass `-g` or `--global` to write to the user Caplets root, `--print` to review the generated
|
|
607
|
+
manifest without writing, `--output <path>` for an explicit destination, or `--force` to overwrite
|
|
608
|
+
an existing destination file.
|
|
609
|
+
|
|
610
|
+
Add MCP, OpenAPI, GraphQL, and HTTP API Caplets with the same destination options:
|
|
601
611
|
|
|
602
612
|
```sh
|
|
603
|
-
caplets
|
|
613
|
+
caplets add mcp local-tools --command node --arg ./server.mjs
|
|
614
|
+
caplets add mcp remote-tools --url https://mcp.example.com/mcp --transport http --token-env MCP_TOKEN
|
|
615
|
+
caplets add openapi users --spec ./openapi.json --base-url https://api.example.com --token-env USERS_API_TOKEN
|
|
616
|
+
caplets add graphql catalog --endpoint-url https://api.example.com/graphql --schema ./schema.graphql
|
|
617
|
+
caplets add graphql catalog-live --endpoint-url https://api.example.com/graphql --introspection
|
|
618
|
+
caplets add http status-api --base-url https://api.example.com --action get_status:GET:/status/{service}
|
|
604
619
|
```
|
|
605
620
|
|
|
621
|
+
For `caplets add mcp`, use `--command` with repeated `--arg`, optional `--cwd`, and repeated
|
|
622
|
+
`--env KEY=VALUE` for stdio servers, or `--url` with `--transport http|sse` for remote servers.
|
|
623
|
+
For HTTP authentication, pass `--token-env <ENV>` so generated manifests reference `$env:ENV`
|
|
624
|
+
instead of embedding raw bearer tokens.
|
|
625
|
+
|
|
606
626
|
### Authentication
|
|
607
627
|
|
|
608
628
|
Remote servers can use:
|
|
@@ -646,6 +666,13 @@ caplets list --all
|
|
|
646
666
|
caplets list --json
|
|
647
667
|
```
|
|
648
668
|
|
|
669
|
+
Human output includes a `source` column. JSON output includes each Caplet's `source`, `path`, and
|
|
670
|
+
`shadows` metadata. If a project source overrides a user source, human output prints a warning such
|
|
671
|
+
as `Warning: project Caplet GitHub shadows global Caplet at /path/to/github.md`.
|
|
672
|
+
|
|
673
|
+
For safety, `caplets add` and `caplets install` reject symlinked output paths and symlinked parent
|
|
674
|
+
directories instead of following them.
|
|
675
|
+
|
|
649
676
|
### Optional Server Settings
|
|
650
677
|
|
|
651
678
|
Every server can set:
|
|
@@ -674,7 +701,7 @@ If your client starts the configured command directly, `caplets` without argumen
|
|
|
674
701
|
starts the MCP server. `serve` is explicit and recommended for clarity.
|
|
675
702
|
|
|
676
703
|
`caplets serve` watches the effective user config, project config, user Caplet files, and
|
|
677
|
-
|
|
704
|
+
project Caplet files. Adding, editing, disabling, or removing a Caplet updates the
|
|
678
705
|
top-level MCP tool list without restarting Caplets. When an MCP-backed Caplet changes or is
|
|
679
706
|
removed, Caplets closes only that affected downstream connection; unrelated Caplets and
|
|
680
707
|
their downstream connections keep running.
|