Browse Source

feat: KIRINCODE pixel banner + CLI install script

- Replace ASCII logo from OPENCODE to KIRINCODE in CLI/TUI
- Fix 'opencode serve' tip to 'kirincode serve'
- Add install-cli script for tester distribution
- fix serve.ts log message
KirinCode 1 month ago
parent
commit
85034962b4

+ 60 - 0
install-cli

@@ -0,0 +1,60 @@
+#!/bin/bash
+# KirinCode CLI Installer for Testers
+set -e
+
+RED='\033[0;31m'
+GOLD='\033[0;33m'
+BOLD='\033[1m'
+NC='\033[0m'
+
+echo -e "${RED}${BOLD}"
+echo "  █▀▀▄ █▀▀█ █▀▀▄ █▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀█"
+echo "  █▄▄▀ █  █ █▄▄▀ █  █ █▄▄▀ █  █ █  █ █▀▀▀"
+echo "  █  █ █▀▀▀ █  █ █▀▀▀ █  █ █▀▀▀ █▀▀▀ ▀▀▀▀  CLI"
+echo -e "${GOLD}                         开邻Claw — AI 编码代理${NC}"
+echo ""
+
+if ! command -v bun &>/dev/null; then
+  echo -e "${GOLD}Installing Bun...${NC}"
+  curl -fsSL https://bun.sh/install | bash
+  export PATH="$HOME/.bun/bin:$PATH"
+fi
+
+echo -e "${GOLD}Bun:${NC} $(bun --version)"
+
+TMPDIR=$(mktemp -d)
+cd "$TMPDIR"
+
+echo -e "${GOLD}Downloading KirinCode CLI...${NC}"
+curl -fsSL -o kirincode.tgz "https://github.com/kirincode/kirincode/releases/latest/download/kirincode-cli-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/x64/;s/arm64/arm64/;s/aarch64/arm64/').tar.gz" 2>/dev/null && {
+  tar xzf kirincode.tgz
+  INSTALL_DIR="${KIRINCODE_INSTALL_DIR:-$HOME/.kirincode/bin}"
+  mkdir -p "$INSTALL_DIR"
+  cp kirincode "$INSTALL_DIR/"
+  chmod +x "$INSTALL_DIR/kirincode"
+} || {
+  echo -e "${GOLD}Binary not available. Installing from source via Bun...${NC}"
+  bun install -g kirincode-ai 2>/dev/null || {
+    echo "Direct install not available. Please clone the repo:"
+    echo "  git clone https://github.com/kirincode/kirincode"
+    echo "  cd kirincode && bun install"
+    echo "  alias kirincode='bun run packages/kirincode/src/index.ts'"
+    exit 1
+  }
+  INSTALL_DIR="$HOME/.bun/bin"
+}
+
+echo ""
+echo -e "${RED}${BOLD}KirinCode CLI installed!${NC}"
+echo ""
+echo "  Add to your shell profile:"
+echo -e "    ${GOLD}export PATH=\"$INSTALL_DIR:\$PATH\"${NC}"
+echo ""
+echo "  Quick start:"
+echo "    cd your-project"
+echo "    kirincode"
+echo "    /init       # analyze project"
+echo "    /memory     # view auto-memory"
+echo "    /skill      # manage skills"
+echo "    /workflow   # manage workflows"
+rm -rf "$TMPDIR"

+ 3 - 3
packages/kirincode/src/cli/ui.ts

@@ -4,9 +4,9 @@ import { logo as glyphs } from "./logo"
 
 const wordmark = [
   `⠀                                ▄     `,
-  `█▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█`,
-  `█  █ █  █ █▀▀▀ █  █ █    █  █ █  █ █▀▀▀`,
-  `▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀  ▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀`,
+  `██▀▄ █▀▀█ █▀▀▄ █▀▀█ █▀▀▄ █▀▀█ █▀▀█ █▀▀▄ █▀▀█`,
+  `█▀ █ █  █ █▄▄▀ █  █ █▀ █ █   █  █ █  █ █▀▀▀`,
+  `█▀ █ █▀▀▀ █  █ █▀▀▀ █▀ █ █   █▀▀▀ █▀▀▀ ▀▀▀▀`,
 ]
 
 export class CancelledError extends Schema.TaggedErrorClass<CancelledError>()("UICancelledError", {}) {}

+ 1 - 1
packages/tui/src/feature-plugins/home/tips-view.tsx

@@ -238,7 +238,7 @@ const TIPS: Tip[] = [
   "Use {highlight}opencode --continue{/highlight} to resume the last session",
   "Use {highlight}opencode run -f file.ts{/highlight} to attach files via CLI",
   "Use {highlight}--format json{/highlight} for machine-readable output in scripts",
-  "Run {highlight}opencode serve{/highlight} for headless API access to KirinCode",
+  "Run {highlight}kirincode serve{/highlight} for headless API access to KirinCode",
   "Use {highlight}opencode run --attach{/highlight} to connect to a running server",
   "Run {highlight}opencode upgrade{/highlight} to update to the latest version",
   "Run {highlight}opencode auth list{/highlight} to see all configured providers",

+ 16 - 3
packages/tui/src/util/presentation.ts

@@ -1,6 +1,19 @@
 const logo = {
-  left: ["                   ", "█▀▀█ █▀▀█ █▀▀█ █▀▀▄", "█__█ █__█ █^^^ █__█", "▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀~~▀"],
-  right: ["             ▄     ", "█▀▀▀ █▀▀█ █▀▀█ █▀▀█", "█___ █__█ █__█ █^^^", "▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀"],
+  // K I R I | N C O D E  (9 letters, split 4+5)
+  left: [
+    "                   ",
+    "█▀▀▄ █▀▀█ █▀▀▄ █▀▀█",
+    "█__▌ █▀▀▌ █▀▀█ █▀▀▌",
+    "█^^▌ █▀▀▌ █▀█_ █▀▀▌",
+    "▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀",
+  ],
+  right: [
+    "                  ▄     ",
+    "██▀▄ █▀▀█ █▀▀█ █▀▀▄ █▀▀█",
+    "█▀ █ █___ █__█ █__▌ █▀▀▀",
+    "█▀ █ █___ █^^█ █^^▌ █▀▀▀",
+    "▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀",
+  ],
 }
 
 const reset = "\x1b[0m"
@@ -32,7 +45,7 @@ export function sessionEpilogue(input: { title: string; sessionID?: string }) {
     ...wordmark("  "),
     "",
     `  ${weak("Session")}${bold}${input.title}${reset}`,
-    `  ${weak("Continue")}${bold}opencode -s ${input.sessionID}${reset}`,
+    `  ${weak("Continue")}${bold}kirincode -s ${input.sessionID}${reset}`,
     "",
   ].join("\n")
 }