Loading...
Loading...
Initialize new Dojo projects with proper directory structure, configuration files, and dependencies. Use when starting a new Dojo game project or setting up the initial project structure.
npx skill4agent add dojoengine/book dojo-initScarb.tomldojo_dev.tomlsozo init my-game"Create a new Dojo project called my-game"my-game/
├── Scarb.toml # Package manifest and dependencies
├── dojo_dev.toml # Local development profile
├── dojo_release.toml # Production deployment profile
└── src/
├── lib.cairo # Module exports
├── models.cairo # Game state models
├── systems/
│ └── actions.cairo # Game logic systems
└── tests/
└── test_world.cairo # Integration tests[package]
cairo-version = "2.12.2"
name = "my_game"
version = "1.0.0"
edition = "2024_07"
[[target.starknet-contract]]
sierra = true
build-external-contracts = ["dojo::world::world_contract::world"]
[dependencies]
starknet = "2.12.2"
dojo = "1.7.1"
[dev-dependencies]
cairo_test = "2.12.2"
dojo_cairo_test = "1.7.1"
[tool.scarb]
allow-prebuilt-plugins = ["dojo_cairo_macros"][world]
name = "My Game"
seed = "my_game"
[env]
rpc_url = "http://localhost:5050/"
account_address = "0x127fd..."
private_key = "0xc5b2f..."
[namespace]
default = "my_game"
[writers]
"my_game" = ["my_game-actions"]src/models.cairoPositionMovesDirectionsrc/systems/actions.cairospawnmovesrc/tests/test_world.cairospawn_test_worldsozo init my-game
cd my-gamekatana --dev --dev.no-feesozo build && sozo migratesozo execute my_game-actions spawnsozo testsrc/models.cairosrc/systems/[writers]dojo_dev.toml[dependencies]Scarb.tomldojo-modeldojo-systemdojo-testdojo-deploy