@civility/cli#
Build tool and dev server for Civility web projects. Scaffolds and builds PWAs, blogs, documentation sites, and browser extensions.
Install#
deno install jsr:@civility/cli -Afg --name=civ
Commands#
civ init#
Scaffold a new project. Run without arguments for an interactive prompt:
civ init
Or pass arguments directly:
civ init <type> <name> --url https://example.com
Types: pwa | blog | docs | extension
| Type | Description |
|---|---|
pwa |
Progressive Web App with service worker and manifest |
blog |
Static blog built from Markdown files |
docs |
Documentation site built from Markdown files |
extension |
Browser extension targeting Chrome (MV3) and Firefox (MV2) |
civ build#
Build the project in the current directory. Reads civility.json for configuration.
civ build
civ build --watch # rebuild on changes
civ start#
Start a local dev server with live rebuild on file changes (default port 8000).
civ start
civ icons#
Generate PWA icon sizes from a source PNG or SVG using ImageMagick. Outputs all standard sizes plus icon.ico.
civ icons
civ icons --source ./src/icon.svg --output ./dist/icons
civ static#
Serve a static directory without a build step.
civ static
Configuration#
Projects are configured via civility.json in the project root:
{
"name": "My App",
"type": "pwa",
"url": "https://myapp.com",
"root": "./www",
"outdir": "./dist",
"icon": {
"source": "./www/static/icon.svg",
"output": "./www/static/icons"
}
}
| Field | Type | Description |
|---|---|---|
name |
string |
Project name |
type |
pwa|blog|docs|extension |
Project type |
url |
string |
Canonical URL |
root |
string |
Source directory |
outdir |
string |
Output directory |
static |
string |
Static assets directory (copied as-is) |
input |
string |
Input directory (blog/docs) |
output |
string |
Output directory (blog/docs) |
icon |
{ source, output } |
Icon source and output for civ icons |
platforms |
("chrome"|"firefox")[] |
Extension target platforms |