Skip to content

[FEATURE] Scaffold projects from CogSol Cookbook templates/examples via CLI #7

@nsuruguay05

Description

@nsuruguay05

Problem Statement

CogSol Cookbook contains curated templates and examples for using the CogSol Framework, but the current CLI does not provide a streamlined way to bootstrap a new workspace from one of these starter assets. As a result, users must manually browse the repository and copy files, which adds friction and makes onboarding slower.

Proposed Solution

Extend the startproject CLI command to support initializing a project directly from the Cookbook:

  • --from-template <template-name>
  • --from-example <example-name>

When provided, the CLI should:

  1. Resolve the requested template/example name within the Cookbook repository (templates/<name> or examples/<name>).
  2. Download (or otherwise fetch) the selected folder contents.
  3. Materialize the files into the user’s target workspace directory (e.g., the current directory or a provided output path).

Optional (nice-to-have) flags:

  • --list-templates / --list-examples to display available options.
  • --force to overwrite existing files when conflicts occur.
  • --ref <tag|commit|branch> to pin the Cookbook version for reproducibility.

Alternative Solutions

Instead of fetching from cogsol-cookbook at runtime, the framework could ship templates/examples as packaged assets.

Pros

  • Works offline.
  • Fast and deterministic (assets match the installed framework version).

Cons

  • Requires an update strategy to keep assets in sync with the Cookbook (e.g., periodic sync, release coupling, or a refresh mechanism).

The proposed solution (fetching from Cookbook) is preferred for its simplicity and for keeping the Cookbook as the source of truth.

Use Case

A user wants to start a new project using the "subagents" template. Today they must locate the folder in the Cookbook and manually copy it. With this change they can run:

cogsol startproject my-agent --from-template subagents

…and immediately get a ready-to-run workspace scaffolded locally.

Additional Context

  • Cookbook paths:

    • Templates live under templates/
    • Examples live under examples/
  • Implementation can be GitHub-specific (download directory contents) or Git-based (sparse checkout). Caching the fetched assets locally (e.g., under ~/.cache/cogsol/) would speed up repeated usage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions