@mhmdreza-rafiei/agentry 0.1.0 → 0.2.1

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 CHANGED
@@ -1,95 +1,198 @@
1
- # agentry
1
+ <div align="center">
2
2
 
3
- A raw installer for AI/agent tooling. `agentry` fetches **agents, skills, rules, and scripts** from any Git repo (or local path) and installs the ones you pick into your project — or globally — under `.cursor/`. The CLI ships no assets of its own; you point it at a source.
3
+ # Agentry
4
4
 
5
- ## Install / run
5
+ **Install agents, skills, rules, scripts, and profiles onto coding agents — from any Git repo.**
6
6
 
7
- ```bash
8
- # Run without installing (recommended)
9
- npx agentry@latest --help
7
+ Supports **Cursor**, **Claude Code**, **Codex**, **OpenCode**, and [70+ more](#supported-agents).
8
+
9
+ [![npm](https://img.shields.io/npm/v/@mhmdreza-rafiei/agentry?style=flat&color=38bdf8)](https://www.npmjs.com/package/@mhmdreza-rafiei/agentry)
10
+ [![node](https://img.shields.io/badge/node-%3E%3D22.20-38bdf8?style=flat)](#install)
11
+ [![license](https://img.shields.io/badge/license-MIT-38bdf8?style=flat)](LICENSE)
12
+ [![stars](https://img.shields.io/github/stars/mhmdreza-rafiei/agentry?style=social)](https://github.com/mhmdreza-rafiei/agentry)
13
+
14
+ </div>
10
15
 
11
- # Or install the CLI globally
12
- npm install -g agentry@latest
16
+ ## Install
13
17
 
14
- # Update / uninstall the CLI
15
- agentry update
16
- agentry --uninstall
18
+ ```bash
19
+ npm install -g @mhmdreza-rafiei/agentry
20
+ # or
21
+ npx @mhmdreza-rafiei/agentry@latest --help
17
22
  ```
18
23
 
19
- > Publishing to npm is pending. Until then, run from a clone: `node bin/agentry.js …` or `npx . …`.
24
+ ## Quick start
20
25
 
21
- ## Usage
26
+ ```bash
27
+ # Browse + install skills from a repo
28
+ agentry add skills mhmdreza-rafiei/agent-tools
22
29
 
30
+ # Install one skill to Cursor
31
+ agentry add skills mhmdreza-rafiei/agent-tools enhance-prompt -a cursor
32
+
33
+ # See what is installed
34
+ agentry list
35
+ agentry list skills
23
36
  ```
24
- agentry add <type> <source> [category/name | category] [options]
25
- agentry add profile <name> [source] [options]
26
- agentry remove <type> [category/name | category] [options]
27
- agentry list <source> [type]
28
- agentry update
29
- ```
30
37
 
31
- `<source>` is a GitHub shorthand `author/repo`, a full git URL, or a local path.
38
+ ## Commands
39
+
40
+ | Command | Description |
41
+ | --- | --- |
42
+ | `agentry add <kind> <source> [selector]` | Discover and install artifacts |
43
+ | `agentry add profile <name> [source]` | Apply a local `profile/<name>.yaml` bundle |
44
+ | `agentry list` | List installed artifacts |
45
+ | `agentry list <kind>` | List installed artifacts of one kind |
46
+ | `agentry list <source> [kind] [selector]` | List what a repo/path contains |
47
+ | `agentry remove <kind> [source] [selector]` | Remove installs (files + lock) |
48
+ | `agentry update [kind] [source] [selector]` | Re-install from source or lockfile |
49
+ | `agentry init <kind> [name] [category]` | Scaffold a new artifact |
50
+ | `agentry update` | Update the Agentry CLI itself |
51
+ | `agentry uninstall` | Uninstall the Agentry CLI |
52
+
53
+ `<kind>` is `skill | rule | agent | profile | script` (plurals accepted).
54
+
55
+ ### Source formats
32
56
 
