Giao dien dong lenh
De AI agent cua ban quan ly font bieu tuong. Bobcorn CLI duoc thiet ke cho quy trinh lam viec AI-first — agent cua ban co the tao du an, nhap icon, to chuc nhom va xuat font ma khong can mo GUI.
Bat dau
Bobcorn CLI cho phep ban quan ly du an font bieu tuong hoan toan tu terminal. Cai dat tu bang Cai dat trong ung dung Bobcorn — nhan nut Cai dat trong phan "Giao dien dong lenh".
Xac minh cai datbobcorn --version
bobcorn --help --json de kham pha tat ca cac lenh co san. Agent se xu ly phan con lai.
Tu dong phat hien du an
CLI tu dong phat hien cac tap tin du an .icp trong thu muc hien tai. Ban cung co the chi dinh duong dan ro rang. Thu tu uu tien:
- Doi so duong dan ro rang — truyen truc tiep cho lenh
- Co
--project— tuy chon toan cuc cho tat ca cac lenh - Tu dong phat hien — quet thu muc hien tai tim tap tin
.icp
# 1. Doi so duong dan ro rang
bobcorn project inspect my-icons.icp
# 2. Co toan cuc --project
bobcorn --project my-icons.icp icon list
# 3. Tu dong phat hien (chay tu thu muc chua tap tin .icp)
cd my-project/
bobcorn icon list
Dinh dang dau ra
Mac dinh CLI xuat van ban doc duoc. Them --json de co dau ra JSON co cau truc, ly tuong cho script va tich hop AI agent.
Cau truc phong bi JSON
Moi phan hoi JSON theo mot phong bi nhat quan:
Phong bi JSON{
"ok": true,
"data": { ... },
"meta": {
"command": "icon list",
"projectPath": "/path/to/project.icp",
"duration_ms": 42,
"version": "1.0.0"
}
}
Ba trang thai phan hoi
| Trang thai | ok | Mo ta |
|---|---|---|
| Thanh cong hoan toan | true | Thao tac hoan tat. Du lieu trong truong data. |
| That bai mot phan | true | Mot so muc thanh cong. Kiem tra mang warnings. |
| That bai hoan toan | false | Thao tac that bai. Loi trong truong error voi code. |
Tham chieu lenh
Du an
Tao, kiem tra va cau hinh tap tin du an .icp.
# Create a new empty project
bobcorn project create my-icons.icp --name "App Icons"
# Inspect project metadata
bobcorn project inspect
# Set project name / font prefix
bobcorn project set-name "New Name"
# Set font prefix (alias)
bobcorn project set-prefix "MyIcons"
# Save a copy
bobcorn project save-as backup.icp
Bieu tuong
Nhap, liet ke, doi ten, di chuyen, sao chep, xoa va cau hinh bieu tuong. Tat ca tham chieu su dung UUID — dung icon list --json de tim ID.
bobcorn icon import *.svg --group Navigation
bobcorn icon list
bobcorn icon list --group Navigation --json
bobcorn icon rename <id> new-name
bobcorn icon move <id1> <id2> --to "Other Group"
bobcorn icon copy <id> --to "Backup"
bobcorn icon delete <id>
bobcorn icon set-code <id> E100
bobcorn icon replace <id> new-icon.svg
bobcorn icon export-svg <id> --out ./exports
bobcorn icon set-favorite <id>
bobcorn icon set-favorite <id> --off
bobcorn icon set-color <id> --from "#000" --to "#333"
bobcorn icon get-content <id>
Nhom
To chuc bieu tuong thanh cac nhom duoc dat ten. Nhom kiem soat thu tu hien thi trong thanh ben va co the dung de loc xuat.
Lenh nhombobcorn group list
bobcorn group add "New Category"
bobcorn group rename "Old Name" "New Name"
bobcorn group delete "Empty Group"
bobcorn group reorder Navigation Actions Settings
bobcorn group set-description Navigation "Main nav icons"
bobcorn group move-icons Navigation <id1> <id2>
Xuat
Tao tap tin font va xuat SVG. Ho tro SVG, TTF, WOFF, WOFF2 va EOT voi tap tin CSS va JS tuy chon.
Lenh xuatbobcorn export font --out ./dist --formats woff2,ttf
bobcorn export font --out ./dist --font-name "MyIcons" --css --js
bobcorn export svg --out ./svg-icons
bobcorn export svg --out ./svg-icons --group Navigation
export icon (xuat raster: PNG, JPG, WebP, PDF, ICO) co san voi preset nen tang (--preset ios, --preset android, v.v.) nhung chua duoc trien khai day du trong che do CLI.
Tim kiem va yeu thich
Tim bieu tuong theo ten va quan ly danh sach yeu thich.
Tim kiem va yeu thichbobcorn search "arrow"
bobcorn search "home" --group Navigation --limit 10
bobcorn favorite list
Bien the
Quan ly bien the trong luong va ti le cua bieu tuong (kieu SF Symbols). Tao bien the can GUI Bobcorn, nhung ban co the liet ke va xoa bien the tu CLI.
Lenh bien thebobcorn variant list <id>
bobcorn variant delete <id>
Tich hop AI Agent
Bobcorn CLI duoc thiet ke de hoat dong lien mach voi cac AI coding agent nhu Claude Code, Codex, Cursor va nhieu hon. Su dung --json cho dau ra co cau truc ma agent co the phan tich dang tin cay.
Nguyen tac chinh
- Moi lenh ho tro
--jsoncho dau ra may doc duoc - Phong bi JSON nhat quan tren tat ca lenh — agent co the dua vao cau truc
ok/error/data - Tu dong phat hien du an cho phep agent chi can
cdvao thu muc du an va chay lenh ma khong can chi dinh duong dan - Ma loi co the du doan:
ICON_NOT_FOUND,GROUP_NOT_FOUND,FILE_IO_ERROR, v.v.
Vi du quy trinh lam viec cua Agent
Quy trinh lam viec AI Agentbobcorn project create app-icons.icp --name "MyApp" --json
bobcorn icon import ./design/*.svg --json
bobcorn group add "Navigation" --json
bobcorn group add "Actions" --json
NAV_IDS=$(bobcorn search "nav" --json | jq -r '.data[].id')
bobcorn icon move $NAV_IDS --to "Navigation" --json
bobcorn export font --out ./src/fonts --formats woff2 --json
Vi du quy trinh lam viec day du
Day la script bash day du minh hoa quy trinh lam viec font bieu tuong dien hinh:
Script quy trinh lam viec day du#!/bin/bash
set -e
bobcorn project create my-app-icons.icp --name "MyApp"
bobcorn icon import ./design/icons/*.svg
bobcorn group add "Navigation"
bobcorn group add "Actions"
bobcorn group add "Status"
NAV_ICONS=$(bobcorn search "nav" --json | jq -r '.data[].id')
for id in $NAV_ICONS; do
bobcorn icon move "$id" --to "Navigation"
done
bobcorn group reorder Navigation Actions Status
bobcorn export font --out ./src/fonts --formats woff2 --css
bobcorn export svg --out ./docs/icons
echo "Hoan tat! Tap tin font nam trong ./src/fonts"
.icp nhu ung dung desktop. Thay doi qua CLI hien thi khi mo du an trong GUI va nguoc lai. Dieu nay giup ban de dang su dung GUI cho thiet ke truc quan va CLI cho tu dong hoa va duong ong CI/CD.