barshelf๋ BarShelf ์์ ฏ์ ๋ง๋ค๊ณ , ๊ฒ์ฆํ๊ณ , ํจํค์งํ๊ณ , ์ค์นํ๋ ๋
๋ฆฝ CLI๋ค. GUI ์ฑ ์์ด ๋์ํ๋ฉฐ(์์ CLI), ์ฑ๊ณผ ๊ฐ์ Core ๋์ฝ๋ยท์ค์น ํ์ดํ๋ผ์ธ์ ์ฌ์ฉํ๋ค.
๊ด๋ จ ๋ฌธ์:
- ์ค์น URL ๊ณ์ฝ:
docs/INSTALLING-WIDGETS.md - ๋ฐฐํฌ ์ํฌํ๋ก:
docs/PUBLISHING.md - ๋ ์ง์คํธ๋ฆฌ ๋ฑ์ฌ:
docs/REGISTRY.md - manifest ์คํ:
docs/WIDGET-SPEC.md - ์์ด์ ํธ์ฉ ์์ ฏ ์์ฑ ์คํ:
docs/AGENTS.md(barshelf agent-spec๋ก๋ ์ถ๋ ฅ)
barshelf install <src> # GitHub URL / ๋ก์ปฌ ์์ ฏ ๋๋ ํ ๋ฆฌ / .zipยท.mbw(๊ฒฝ๋กยทURL) / ๋ฅ๋งํฌ
barshelf new <name> [--kind exec|workflow|script] [--dir <path>] # ๊ธฐ๋ณธ kind=exec, ๊ธฐ๋ณธ dir=./<name>
barshelf validate <path> # widget.json(+workflow.json ์์ผ๋ฉด) Core ๋์ฝ๋๋ก ๊ฒ์ฆ, ์ค๋ฅ๋ฅผ ํ์ผ:ํ๋ ๋จ์๋ก ์ถ๋ ฅ
barshelf pack <dir> [-o <name>.mbw] # zip(.mbw) ์์ฑ + ์์นด์ด๋ธ์ manifest.sha256 ํฌํจ(widget.json์ sha256)
barshelf list # ์ค์น๋ ์์ ฏ ๋์ด (id, name, version, kind)
barshelf agent-spec # ์์ ฏ ์์ฑ ์คํ(docs/AGENTS.md)์ stdout์ผ๋ก ์ถ๋ ฅ (LLM ์์ด์ ํธ์ฉ)
barshelf --version / --help
bsf๋ ๊ฐ์ ๋์์ ์ ๊ณตํ๋ ์งง์ alias๋ค. ๋ฌธ์์ ์์ด์ ํธ ์คํ์ ๋ช
ํ์ฑ์ ์ํด canonical ๋ช
๋ น์ธ barshelf๋ฅผ ์ฌ์ฉํ๋ค.
| ์ปค๋งจ๋ | ์ธ์/์ต์ | ๋์ |
|---|---|---|
barshelf install <src> |
GitHub ์ ์ฅ์ URL, ๋ก์ปฌ ์์ ฏ ๋๋ ํ ๋ฆฌ, .zip/.mbw(๋ก์ปฌ ๊ฒฝ๋ก ๋๋ URL), barshelf://install?... ๋ฅ๋งํฌ |
R05 URL ์ค์น ๊ณ์ฝ ๊ทธ๋๋ก ๋ค์ด๋ก๋โ์ถ์ถโํ์โ์ค์น. ๋ค์ด์ผ๋ก๊ทธ ์์ด ๊ถํ ์์ฝ์ stdout์ ์ถ๋ ฅํ๊ณ , --yes๊ฐ ์์ผ๋ฉด stdin ํ์ธ ํ๋กฌํํธ๋ฅผ ๋์ด๋ค. ํ์ดํ ๋ฑ ๋น์ธํฐ๋ํฐ๋ธ ํ๊ฒฝ์ด๋ฉด ์๋ ์งํํ๊ณ ์์ฝ์ ์ถ๋ ฅํ๋ค. |
barshelf new <name> |
--kind exec|workflow|script (๊ธฐ๋ณธ exec), --dir <path> (๊ธฐ๋ณธ ./<name>) |
ํ
ํ๋ฆฟ์์ ์ ์์ ฏ ๋๋ ํฐ๋ฆฌ๋ฅผ ์์ฑํ๊ณ , ์์ฑ ์งํ barshelf validate๋ฅผ ์๋ ์คํํด green ํ์ธ ๋ฉ์์ง๋ฅผ ์ถ๋ ฅํ๋ค. |
barshelf validate <path> |
์์ ฏ ๋๋ ํฐ๋ฆฌ ๋๋ pack๋ .mbw ํ์ผ |
widget.json(๊ทธ๋ฆฌ๊ณ workflow.json์ด ์์ผ๋ฉด ํจ๊ป)์ Core ๋์ฝ๋๋ก ๊ฒ์ฆํ๊ณ , ์ค๋ฅ๋ฅผ ํ์ผ:ํ๋ ๋จ์๋ก ์ถ๋ ฅํ๋ค. .mbw๋ฅผ ๋ฐ์ผ๋ฉด ์์ ์ถ์ถ ํ ๊ฒ์ฆํ๋ค. |
barshelf pack <dir> |
-o <name>.mbw (์ถ๋ ฅ ํ์ผ๋ช
) |
์์ ฏ ๋๋ ํฐ๋ฆฌ๋ฅผ zip(.mbw)์ผ๋ก ํจํค์งํ๊ณ , ์์นด์ด๋ธ์ manifest.sha256(widget.json์ sha256)์ ํฌํจํ๋ค. |
barshelf list |
โ | ์ค์น๋ ์์ ฏ์ id, name, version, kind๋ก ๋์ดํ๋ค. |
barshelf agent-spec |
โ | ์์ ฏ ์์ฑ ์คํ(docs/AGENTS.md)์ stdout์ผ๋ก ์ถ๋ ฅํ๋ค. LLM ์์ด์ ํธ์๊ฒ ์์ ฏ ์ ์ ๊ณ์ฝ ์ ์ฒด๋ฅผ ํ ๋ฒ์ ๋๊ธธ ๋ ์ด๋ค. ๊ฐ๋ฐ ์ฒดํฌ์์์์๋ ๋์คํฌ์ docs/AGENTS.md๋ฅผ, ๋จ๋
๋ฐฐํฌ ๋ฐ์ด๋๋ฆฌ์์๋ ๋น๋์ ๋ด์ฅ๋ ์ฌ๋ณธ์ ์ถ๋ ฅํ๋ค(๋ด์ฉ ๋์ผ). |
barshelf --version / barshelf --help |
โ | ๋ฒ์ /๋์๋ง ์ถ๋ ฅ. |
| kind | ํ ํ๋ฆฟ ๋ด์ฉ |
|---|---|
exec |
hello์ ์ ธ ์คํฌ๋ฆฝํธ + manifest |
workflow |
recent-files ์ถ์ํ (workflow.json ํฌํจ) |
script |
clock-script ์ถ์ํ (import { barshelf, ui } from "barshelf") |
- exit 0 ์ฑ๊ณต / exit 1 ์คํจ.
- ์ถ๋ ฅ์ ์ฌ๋์ด ์ฝ๋ ํ๋ฌธ์ด๋ค(์ปฌ๋ฌ ๋ถํ์).
- ์ค๋ฅ๋ stderr๋ก ์ถ๋ ฅ๋๋ค.
์ ์์ ฏ์ ๋ง๋ค๊ณ ๊ฒ์ฆยทํจํค์งํด ์ค์น๊น์ง ํ์ธํ๋ ํ๋ฆ:
# 1. ์ exec ์์ ฏ ์์ฑ (์์ฑ ์งํ validate๊ฐ ์๋ ์คํ๋๋ค)
$ barshelf new my-clock
Created widget at ./my-clock (kind: exec)
Validating ./my-clock ... OK
# 2. ์์ ํ ์ฌ๊ฒ์ฆ โ ์ค๋ฅ๋ ํ์ผ:ํ๋ ๋จ์๋ก ์ถ๋ ฅ๋๋ค
$ barshelf validate ./my-clock
my-clock/widget.json: refresh.interval: expected number, found string
$ echo $?
1
# 3. ๊ณ ์น๊ณ ๋ค์ ๊ฒ์ฆ
$ barshelf validate ./my-clock
OK
# 4. .mbw ์์นด์ด๋ธ๋ก ํจํค์ง
$ barshelf pack ./my-clock -o my-clock.mbw
Packed my-clock.mbw (manifest.sha256 included)
# 5. pack๋ .mbw๋ validate๋ก ๊ฒ์ฆํ ์ ์๋ค
$ barshelf validate my-clock.mbw
OK
# 6. URL ๋๋ ๋ก์ปฌ ์์นด์ด๋ธ๋ก ์ค์น โ ๊ถํ ์์ฝ์ ๋ณด์ฌ์ฃผ๊ณ ํ์ธ์ ๋ฐ๋๋ค
$ barshelf install https://github.com/example/barshelf-widgets/tree/main/widgets/clock
Widget: Clock (dev.example.clock) 0.1.0
Permissions: exec ./clock.sh
Install? [y/N] y
Installed to ~/Library/Application Support/barshelf/widgets/dev.example.clock
# ๋น์ธํฐ๋ํฐ๋ธ(ํ์ดํ/CI)์์๋ ์๋ ์งํ + ์์ฝ ์ถ๋ ฅ, ๋๋ --yes๋ก ํ์ธ ์๋ต
$ barshelf install --yes https://github.com/example/barshelf-widgets
# 7. ์ค์น๋ ์์ ฏ ํ์ธ
$ barshelf list
dev.example.clock Clock 0.1.0 exec๋ฉ์์ง ๋ฌธ๊ตฌ๋ ์์์ด๋ฉฐ ๋ฆด๋ฆฌ์ค์ ๋ฐ๋ผ ๋ฌ๋ผ์ง ์ ์๋ค. ๊ณ์ฝ์ผ๋ก ๋ณด์ฅ๋๋ ๊ฒ์ ์๋ธ์ปค๋งจ๋ยท์ต์ ยทexit ์ฝ๋ยทstderr ์ค๋ฅ ์ถ๋ ฅ์ด๋ค.
barshelf install์ ์ฑ์ ์ค์น ํ์ดํ๋ผ์ธ์ GUI ์์ด ์ฌ์ฉํ๋ ๋
๋ฆฝ ์คํ ํ์ผ์ด๋ค. ์ฑ ๋ฒ๋ค ๋ด๋ถ ์คํ ํ์ผ(BarShelf.app/Contents/MacOS/barshelf-app)์๋ headless install ๋ชจ๋๊ฐ ๋จ์ ์์ง๋ง, ์ธ๋ถ ๋ฌธ์์ ์๋ํ์์๋ CLI์ธ barshelf ๋๋ alias bsf๋ฅผ ์ฌ์ฉํ๋ค.
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift build --product barshelf
swift run barshelf --help
swift run bsf --help์ฑ ๋ฒ๋ค ๋น๋ ์คํฌ๋ฆฝํธ(scripts/build_app.sh)๋ dist/์ barshelf์ bsf ๋ฐ์ด๋๋ฆฌ๋ ํจ๊ป ๋ณต์ฌํ๋ค.