33
57
  ```bash
34
- agentry add skills Prat011/awesome-llm-skills # list all skills and pick
35
- agentry add skills Prat011/awesome-llm-skills video-downloader # one skill (no category)
36
- agentry add skills Prat011/awesome-llm-skills document-skills/docx # one skill (category/name)
37
- agentry add agents author/repo frontend # a whole category
38
- agentry add profile frontend author/repo # apply profile/frontend.json
39
- agentry remove skills document-skills/docx # remove an installed asset
40
- agentry list Prat011/awesome-llm-skills
58
+ # GitHub shorthand
59
+ agentry add skills mhmdreza-rafiei/agent-tools
60
+
61
+ # Full GitHub URL
62
+ agentry add skills https://github.com/mhmdreza-rafiei/agent-tools
63
+
64
+ # Tree URL (subdir + ref)
65
+ agentry add skills https://github.com/mhmdreza-rafiei/agent-tools/tree/main/skills
66
+
67
+ # Local path
68
+ agentry add skills ./my-skills
69
+
70
+ # Any git URL
71
+ agentry add skills git@github.com:mhmdreza-rafiei/agent-tools.git
41
72
  ```
42
73
 
43
- Flags: `-g, --global` (into `~/.cursor`), `--project` (current folder, default), `--dir <path>`, `-y, --yes` (no prompts; install everything matched), `-v, --version`, `-h, --help`, `--uninstall`.
74
+ ### Options
75
+
76
+ | Option | Description |
77
+ | --- | --- |
78
+ | `-g, --global` | Install into `~` (all projects) |
79
+ | `--project` | Install into the current folder (default) |
80
+ | `--dir <path>` | Install into a specific folder |
81
+ | `-a, --agent <name>` | Target provider(s); repeatable; `*` = all |
82
+ | `-l, --list` | Preview only — write nothing |
83
+ | `--copy` | Copy instead of symlink for non-universal agents |
84
+ | `--all` | Install everything to all agents, no prompts |
85
+ | `-y, --yes` | Skip prompts |
86
+ | `--description <text>` | `init`: frontmatter description |
87
+ | `--alwaysApply` | `init` rule: `alwaysApply: true` |
88
+ | `--reference` / `--no-reference` | `init` skill: include `references/TEMPLATE.md` |
89
+ | `--skills` / `--agents` / `--rules` / `--scripts` `[src]` | `init` profile: include kinds (optional source) |
90
+
91
+ ## Examples
44
92
 
45
- When neither `--global` nor `--project` is given, an interactive terminal asks where to install; non‑interactive runs (agents/CI) default to the current project.
93
+ ```bash
94
+ # List everything in a catalog repo
95
+ agentry list mhmdreza-rafiei/agent-tools
96
+ agentry list mhmdreza-rafiei/agent-tools skills
97
+ agentry list mhmdreza-rafiei/agent-tools skills enhance-prompt
98
+
99
+ # Install
100
+ agentry add skills mhmdreza-rafiei/agent-tools
101
+ agentry add skills mhmdreza-rafiei/agent-tools enhance-prompt -a cursor -a claude-code
102
+ agentry add rules mhmdreza-rafiei/agent-tools ask-dont-guess
103
+ agentry add agents mhmdreza-rafiei/agent-tools frontend-developer
104
+
105
+ # Inventory
106
+ agentry list
107
+ agentry list skills
108
+
109
+ # Update / remove by selector or by install source
110
+ agentry update skills mhmdreza-rafiei/agent-tools
111
+ agentry remove skills enhance-prompt
112
+ agentry remove skills mhmdreza-rafiei/agent-tools
113
+
114
+ # Scaffold
115
+ agentry init skill enhance-prompt prompt --reference
116
+ agentry init rule ask-dont-guess --alwaysApply --description "Ask before guessing"
117
+ agentry init profile frontend --skills mhmdreza-rafiei/agent-tools -a cursor
118
+ ```
46
119
 
