@impulselab/directory 1.0.8 → 2.7.4
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 +60 -120
- package/dist/index.js +1595 -0
- package/package.json +28 -20
- package/index.js +0 -666
package/README.md
CHANGED
|
@@ -1,148 +1,88 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @impulselab/directory
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Sync versioned skills, commands and agent configs across Claude Code, Cursor and Codex.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Quick Start
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
npx @impulselab/directory <user-slug>/<command-slug> [--target <target>]
|
|
11
|
-
npx @impulselab/directory stack <stack-id> [--target <target>]
|
|
7
|
+
```sh
|
|
8
|
+
npx @impulselab/directory login
|
|
9
|
+
npx @impulselab/directory sync
|
|
12
10
|
```
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
### Targets
|
|
19
|
-
|
|
20
|
-
| Target | Description | Destination |
|
|
21
|
-
|--------|-------------|-------------|
|
|
22
|
-
| `claude-slash` | Claude slash command | `.claude/commands` (falls back to `~/.claude/commands`)
|
|
23
|
-
| `claude-sub-agent` | Claude sub agent | `.claude/agents` (falls back to `~/.claude/agents`)
|
|
24
|
-
| `cursor-command` | Cursor command | `.cursor/commands` (project only)
|
|
25
|
-
| `cursor-rule` | Cursor rule | `.cursor/rules` (project only)
|
|
26
|
-
|
|
27
|
-
> **Note**: Cursor targets require running the installer inside a Cursor project (a folder containing `.cursor/`). The command fails if no project folder is found.
|
|
28
|
-
|
|
29
|
-
### Examples
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
# Download a Claude slash command from impulse.directory
|
|
33
|
-
npx @impulselab/directory john/my-awesome-command
|
|
34
|
-
|
|
35
|
-
# Install as a Claude sub agent
|
|
36
|
-
npx @impulselab/directory john/my-awesome-command --target claude-sub-agent
|
|
12
|
+
`login` (no flags) starts a browser-based device authorization flow: it prints
|
|
13
|
+
a short code and a verification URL, opens your browser, and waits while you
|
|
14
|
+
approve the request on impulse.directory. Once approved it provisions and
|
|
15
|
+
stores an API key automatically — no copy-paste.
|
|
37
16
|
|
|
38
|
-
|
|
39
|
-
|
|
17
|
+
For headless or CI environments, pass an API key created in your profile
|
|
18
|
+
settings directly:
|
|
40
19
|
|
|
41
|
-
|
|
42
|
-
npx @impulselab/directory
|
|
43
|
-
|
|
44
|
-
# Install an Impulse stack (tool-specific stack ID)
|
|
45
|
-
npx @impulselab/directory stack 01JH0000000ABCDEF --target claude-slash
|
|
46
|
-
|
|
47
|
-
# Use a custom URL (local development)
|
|
48
|
-
IMPULSE_BASE_URL=localhost:3000 npx @impulselab/directory dev-user/dev-command
|
|
49
|
-
|
|
50
|
-
# Use another server
|
|
51
|
-
IMPULSE_BASE_URL=my-custom-domain.com npx @impulselab/directory author/custom-command
|
|
20
|
+
```sh
|
|
21
|
+
npx @impulselab/directory login --key <api-key>
|
|
52
22
|
```
|
|
53
23
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
### Claude targets (`claude-slash`, `claude-sub-agent`)
|
|
57
|
-
|
|
58
|
-
The command searches for the `.claude` folder in the following order:
|
|
59
|
-
|
|
60
|
-
1. **Current folder**: Looks for `.claude/<target>/` in the current working directory
|
|
61
|
-
2. **Parent folders**: Goes up the tree to find a `.claude` folder
|
|
62
|
-
3. **Fallback home**: Uses `~/.claude/<target>/` if no project folder is found
|
|
63
|
-
|
|
64
|
-
This allows:
|
|
65
|
-
- Installing commands at the project level (shared with the team)
|
|
66
|
-
- Installing personal commands (user only)
|
|
67
|
-
|
|
68
|
-
### Cursor targets (`cursor-command`, `cursor-rule`)
|
|
24
|
+
Either way, the key is stored in `~/.impulse/config.json` with file mode `600`.
|
|
69
25
|
|
|
70
|
-
|
|
71
|
-
- Always installs into the project `.cursor` folder
|
|
72
|
-
- Fails with an explicit message if no Cursor project is detected
|
|
26
|
+
## Push Flow
|
|
73
27
|
|
|
74
|
-
|
|
28
|
+
Edit a synced file locally, then publish a new version:
|
|
75
29
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|----------|-------------|--------|
|
|
80
|
-
| `IMPULSE_BASE_URL` | Base URL to download commands | `impulse.directory` |
|
|
81
|
-
|
|
82
|
-
### Automatic HTTPS/HTTP Handling
|
|
83
|
-
|
|
84
|
-
- **HTTPS by default**: All URLs use HTTPS
|
|
85
|
-
- **Fallback HTTP**: If HTTPS fails, the command automatically tries HTTP
|
|
86
|
-
- **Localhost auto-HTTP**: URLs containing `localhost` or `127.0.0.1` use HTTP directly
|
|
87
|
-
|
|
88
|
-
## 📝 Command Format
|
|
89
|
-
|
|
90
|
-
Downloaded prompts are saved as `<command-slug>.md`. Stack installs will save each command in the stack using the prompt slug (with a stack-prefixed fallback when needed).
|
|
91
|
-
|
|
92
|
-
Example download URL:
|
|
93
|
-
```
|
|
94
|
-
https://impulse.directory/raw/user-slug/command-slug
|
|
30
|
+
```sh
|
|
31
|
+
npx @impulselab/directory push ~/.claude/commands/example.md -m "Tighten instructions"
|
|
32
|
+
npx @impulselab/directory sync
|
|
95
33
|
```
|
|
96
34
|
|
|
97
|
-
|
|
35
|
+
If the remote version changed first, `push` keeps your file and asks you to sync before trying again.
|
|
98
36
|
|
|
99
|
-
|
|
100
|
-
https://impulse.directory/api/stacks/<stack-id>/npx
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## 🛠️ Development
|
|
37
|
+
## Commands
|
|
104
38
|
|
|
105
|
-
|
|
39
|
+
| Command | Description |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `impulse login [--key <key>] [--url <baseUrl>]` | Browser device-flow login; `--key` is the headless/CI fallback |
|
|
42
|
+
| `impulse logout` | Remove the saved API key |
|
|
43
|
+
| `impulse whoami` | Show the authenticated user |
|
|
44
|
+
| `impulse sync [--project] [--prune] [--force] [--dry-run] [--json]` | Install or update synced artifacts |
|
|
45
|
+
| `impulse status [--project] [--json]` | Show synced, modified, outdated and missing files |
|
|
46
|
+
| `impulse push <path> [-m <changelog>]` | Publish a local edit as a new artifact version |
|
|
47
|
+
| `impulse add <owner/slug> [--target <target>]` | Public install without lock tracking; interactive picker in a TTY |
|
|
48
|
+
| `impulse add stack <id> [--target <target>]` | One-shot public stack install |
|
|
49
|
+
| `impulse agents` | List enabled agents |
|
|
50
|
+
| `impulse agents enable\|disable <claude\|codex\|cursor>` | Update agent targets |
|
|
106
51
|
|
|
107
|
-
|
|
108
|
-
# From the npx/impulse-claude/ folder
|
|
109
|
-
node index.js --help
|
|
110
|
-
node index.js test-user/test-command
|
|
111
|
-
```
|
|
52
|
+
## Installing an artifact
|
|
112
53
|
|
|
113
|
-
|
|
54
|
+
The web UI shows a single command per artifact:
|
|
114
55
|
|
|
115
|
-
```
|
|
116
|
-
npx/
|
|
117
|
-
├── package.json # NPM configuration
|
|
118
|
-
├── index.js # Main script
|
|
119
|
-
└── README.md # Documentation
|
|
56
|
+
```sh
|
|
57
|
+
npx @impulselab/directory <owner>/<slug>
|
|
120
58
|
```
|
|
121
59
|
|
|
122
|
-
|
|
60
|
+
Run it in a terminal and `impulse` asks where to install — a multi-select of the
|
|
61
|
+
destinations that make sense for that artifact's kind (Claude Code global/project,
|
|
62
|
+
Cursor project, Codex global, …). Pick one or more; the file is written to each.
|
|
123
63
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
- **Cursor commands**: trigger Cursor's command palette and run the command by name.
|
|
127
|
-
- **Cursor rules**: Cursor loads rules automatically from `.cursor/rules` for the project.
|
|
64
|
+
For scripting and CI, pass `--target` to skip the prompt and install to a fixed
|
|
65
|
+
destination (backwards compatible one-shot behaviour):
|
|
128
66
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
67
|
+
```sh
|
|
68
|
+
npx @impulselab/directory <owner>/<slug> --target claude-slash
|
|
69
|
+
```
|
|
132
70
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
71
|
+
The picker is skipped automatically when stdin/stdout is not a TTY, when `--target`
|
|
72
|
+
is set, or when `CI` is set. Legacy
|
|
73
|
+
`npx @impulselab/directory user/slug --target claude-slash` still works and is
|
|
74
|
+
treated as `impulse add user/slug`.
|
|
137
75
|
|
|
138
|
-
|
|
76
|
+
> Note: `impulse add stack <id>` installs are non-interactive and use each
|
|
77
|
+
> artifact's per-target default for now.
|
|
139
78
|
|
|
140
|
-
|
|
141
|
-
```bash
|
|
142
|
-
# The command automatically displays the download path and destination folder
|
|
143
|
-
npx @impulselab/directory debug-user/debug-command
|
|
144
|
-
```
|
|
79
|
+
## Target Mapping
|
|
145
80
|
|
|
146
|
-
|
|
81
|
+
| Kind | Claude global | Claude project | Codex global | Cursor project |
|
|
82
|
+
| --- | --- | --- | --- | --- |
|
|
83
|
+
| `skill` | `~/.claude/skills/<slug>/SKILL.md` | `.claude/skills/<slug>/SKILL.md` | - | - |
|
|
84
|
+
| `command` | `~/.claude/commands/<slug>.md` | `.claude/commands/<slug>.md` | `~/.codex/prompts/<slug>.md` | `.cursor/commands/<slug>.md` |
|
|
85
|
+
| `agent` | `~/.claude/agents/<slug>.md` | `.claude/agents/<slug>.md` | - | - |
|
|
86
|
+
| `rule` | - | - | - | `.cursor/rules/<slug>.mdc` |
|
|
147
87
|
|
|
148
|
-
|
|
88
|
+
Global sync covers Claude Code and Claude Cowork because both read `~/.claude`. Codex slash commands sync to `~/.codex/prompts`. Cursor artifacts are project-scoped, so run `impulse sync --project` from inside the project.
|