-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
To improve the onboarding experience for same, we need to provide a set of CLI commands that automate the creation of configuration files. Currently, users must manually create same.yaml or same.work.yaml.
This feature will introduce:
same init: For initializing individual projects.same work init: For initializing a new monorepo workspace.same work add: For registering projects into an existing workspace.
The implementation must strictly adhere to the project's Clean Architecture rules, ensuring logic remains in the Core Domain while filesystem operations are handled by Adapters.
Goals
- Provide a guided setup for new users.
- Enable automatic discovery of workspaces during project initialization.
- Ensure all configuration generated is deterministic and adheres to the latest schema version ("1").
- Maintain architectural integrity by separating template logic from I/O.
Functional Requirements
same init
- Standalone Mode: If no workspace is detected, create a
same.yamlwith sample tasks (build, test). - Workspace Mode: If a
same.work.yamlis found in parent directories, require a--projectname flag to ensure proper namespacing. - Auto-Registration: If run within a workspace, automatically append the project path to the
projectslist insame.work.yamlif missing.
same work Subcommands
init: Create asame.work.yamlin the current directory with default globs likepackages/*.add <path>: Resolve the relative path from the workspace root and add it to theprojectsarray in the workspace config.
Acceptance Criteria
Architectural Constraints
- Logic for YAML templates and validation must reside in
internal/core/domain. - Filesystem writing must be implemented as an adapter in
internal/adapters/fs. - CLI subcommands must be added to
cli/cmd/same/commands/.
Behavior & Verification
- Command fails with a structured error if the target file (
same.yamlorsame.work.yaml) already exists. - All generated files must pass a validation check by the existing
ConfigLoader. - Verification commands succeed:
nix develop -c gofumpt -w ./clinix develop -c golangci-lint run ./cli/...nix develop -c go test -race ./cli/....
Documentation
- Update
docs/configuration/same-yaml.mdxanddocs/configuration/workspaces.mdxto reflect the new initialization workflow. - Add CLI reference documentation for
initandworkcommands indocs/cli/.
Metadata
Metadata
Assignees
Labels
No labels