Supra CLI provides a set of commands to help you manage your Supranim projects efficiently. With Supra, you can easily create new projects from starter kits and bundle static assets. This is pretty much the first version of the CLI, and I'm planning to add more features and commands in the future, so stay tuned for updates!
🔗Installation
Usually, Supra CLI is automatically installed when you install Supranim for the first time. However, if you need to install it, you can always do it using Nimble:
nimble install supraIf you prefer a faster alternative try Clue package manager, developed by OpenPeeps (Note: --build will actually build the package, without it will just install it as a library)
clue install supra --buildOr, directly from GitHub using the following command:
nimble install https://github.com/supranim/supra🔗Available Commands
Here are some of the available commands in Supra CLI. Type supra -h to see the full list of commands and options:
CLI tool for bootstrapping Supranim applications
(c) Supranim | MIT License
Build Version: 0.1.2
Development
init <project:string> Create a new Supranim application
--nocache:bool
--skipconfig:bool
Asset Bundling
bundle.assets <dir:string> <output:string> Bundle static assets into the application
--skip-prefix:bool
🔗Asset Bundler
You can use supra bundle.assets command to bundle you static assets into a .bin blob file followed by an embeddable nim module that can be found <project>/.cache/embed<name>.nim
An example of a generated .nim module:
# generated by Supra CLI via `supra bundle.assets` command
# last updated: 2026-09-24T12:12:35+03:00
# source: sunday/src/storage/assets
import std/[strutils]
import pkg/supranim/service/assets
const supraBlob = staticRead("sunday/.cache/embed_assets.bin")
const supraIndex = [
("assets", "/assets/app.css", 0, 5556, true),
("assets", "/assets/bootstrap.min.css", 5556, 232947, true),
("assets", "/assets/bootstrap.min.js", 238503, 80496, true),
("assets", "/assets/dashboard.js", 318999, 375618, true),
("assets", "/assets/favicon-32x32.png", 694617, 1334, false),
("assets", "/assets/noise.webp", 695951, 162028, false),
("assets", "/assets/photo-1579169703977-e4575236583c.jpeg", 857979, 208784, false),
("assets", "/assets/photo-1671624524528-5822d43e9100.jpeg", 1066763, 263134, false),
("assets", "/assets/sunday-icon.svg", 1329897, 571, true),
("assets", "/assets/sunday.svg", 1330468, 3786, true),
("assets", "/assets/supranim.png", 1334254, 11922, false),
("assets", "/assets/too-much-micro-brewed-coffee.gif", 1346176, 403403, false),
]
proc supraToBytes(s: string, off, size: int): seq[uint8] =
# Convert a substring of `s` to a sequence of bytes without copying if possible
result = newSeq[uint8](size)
if size > 0:
copyMem(result[0].addr, s[off].unsafeAddr, size)
block initAssets:
# Initialize the StaticBundle with the embedded assets
let sta = staticAssets()
# Fast path for binary assets; fallback to byte->string copy
for e in supraIndex:
let prefix = e[0]
let key = e[1]
let off = e[2]
let size = e[3]
let isText = e[4]
if isText:
if size == 0:
sta.addTextFile(prefix, key, "") # handle empty text files
else:
sta.addTextFile(prefix, key, supraBlob[off ..< off + size])
else:
sta.addAsset(key, supraToBytes(supraBlob, off, size))