Documentation Index
Fetch the complete documentation index at: https://mintlify.com/blueshift-gg/quasar/llms.txt
Use this file to discover all available pages before exploring further.
The core development loop for a Quasar program revolves around three commands: quasar build compiles your Rust source to a Solana BPF .so binary, quasar test runs your Rust or TypeScript test suite against that binary, and quasar deploy uploads it to a cluster. All three commands read from Quasar.toml in the current directory, so they must be run from the project root.
quasar build
quasar build compiles the on-chain program. It first generates the IDL and any configured client code, runs the lint check, and then invokes cargo build-sbf (for the solana toolchain) or cargo build-bpf (for the upstream toolchain). The compiled binary is written to target/deploy/<name>.so.
quasar build
quasar build --debug
quasar build --verbose
quasar build --watch
quasar build --features my-feature,another-feature
Flags
| Flag | Description |
|---|
--debug | Emit debug symbols (required for profiling with quasar profile) |
--verbose | Stream the underlying cargo build-sbf / cargo build-bpf output directly |
-w, --watch | Watch src/ for changes and rebuild automatically |
--features FEATURES | Cargo features to enable (comma-separated or repeated) |
Output
On success, quasar build prints the elapsed build time and the binary size:
✔ Build complete in 4.2s (312 KB, -8 KB)
The size delta (e.g. -8 KB) is shown relative to the previous build. Binary output is always placed in target/deploy/.
The Solana toolchain requires cargo-build-sbf with platform-tools v1.52 or newer. If your installed version is older, quasar build prints an actionable error: agave-install update.
Watch Mode
In watch mode, quasar build --watch monitors the src/ directory and triggers a full rebuild whenever a source file changes. This is useful during active development to keep the compiled binary up to date without manually re-running the build.
quasar test
quasar test builds the program (unless --no-build is passed) and then runs the configured test suite. Quasar supports both Rust tests (via quasar-svm or Mollusk) and TypeScript tests (via Vitest). The test framework is determined by the [testing] section of Quasar.toml.
quasar test
quasar test --filter test_initialize
quasar test --watch
quasar test --no-build --show-output
quasar test --features idl-build --verbose
Flags
| Flag | Description |
|---|
--debug | Build with debug symbols before testing |
--show-output | Forward --show-output to cargo test (shows println! output) |
-f PATTERN, --filter PATTERN | Only run tests whose name matches PATTERN |
-w, --watch | Watch src/ for changes and re-run tests automatically |
--no-build | Skip the build step and test against the existing binary |
--features FEATURES | Cargo features to enable (comma-separated or repeated) |
--verbose | Show build and test commands as they run |
Rust Tests
When testing.language = "rust" in Quasar.toml, quasar test runs cargo test tests:: by default. The --filter flag appends a test name pattern before the -- separator, and --show-output is forwarded after it.
TypeScript Tests
When testing.language = "typescript" in Quasar.toml, quasar test installs npm dependencies (if node_modules/ is absent) and then runs npx vitest run by default. For TypeScript tests, --filter maps to Vitest’s -t flag.
Customizing the Test Command
The exact install and test commands are configurable in Quasar.toml:
[testing.typescript]
framework = "quasar-svm"
sdk = "kit"
install = { program = "pnpm", args = ["install", "--frozen-lockfile"] }
test = { program = "pnpm", args = ["vitest", "run"] }
quasar deploy
quasar deploy builds the program (unless --skip-build is passed) and then calls solana program deploy with the compiled .so and the program keypair. It reads the cluster URL and payer keypair from the Solana CLI configuration unless overridden with flags.
quasar deploy
quasar deploy --url devnet
quasar deploy --url https://api.mainnet-beta.solana.com
quasar deploy --keypair ~/.config/solana/my-wallet.json
quasar deploy --skip-build
Flags
| Flag | Description |
|---|
-u URL, --url URL | Cluster URL: devnet, mainnet-beta, localhost, or a custom RPC endpoint |
-k KEYPAIR, --keypair KEYPAIR | Payer keypair path (default: Solana CLI default keypair) |
--program-keypair KEYPAIR | Program keypair path (default: target/deploy/<name>-keypair.json) |
--upgrade-authority KEYPAIR | Upgrade authority keypair (default: Solana CLI default keypair) |
--skip-build | Deploy the existing binary without rebuilding |
Keypair Discovery
If --program-keypair is not supplied, Quasar looks for a keypair file in target/deploy/ using the project name and module name. If no keypair file exists, the deploy fails with an error directing you to run quasar keys new first.
On success the program ID is printed:
✔ Deployed to 4rEGsVnJb3...
Deploying to mainnet-beta is irreversible. Always verify your binary on devnet first and run quasar lint --strict before deploying an upgrade.
quasar clean
quasar clean removes the Quasar-managed build artifact directories:
target/deploy/ — compiled .so binaries (keypair files are preserved)
target/profile/ — debug builds used by quasar profile
target/idl/ — generated IDL JSON
target/client/ — generated client code
quasar clean
quasar clean --all
| Flag | Description |
|---|
-a, --all | Also run cargo clean to remove all Cargo build artifacts |
quasar clean intentionally preserves *-keypair.json files in target/deploy/ because losing the keypair would change the program’s on-chain address.
Full Build → Test → Deploy Workflow
Scaffold the project
quasar init my-program --yes
cd my-program
Write your program logic
Edit src/lib.rs or add instructions with quasar add:quasar add --instruction transfer
Build the program
Use --watch during development to rebuild on every save: Run the test suite
Filter to a specific test during debugging:quasar test --filter test_transfer --show-output
Lint before deploying
Update the lock file when the program surface is intentionally changed:quasar lint --update-lock
Deploy to devnet
quasar deploy --url devnet
Deploy to mainnet
quasar deploy --url mainnet-beta --keypair ~/.config/solana/my-wallet.json
During active development, run quasar test --watch in one terminal and keep your editor open alongside it. Tests re-run automatically on every source change, giving you instant feedback without switching context.