47
- ## How sources are discovered
120
+ Example catalog used throughout this README: [`mhmdreza-rafiei/agent-tools`](https://github.com/mhmdreza-rafiei/agent-tools).
48
121
 
49
- For each type, `agentry` finds assets in two ways and merges them:
122
+ ## How it works
50
123
 
51
- 1. Under an explicit folder — `<type>/<name>/` or `<type>/<category>/<name>/`.
52
- 2. At the repo root by marker file (like `npx skills add`) — a folder with `SKILL.md` is a skill, `AGENT.md` an agent, `RULE.md` a rule. A root folder whose children carry markers becomes a category (e.g. `document-skills/docx`).
124
+ 1. Resolve a source (local path or shallow git clone).
125
+ 2. Discover artifacts under `<kind>s/` **and** root markers (`SKILL.md`, `.mdc`).
126
+ 3. Let you pick what to install (searchable list + `All`).
127
+ 4. Install once to `.agents/skills/<id>` for universal providers; symlink (or `--copy`) for others.
128
+ 5. Track installs in `.agentry/lock.json` for remove/update.
53
129
 
54
- Selectors after the source: `category/name` (one asset), `name` (one asset when uncategorized), `category` (whole category), or omit to list-and-pick.
130
+ If a clone fails and a prior cache exists, Agentry asks whether to load from cache (`~/.cache/agentry/repos`).
55
131
 
56
- Assets install to `<root>/.cursor/<type>/[category/]<name>/` and are tracked in `.cursor/agentry.lock.json` for idempotent installs and clean removal. `remove` works purely on installed files, so it needs no source.
132
+ ## Artifact layouts
57
133
 
58
- ## Profiles
134
+ Author installable tools in a source repo like this:
59
135
 
60
- A profile is a plain JSON file at `profile/<name>.json` in your project. It lists selectors per type; `agentry add profile <name> <source>` fetches the source once and installs everything the profile lists.
136
+ ### Skills
61
137
 
62
- ```json
63
- {
64
- "repo": "author/repo",
65
- "agents": ["frontend"],
66
- "skills": ["prompt/enhance-prompt"],
67
- "rules": ["workflow/ask-dont-guess"]
68
- }
138
+ ```text
139
+ skills/
140
+ enhance-prompt/
141
+ SKILL.md
142
+ references/
143
+ TEMPLATE.md
144
+ prompt/
145
+ rewrite/
146
+ SKILL.md
69
147
  ```
70
148
 
71
- `repo` is optional — the command-line `<source>` wins when given. See [`profile/frontend.json`](profile/frontend.json) and [`profile/backend.json`](profile/backend.json).
149
+ ### Agents / rules
72
150
 
73
- ## Publish to npm (maintainers)
151
+ ```text
152
+ agents/
153
+ frontend-developer.mdc
154
+ rules/
155
+ ask-dont-guess.mdc
156
+ ```
74
157
 
75
- ```bash
76
- # ensure package.json "name" is available (or scope it: @you/agentry)
77
- npm login
78
- npm publish --access public
79
- # verify
80
- npx agentry@latest --version
158
+ ### Scripts / profiles
159
+
160
+ ```text
161
+ scripts/
162
+ deploy/
163
+ README.md
164
+ profiles/
165
+ frontend.yaml
81
166
  ```
82
167
 
83
- ## Development / test
168
+ Local install profiles (consumed by `agentry add profile`) live at `profile/<name>.yaml`.
169
+
170
+ ## Supported agents
171
+
172
+ Agentry targets **70+** providers. Universal providers share `.agents/skills/`; others get a symlink or copy.
173
+
174
+ | Agent | Skills path |
175
+ | --- | --- |
176
+ | Cursor | `.agents/skills` |
177
+ | Codex | `.agents/skills` |
178
+ | OpenCode | `.agents/skills` |
179
+ | Gemini CLI | `.agents/skills` |
180
+ | Claude Code | `.claude/skills` |
181
+ | Windsurf | `.windsurf/skills` |
182
+ | … | see `src/registry/agents.ts` |
183
+
184
+ ## Development
84
185
 
85
186
  ```bash
86
- npm test # node --test (discovery, source resolution, install/remove, profiles)
87
- node bin/agentry.js … # run the CLI locally
88
- node bin/agentry.js list ./examples # try it against the bundled sample source
187
+ npm install
188
+ npm run typecheck
189
+ npm test
190
+ npm run build
191
+ node dist/cli.mjs --help
89
192
  ```
90
193
 
91
- `examples/` is a sample source repo (skills/agents/rules/scripts) used by the demo — not part of the CLI. `src/` holds the logic: `registry` (discovery), `source` (fetch), `commands` (install/remove), `profile` (config).
194
+ Requires **Node ≥ 22.20**.
92
195
 
93
196
  ## License
94
197
 
95
- MIT
198
+ [MIT](LICENSE)
@@ -0,0 +1,2 @@
1
+ import { delay } from "./theme2.mjs";
2
+ export { delay };
@@ -0,0 +1,149 @@
1
+ import c from "picocolors";
2
+ function fgSky(s) {
3
+ return `\x1b[38;2;56;189;248m${s}\x1b[0m`;
4
+ }
5
+ function bgSky(s) {
6
+ return `\x1b[48;2;14;165;233m${s}\x1b[0m`;
7
+ }
8
+ const sky = Object.assign((s) => fgSky(s), {
9
+ bold: (s) => c.bold(fgSky(s)),
10
+ bg: (s) => bgSky(s)
11
+ });
12
+ const PALETTE = {
13
+ primary: sky,
14
+ success: c.green,
15
+ error: c.red,
16
+ warn: c.yellow,
17
+ info: sky,
18
+ dim: c.dim,
19
+ bold: c.bold,
20
+ text: c.white
21
+ };
22
+ const theme = PALETTE;
23
+ sky(process.stdout.isTTY ? "✓" : "v"), c.red(process.stdout.isTTY ? "✗" : "x"), c.yellow(process.stdout.isTTY ? "⚠" : "!"), sky(process.stdout.isTTY ? "ℹ" : "i"), process.stdout.isTTY, process.stdout.isTTY, process.stdout.isTTY;
24
+ const RESET = "\x1B[0m";
25
+ const GRAYS = [
26
+ "\x1B[38;5;255m",
27
+ "\x1B[38;5;252m",
28
+ "\x1B[38;5;249m",
29
+ "\x1B[38;5;246m",
30
+ "\x1B[38;5;243m",
31
+ "\x1B[38;5;240m"
32
+ ];
33
+ function gradLine(line) {
34
+ const n = line.length || 1;
35
+ let out = "";
36
+ for (let i = 0; i < line.length; i++) {
37
+ const g = GRAYS[Math.min(GRAYS.length - 1, Math.floor(i / n * GRAYS.length))];
38
+ out += `${g}${line[i]}${RESET}`;
39
+ }
40
+ return out;
41
+ }
42
+ const LOGO_LINES = [
43
+ " █████╗ ██████╗ ███████╗███╗ ██╗████████╗██████╗ ██╗ ██╗",
44
+ "██╔══██╗██╔════╝ ██╔════╝████╗ ██║╚══██╔══╝██╔══██╗╚██╗ ██╔╝",
45
+ "███████║██║ ███╗█████╗ ██╔██╗ ██║ ██║ ██████╔╝ ╚████╔╝ ",
46
+ "██╔══██║██║ ██║██╔══╝ ██║╚██╗██║ ██║ ██╔══██╗ ╚██╔╝ ",
47
+ "██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║ ██║ ██║ ██║ ",
48
+ "╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ "
49
+ ];
50
+ function logo() {
51
+ return LOGO_LINES.map((line) => gradLine(line)).join("\n");
52
+ }
53
+ function tagline() {
54
+ return c.dim(" Install agents, skills, rules & profiles");
55
+ }
56
+ function badge() {
57
+ return bgSky(c.white(c.bold(" Agentry ")));
58
+ }
59
+ function delay(ms) {
60
+ return new Promise((r) => setTimeout(r, ms));
61
+ }
62
+ async function animateLogo() {
63
+ process.stdout.write("\n" + logo() + "\n");
64
+ process.stdout.write(tagline() + "\n\n");
65
+ if (process.stdout.isTTY) await delay(280);
66
+ }
67
+ function h(title) {
68
+ return c.bold(sky(title));
69
+ }
70
+ function cmd(s) {
71
+ return c.cyan(s);
72
+ }
73
+ function flag(s) {
74
+ return sky(s);
75
+ }
76
+ function dim(s) {
77
+ return c.dim(s);
78
+ }
79
+ function bullet(s) {
80
+ return ` ${sky("•")} ${s}`;
81
+ }
82
+ function printHelp() {
83
+ const lines = [
84
+ "",
85
+ `${badge()} ${dim("install agents, skills, rules, scripts & profiles")}`,
86
+ "",
87
+ h("Usage"),
88
+ ` ${cmd("agentry")} ${flag("add")} ${dim("<kind> <source> [selector] [options]")}`,
89
+ ` ${cmd("agentry")} ${flag("add")} ${dim("profile <name> [source] [options]")}`,
90
+ ` ${cmd("agentry")} ${flag("remove")} ${dim("<kind> [source] [selector] [options]")}`,
91
+ ` ${cmd("agentry")} ${flag("list")} ${dim("[source] [kind] [selector]")}`,
92
+ ` ${cmd("agentry")} ${flag("update")} ${dim("[kind] [source] [selector]")}`,
93
+ ` ${cmd("agentry")} ${flag("init")} ${dim("<kind> [name] [category] [options]")}`,
94
+ ` ${cmd("agentry")} ${flag("uninstall")}`,
95
+ "",
96
+ h("Kinds"),
97
+ bullet(`${c.bold("skill")} ${c.bold("rule")} ${c.bold("agent")} ${c.bold("profile")} ${c.bold("script")} ${dim("(or all)")}`),
98
+ dim(" Plurals accepted: skills → skill, agents → agent, …"),
99
+ "",
100
+ h("Sources"),
101
+ bullet(`${cmd("author/repo")} ${dim("GitHub shorthand")}`),
102
+ bullet(`${cmd("https://github.com/…")} ${dim("GitHub URL or /tree/<ref>/<dir>")}`),
103
+ bullet(`${cmd("https://gitlab.com/…")} ${dim("GitLab URL")}`),
104
+ bullet(`${cmd("git@host:owner/repo.git")} ${dim("any git URL")}`),
105
+ bullet(`${cmd("./path")} ${dim("|")} ${cmd("/path")} ${dim("|")} ${cmd("~/path")} ${dim("local directory")}`),
106
+ "",
107
+ h("Examples"),
108
+ bullet(`${cmd("agentry add skills")} mhmdreza-rafiei/agent-tools`),
109
+ bullet(`${cmd("agentry add skills")} mhmdreza-rafiei/agent-tools enhance-prompt ${flag("-a")} cursor`),
110
+ bullet(`${cmd("agentry list")}`),
111
+ bullet(`${cmd("agentry list skills")}`),
112
+ bullet(`${cmd("agentry list")} mhmdreza-rafiei/agent-tools`),
113
+ bullet(`${cmd("agentry list")} mhmdreza-rafiei/agent-tools skills`),
114
+ bullet(`${cmd("agentry list")} mhmdreza-rafiei/agent-tools skills enhance-prompt`),
115
+ bullet(`${cmd("agentry remove skills")} enhance-prompt`),
116
+ bullet(`${cmd("agentry remove skills")} mhmdreza-rafiei/agent-tools`),
117
+ bullet(`${cmd("agentry update skills")} mhmdreza-rafiei/agent-tools`),
118
+ bullet(`${cmd("agentry init skill")} enhance-prompt prompt ${flag("--reference")}`),
119
+ bullet(`${cmd("agentry init profile")} frontend ${flag("--skills")} mhmdreza-rafiei/agent-tools`),
120
+ bullet(`${cmd("agentry init rule")} ask-dont-guess ${flag("--alwaysApply")}`),
121
+ bullet(`${cmd("agentry update")}`),
122
+ "",
123
+ h("Options"),
124
+ ` ${flag("-g, --global")} ${dim("Install into ~ (all projects)")}`,
125
+ ` ${flag("--project")} ${dim("Install into the current folder (default)")}`,
126
+ ` ${flag("--dir")} ${dim("<p>")} ${dim("Install into a specific folder")}`,
127
+ ` ${flag("-a, --agent")} ${dim("<n>")} ${dim("Target provider(s); repeatable; '*' = all")}`,
128
+ ` ${flag("-l, --list")} ${dim("Preview only — write nothing")}`,
129
+ ` ${flag("--copy")} ${dim("Copy files instead of symlinking")}`,
130
+ ` ${flag("--all")} ${dim("Install everything to all agents, no prompts")}`,
131
+ ` ${flag("-y, --yes")} ${dim("Don't prompt")}`,
132
+ ` ${flag("--description")} ${dim("<t>")} ${dim("init: frontmatter description")}`,
133
+ ` ${flag("--alwaysApply")} ${dim("init rule: alwaysApply: true")}`,
134
+ ` ${flag("--reference")} ${dim("init skill: add references/TEMPLATE.md")}`,
135
+ ` ${flag("--no-reference")} ${dim("init skill: skip references/")}`,
136
+ ` ${flag("--skills")} ${dim("[src]")} ${dim("init profile: include skills (optional source)")}`,
137
+ ` ${flag("--agents")} ${dim("[src]")} ${dim("init profile: include agents")}`,
138
+ ` ${flag("--rules")} ${dim("[src]")} ${dim("init profile: include rules")}`,
139
+ ` ${flag("--scripts")} ${dim("[src]")} ${dim("init profile: include scripts")}`,
140
+ ` ${flag("-v, --version")} ${dim("Print version")}`,
141
+ ` ${flag("-h, --help")} ${dim("Show this help")}`,
142
+ "",
143
+ dim("Tip: omit --agent to pick providers interactively (universal locked + searchable list)."),
144
+ dim("Tip: remove/update accept a GitHub repo or local path to filter by install source."),
145
+ ""
146
+ ];
147
+ process.stdout.write(lines.join("\n"));
148
+ }
149
+ export { PALETTE, animateLogo, badge, delay, logo, printHelp, sky, tagline, theme };
package/dist/cli.d.mts ADDED
@@ -0,0 +1 @@
1
+ export {}