Scarb is the project management tool for the Cairo language. Scarb manages your dependencies, compiles your projects and works as an extensible platform assisting in development.
Binary archives for all major platforms (Linux, macOS, Windows) are published on our GitHub releases page.
Simply download suitable one, extract, and move the scarb
executable to a directory reachable by your PATH
.
In the future, an automated installer is planned to be created.
$ scarb new project/directory
Also: There is scarb init
which runs in current directory instead of creating new one.
$ scarb build
Built artifacts will be written to target/release
directory.
Also: scarb clean
cleans target
directory.
Add following to Scarb.toml
:
[lib]
casm = true
Also: Adding sierra = false
will stop building Sierra code.
Add following to Scarb.toml
:
[[target.starknet-contract]]
Note: Ensure there is no [lib]
section, they are conflicting
until #63 will be done.
Note: This is identical to Cargo.
[dependencies]
quaireaux = { path = "path/to/quaireaux" }
quaireaux = { git = "https://github.com/keep-starknet-strange/quaireaux.git" }
Also: You can add version
field to specify package version, but this will do more harm than good currently, Scarb
lacks proper version solution algorithm yet.
Also: You can add branch
, tag
and rev
fields to Git dependencies.
Also: You can use ssh://
URLs, Scarb uses local git
installation for all network operations.
$ scarb add quaireaux --path path/to/quaireaux
$ scarb add quaireaux --git https://github.com/keep-starknet-strange/quaireaux.git
Also: You can specify package version like this: quaireaux@0.1.0
, but see remarks in previous section.
Also: --git
supports --branch
, --tag
and --rev
arguments.
Also: scarb rm
removes a dependency.
# Format Cairo code:
$ scarb fmt
# Check formatting in CI:
$ scarb fmt -c
All notable changes to this project are documented on the GitHub releases page.
We track project roadmap here.
This product includes modified portions of code of Cargo, developed by the Rust project contributors.
This product includes modified portions of code of hex_solver, developed by Six Colors AB.