@promptcellar/pc 0.5.1 → 0.5.3
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 +4 -4
- package/bin/pc.js +7 -3
- package/hooks/codex-capture.js +1 -1
- package/hooks/gemini-capture.js +1 -1
- package/hooks/prompt-capture.js +1 -1
- package/package.json +2 -2
- package/src/commands/login.js +1 -1
- package/src/commands/setup.js +7 -7
- package/src/commands/status.js +1 -1
- package/src/index.js +1 -1
- package/src/lib/websocket.js +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Prompt Cellar CLI
|
|
2
2
|
|
|
3
|
-
Command-line tool for capturing, managing, and reusing AI prompts with [
|
|
3
|
+
Command-line tool for capturing, managing, and reusing AI prompts with [Prompt Cellar](https://prompts.weldedanvil.com).
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -105,9 +105,9 @@ Configuration is stored in:
|
|
|
105
105
|
|
|
106
106
|
## API
|
|
107
107
|
|
|
108
|
-
The CLI communicates with your
|
|
108
|
+
The CLI communicates with your Prompt Cellar instance. Get your API key from:
|
|
109
109
|
|
|
110
|
-
Settings > API Keys in your
|
|
110
|
+
Settings > API Keys in your Prompt Cellar dashboard.
|
|
111
111
|
|
|
112
112
|
## License
|
|
113
113
|
|
package/bin/pc.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { program } from 'commander';
|
|
4
|
+
import { createRequire } from 'module';
|
|
4
5
|
import { login } from '../src/commands/login.js';
|
|
5
6
|
import { logout } from '../src/commands/logout.js';
|
|
6
7
|
import { status } from '../src/commands/status.js';
|
|
@@ -10,14 +11,17 @@ import { push } from '../src/commands/push.js';
|
|
|
10
11
|
import { config } from '../src/commands/config.js';
|
|
11
12
|
import { update } from '../src/commands/update.js';
|
|
12
13
|
|
|
14
|
+
const require = createRequire(import.meta.url);
|
|
15
|
+
const pkg = require('../package.json');
|
|
16
|
+
|
|
13
17
|
program
|
|
14
18
|
.name('pc')
|
|
15
|
-
.description('
|
|
16
|
-
.version(
|
|
19
|
+
.description('Prompt Cellar CLI - sync prompts between your terminal and the cloud')
|
|
20
|
+
.version(pkg.version);
|
|
17
21
|
|
|
18
22
|
program
|
|
19
23
|
.command('login')
|
|
20
|
-
.description('Authenticate with
|
|
24
|
+
.description('Authenticate with Prompt Cellar via browser')
|
|
21
25
|
.option('-u, --url <url>', 'API URL (for self-hosted instances)')
|
|
22
26
|
.option('-a, --account-url <url>', 'Account URL (for self-hosted instances)')
|
|
23
27
|
.option('-c, --client-id <id>', 'OIDC client ID (default: prompts-prod)')
|
package/hooks/codex-capture.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Codex CLI notify hook for capturing prompts to
|
|
4
|
+
* Codex CLI notify hook for capturing prompts to Prompt Cellar.
|
|
5
5
|
*
|
|
6
6
|
* Codex calls this script with a JSON argument containing:
|
|
7
7
|
* - type: event type (e.g., 'agent-turn-complete')
|
package/hooks/gemini-capture.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Gemini CLI BeforeAgent hook for capturing prompts to
|
|
4
|
+
* Gemini CLI BeforeAgent hook for capturing prompts to Prompt Cellar.
|
|
5
5
|
*
|
|
6
6
|
* Gemini hooks receive JSON via stdin with:
|
|
7
7
|
* - hook_event_name: the hook event (e.g., 'BeforeAgent')
|
package/hooks/prompt-capture.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Claude Code UserPromptSubmit hook for capturing prompts to
|
|
4
|
+
* Claude Code UserPromptSubmit hook for capturing prompts to Prompt Cellar.
|
|
5
5
|
*
|
|
6
6
|
* This script is called by Claude Code on every user prompt submission.
|
|
7
7
|
* UserPromptSubmit hooks receive JSON via stdin with:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptcellar/pc",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "CLI for
|
|
3
|
+
"version": "0.5.3",
|
|
4
|
+
"description": "CLI for Prompt Cellar - sync prompts between your terminal and the cloud",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"bin": {
|
package/src/commands/login.js
CHANGED
package/src/commands/setup.js
CHANGED
|
@@ -133,7 +133,7 @@ function saveGeminiSettings(settings) {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
export async function setup() {
|
|
136
|
-
console.log(chalk.bold('\
|
|
136
|
+
console.log(chalk.bold('\nPrompt Cellar CLI Setup\n'));
|
|
137
137
|
|
|
138
138
|
const installedTools = detectInstalledTools();
|
|
139
139
|
|
|
@@ -178,7 +178,7 @@ export async function setup() {
|
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
console.log(chalk.green('\nSetup complete!'));
|
|
181
|
-
console.log('Your prompts will be automatically captured to
|
|
181
|
+
console.log('Your prompts will be automatically captured to Prompt Cellar.\n');
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
async function setupClaudeCode() {
|
|
@@ -261,7 +261,7 @@ async function setupCodex() {
|
|
|
261
261
|
|
|
262
262
|
// Remove existing notify line and comment
|
|
263
263
|
config = config.split('\n')
|
|
264
|
-
.filter(line => !line.includes('pc-codex-capture') && !line.includes('#
|
|
264
|
+
.filter(line => !line.includes('pc-codex-capture') && !line.includes('# Prompt Cellar capture hook'))
|
|
265
265
|
.join('\n');
|
|
266
266
|
}
|
|
267
267
|
|
|
@@ -278,10 +278,10 @@ async function setupCodex() {
|
|
|
278
278
|
const insertPos = firstTableMatch.index;
|
|
279
279
|
const before = config.slice(0, insertPos).trimEnd();
|
|
280
280
|
const after = config.slice(insertPos);
|
|
281
|
-
config = before + '\n\n#
|
|
281
|
+
config = before + '\n\n# Prompt Cellar capture hook\n' + notifyLine + '\n\n' + after;
|
|
282
282
|
} else {
|
|
283
283
|
// No table sections — safe to append
|
|
284
|
-
config = config.trimEnd() + '\n\n#
|
|
284
|
+
config = config.trimEnd() + '\n\n# Prompt Cellar capture hook\n' + notifyLine + '\n';
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
|
|
@@ -339,7 +339,7 @@ async function setupGemini() {
|
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
export async function unsetup() {
|
|
342
|
-
console.log(chalk.bold('\nRemoving
|
|
342
|
+
console.log(chalk.bold('\nRemoving Prompt Cellar hooks...\n'));
|
|
343
343
|
|
|
344
344
|
let removed = false;
|
|
345
345
|
|
|
@@ -366,7 +366,7 @@ export async function unsetup() {
|
|
|
366
366
|
let codexConfig = getCodexConfig();
|
|
367
367
|
if (isCodexHookInstalled(codexConfig)) {
|
|
368
368
|
codexConfig = codexConfig.split('\n')
|
|
369
|
-
.filter(line => !line.includes('pc-codex-capture') && !line.includes('#
|
|
369
|
+
.filter(line => !line.includes('pc-codex-capture') && !line.includes('# Prompt Cellar capture hook'))
|
|
370
370
|
.join('\n');
|
|
371
371
|
// Clean up extra blank lines left behind
|
|
372
372
|
codexConfig = codexConfig.replace(/\n{3,}/g, '\n\n');
|
package/src/commands/status.js
CHANGED
|
@@ -5,7 +5,7 @@ import { getGitContext } from '../lib/context.js';
|
|
|
5
5
|
import { loadVaultKey } from '../lib/keychain.js';
|
|
6
6
|
|
|
7
7
|
export async function status() {
|
|
8
|
-
console.log(chalk.bold('\
|
|
8
|
+
console.log(chalk.bold('\nPrompt Cellar CLI Status\n'));
|
|
9
9
|
|
|
10
10
|
// Auth status
|
|
11
11
|
if (isLoggedIn()) {
|
package/src/index.js
CHANGED
package/src/lib/websocket.js
CHANGED
|
@@ -37,7 +37,7 @@ export function connect(tool, onPromptReceived) {
|
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
socket.on('registered', (data) => {
|
|
40
|
-
console.log(`Connected to
|
|
40
|
+
console.log(`Connected to Prompt Cellar (session: ${data.session_id})`);
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
socket.on('prompt_pushed', (data) => {
|