template

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2026 License: AGPL-3.0-or-later Imports: 12 Imported by: 0

Documentation

Overview

Package template provides Pack / Unpack helpers for agencycli agency templates.

A template is a .tar.gz archive containing:

template.json         — TemplateManifest metadata (npm package.json style)
agency-prompt.md      — agency-level prompt ({{AGENCY_NAME}} substituted on apply)
teams/<team>/...      — team prompts and role definitions
skills/<skill>/...    — reusable skill files

Runtime state (projects/, agents/, tasks, heartbeat, crons, .agencycli/) is always excluded from archives.

Index

Constants

View Source
const ManifestFile = "template.json"

Variables

This section is empty.

Functions

func ApplyDir

func ApplyDir(templateDir, destDir, agencyName string) error

ApplyDir copies a template from a plain directory into destDir, substituting {{AGENCY_NAME}} in all text file contents.

func InitAgencyFromTemplate

func InitAgencyFromTemplate(root, agencyName, agencyDesc string,
	apply func(destDir, agencyName string) error) error

InitAgencyFromTemplate initialises a new agency workspace in root by:

  1. Creating the directory
  2. Applying the template skeleton (substituting {{AGENCY_NAME}})
  3. Writing .agencycli/agency.yaml via scaffold.InitAgency

func Pack

func Pack(agencyDir, outputPath string, manifest *entity.TemplateManifest) error

Pack creates a .tar.gz template archive from an existing agency workspace. manifest provides the metadata written to template.json inside the archive. outputPath should end in ".tar.gz".

func ReadManifestFromArchive

func ReadManifestFromArchive(archivePath string) (*entity.TemplateManifest, error)

ReadManifestFromArchive reads template.json from a .tar.gz without fully extracting it.

func ReadManifestFromDir

func ReadManifestFromDir(dir string) (*entity.TemplateManifest, error)

ReadManifestFromDir reads template.json from a directory.

func Unpack

func Unpack(archivePath, destDir, agencyName string) error

Unpack extracts a .tar.gz template archive into destDir (must already exist), substituting {{AGENCY_NAME}} with agencyName in all text files.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL