castle-cli
v2.0.3
Published
Castle CLI for local deck creation, preview, editing, and saving
Readme
Castle CLI
Castle CLI creates, previews, edits, and saves Castle deck projects from local files.
Install
npm install -g castle-cli
castle --helpStart A Deck
Create a new local deck and serve it in a browser:
castle init my-deck --title "My Deck"
castle serve my-deck --openserve runs in the foreground and prints the local preview URL. After editing project files, reload the active preview:
castle restart
castle logs
castle screenshot screenshot.pngGet And Save
Get an existing deck by ID:
castle get-deck <deck-id> my-deck
castle serve my-deck --openSave a local deck as an unlisted Castle deck:
castle save-deck my-deckCards
castle add-card my-deck --title "Card 2"
castle remove-card <card-id> my-deck --forceProject Files
Local projects use this shape:
my-deck/
deck.json
cards/
<card-id>/
card.json
scripts/
main.lua
scene/
actors.yaml
variables.yaml
blueprints/
main.yaml
main.jsonEdit Lua scripts directly. Generated scene YAML and blueprint JSON files are mainly for inspection; use castle edit for structural changes such as blueprints, actors, variables, layout, drawing assets, text settings, and rules.
Updating From castle-cli Before 2.0.0
If you already have castle-cli installed from before version 2.0.0, run the install command again to update it:
npm install -g castle-cliProject directories created by castle-cli versions before 2.0.0 should be recreated with the new CLI. Move or remove the old local directory, then get the deck again:
mv my-deck my-deck-old
castle get-deck <deck-id> my-deck
castle serve my-deck --open