Skip to content

Commit 58ec772

Browse files
aemiguelclaude
andcommitted
v0.7.43: /emoji command — set custom icon per endpoint
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9b192bc commit 58ec772

5 files changed

Lines changed: 47 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "snoot",
3-
"version": "0.7.42",
3+
"version": "0.7.43",
44
"description": "Proxy encrypted messengers (Session/Matrix/SimpleX) to AI coding assistants",
55
"type": "module",
66
"bin": {

src/commands.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const RESERVED_COMMANDS = new Set([
1313
"pin", "pins", "unpin", "profile", "save", "overwrite", "rename",
1414
"move", "relocate", "stop", "kill", "compact", "restart", "forget",
1515
"clear", "claude", "gemini", "codex", "model", "effort", "update",
16-
"endpoint", "auto", "report", "btw",
16+
"endpoint", "emoji", "auto", "report", "btw",
1717
]);
1818

1919
export function handleCommand(
@@ -47,6 +47,7 @@ export function handleCommand(
4747
" /endpoint [name] — switch or list endpoints",
4848
" /model <name> — switch model (opus, sonnet, etc.)",
4949
" /effort <level> — low/medium/high/max/default",
50+
" /emoji <emoji> — set icon for current endpoint (/emoji default to reset)",
5051
` /mode <chat|research|coding> — current: ${config.mode}`,
5152
"",
5253
"CONTEXT",
@@ -428,6 +429,7 @@ export function handleCommand(
428429
case "/codex":
429430
case "/model":
430431
case "/effort":
432+
case "/emoji":
431433
case "/update":
432434
return null;
433435

src/proxy.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { findCliPath, loadEndpoints, saveEndpoint, removeEndpoint, endpointDispl
1818
const IS_WINDOWS = process.platform === "win32";
1919

2020
function backendEmoji(backend: string, ep?: EndpointConfig): string {
21+
if (ep?.emoji) return ep.emoji;
2122
const cli = ep?.cli || backend;
2223
if (cli === "claude" || backend === "claude") return "⚡";
2324
if (cli === "gemini" || backend === "gemini") return "💎";
@@ -875,6 +876,46 @@ export function createProxy(config: Config) {
875876
}
876877
}
877878

879+
// /emoji — set custom emoji for current endpoint
880+
const emojiMatch = trimmed.match(/^\/emoji\s*(.*)/i);
881+
if (emojiMatch !== null) {
882+
const emojiArg = emojiMatch[1].trim();
883+
if (!emojiArg) {
884+
const current = backendEmoji(config.backend, config.endpointConfig);
885+
sessionClient.send(`Current emoji for ${config.backend}: ${current}\n\nUsage: /emoji <emoji> or /emoji default`).catch(() => {});
886+
return;
887+
}
888+
const endpoints = loadEndpoints();
889+
const ep = endpoints[config.backend];
890+
if (emojiArg.toLowerCase() === "default") {
891+
if (ep) {
892+
delete ep.emoji;
893+
saveEndpoint(config.backend, ep);
894+
}
895+
if (config.endpointConfig) delete config.endpointConfig.emoji;
896+
const def = backendEmoji(config.backend, config.endpointConfig);
897+
sessionClient.send(`Reset ${config.backend} emoji to default: ${def}`).catch(() => {});
898+
} else {
899+
const newEmoji = emojiArg;
900+
if (ep) {
901+
ep.emoji = newEmoji;
902+
saveEndpoint(config.backend, ep);
903+
} else {
904+
// Auto-detected endpoint (claude/gemini/codex) — create a config entry to persist the emoji
905+
const cli = config.endpointConfig?.cli || config.backend;
906+
saveEndpoint(config.backend, { type: "cli", cli, emoji: newEmoji });
907+
}
908+
if (config.endpointConfig) {
909+
config.endpointConfig.emoji = newEmoji;
910+
} else {
911+
config.endpointConfig = { type: "cli", cli: config.backend, emoji: newEmoji };
912+
}
913+
sessionClient.send(`Set ${config.backend} emoji to ${newEmoji}`).catch(() => {});
914+
}
915+
watchLog(`🎨 Emoji for ${config.backend}: ${backendEmoji(config.backend, config.endpointConfig)}`);
916+
return;
917+
}
918+
878919
// /model — switch model (bypass queue)
879920
const modelMatch = trimmed.match(/^\/model\s*(.*)/i);
880921
if (modelMatch !== null) {

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface EndpointConfig {
99
url?: string; // for openai type: API base URL
1010
model?: string; // for openai type: default model name
1111
apiKey?: string; // for openai type: API key
12+
emoji?: string; // custom emoji icon for this endpoint
1213
}
1314
export type Transport = "session" | "matrix" | "simplex";
1415

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// This file is auto-updated by the bump-version script.
22
// Do NOT read package.json at runtime — it doesn't exist inside compiled binaries.
3-
export const VERSION = "0.7.42";
3+
export const VERSION = "0.7.43";

0 commit comments

Comments
 (0)