Save

Creates or updates a formula with a set of files and metadata.

Usage

Use the save command to create or update a formula.

Terminal
g0 save <formula-name>

This will package all directories marked with index.yml and markdown files containing yaml frontmatter with matching formula name to the formula.

Refer to What are Formulas? for details on how formulas work.
Use the list command to list all locally saved formulas and show command to show details of a saved formula.

GroundZero only searches and includes directories and markdown files under supported platform directories and the root ai/ directory. See Platforms for a complete list of supported platforms.

Advanced Usage

Versioning

Formulas are auto versioned to simplify management:

Terminal
# Codebase without formula "essentials"
g0 save essentials
# Formula saved as [email protected] (initial version defaults to 0.1.0)
g0 save essentials
# Formula saved as [email protected] (bumped to next pre-release version)
g0 save essentials stable
# Formula saved as [email protected] (bumped to next stable version)
g0 save essentials stable
# Formula saved as [email protected] (bumped to next stable patch version)
g0 save essentials
# Formula saved as [email protected] (bumped to next pre-release version)

You may also manually bump formulas as needed using the --bump (or -b) option:

Terminal
g0 save essentials
# Formula saved as [email protected]
g0 save essentials -b minor
# Formula saved as [email protected] (bumped to next minor pre-release version)
g0 save essentials stable
# Formula saved as [email protected] (bumped to next stable version)
g0 save essentials stable -b major
# Formula saved as [email protected] (bumped to next stable major version)

Or specify an explicit version to save as using the @ notation:

Terminal
g0 save [email protected]
# Formula saved as [email protected]

Bundling

You can bundle formulas together by using the --include or --include-dev option, which adds the specified formula to the target formula's formulas or dev-formulas.

Terminal
g0 save scalable-nextjs --include scalable-typescript
# Where installed version of formula "scalable-typescript" is 0.1.2
g0 save scalable-nextjs --include-dev formula-essentials
# Where installed version of formula "formula-essentials" is 0.2.3
.groundzero/formulas/scalable-nestjs/formula.yml
name: scalable-nestjs
version: 0.1.0
formulas:
  - name: scalable-typescript
    version: ^0.1.2
dev-formulas:
  - name: formula-essentials
    version: ^0.2.3

Installation of a formula will also install the specified formulas in the formula's formula.yml file recursively for all nested formulas. (dev-formulas will only be installed for the top level project scoped formula.yml files.)

Bundling formulas using formula.yml formulas and dev-formulas is very similar to npm's package.json dependencies and devDependencies. One notable difference is that all formula installations are flattened and conflicts are manually resolved with single version overrides.