Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
bf8aba7
feat(artifacts): add composition root, lock delegation, and record-di…
osterman Oct 31, 2026
d4a6808
feat(artifacts): add atmos artifacts commands and documentation (A07)
osterman Oct 31, 2026
5bf4f61
fix(artifacts): refresh help snapshots, add screengrab casts, and lan…
osterman Nov 9, 2026
e825019
fix(artifacts): record the artifacts screengrab casts with the progra…
osterman Nov 9, 2026
7e8a377
fix(artifacts): rerecord command help casts
osterman Nov 11, 2026
0c4523b
fix(artifacts): address review findings
osterman Nov 11, 2026
9cf38ba
fix(artifacts): clarify OCI identity injection
osterman Nov 11, 2026
e40a12e
test(artifacts): align tests with subject locking
osterman Nov 11, 2026
dfdc74c
fix(artifacts): test Windows pull replacement safety
osterman Nov 12, 2026
78b4ec4
refactor(artifact): name the reserved distribution directory
osterman Nov 12, 2026
7990049
fix(artifacts): accept delegated local locks for the same reference
osterman Nov 13, 2026
c155f7e
docs(artifacts): document the unchanged pull outcome
osterman Nov 13, 2026
1af62db
docs(artifacts): limit structured-error guarantee to operation failures
osterman Nov 14, 2026
9aabc39
fix(artifact/local): take the target lock for delegate-local lock han…
osterman Nov 14, 2026
2129cff
docs(artifacts): state when verify failures include verification
osterman Nov 14, 2026
5a05597
fix(artifact): compare physical lock files before reusing a handle ac…
osterman Nov 14, 2026
5e39b20
fix(artifacts): preserve historical merge resolutions after signed re…
osterman Nov 17, 2026
155bae7
fix(asciicast): honor caller deadline during session teardown
osterman Nov 17, 2026
4c31f07
fix(asciicast): preserve cancellation on session completion
osterman Nov 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions cmd/artifacts/artifacts.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
// Package artifacts implements the `atmos artifacts` command space: publish, pull, copy, inspect,
// list, search, delete, sign, verify, and show.
//
// The commands are thin wiring. They parse flags with the standard flag parser, build the artifact
// service through the composition root in pkg/artifact/compose, call one service method, and render
// the typed result. Packaging, repository access, signatures, locks, and conflict policy all live in
// the artifact service and its repositories, so the commands, workflow steps, and hooks share one
// implementation.
package artifacts

import (
"github.com/spf13/cobra"

"github.com/cloudposse/atmos/cmd/internal"
"github.com/cloudposse/atmos/cmd/markdown"
"github.com/cloudposse/atmos/pkg/flags"
"github.com/cloudposse/atmos/pkg/flags/compat"
"github.com/cloudposse/atmos/pkg/perf"
"github.com/cloudposse/atmos/pkg/schema"
)

// docsBase is the documentation route of the command space.
const docsBase = "https://atmos.tools/cli/commands/artifacts/"

// atmosConfigPtr holds the Atmos configuration injected by root.go before any subcommand runs.
var atmosConfigPtr *schema.AtmosConfiguration

// SetAtmosConfig is called from root.go after the configuration is initialized.
func SetAtmosConfig(config *schema.AtmosConfiguration) {
atmosConfigPtr = config
}

// artifactsCmd is the `atmos artifacts` parent command.
var artifactsCmd = NewCommand()

// NewCommand builds the `atmos artifacts` command tree with fresh flag parsers. The registered
// command is built once at package initialization; tests build their own to start from default flags.
func NewCommand() *cobra.Command {
command := &cobra.Command{
Use: "artifacts",
Short: "Publish, pull, copy, inspect, sign, and verify versioned artifacts across repositories",
Long: `Publish files and directories as named, versioned artifacts in local, S3, and OCI repositories, then
pull, copy, inspect, list, search, sign, and verify them with one command space. Repositories are
configured under artifacts.repositories in atmos.yaml and addressed by alias; no command picks a
default repository or an implicit latest version.`,
Example: markdown.ArtifactsUsageMarkdown,
}
command.AddCommand(
newPublishCommand(),
newPullCommand(),
newCopyCommand(),
newInspectCommand(),
newListCommand(),
newSearchCommand(),
newDeleteCommand(),
newSignCommand(),
newVerifyCommand(),
newShowCommand(),
)
registerDocumentation(command, "")
return command
}

// documentationPages maps a command path to its page below the artifacts docs route.
var documentationPages = map[string]string{
"": "usage",
"publish": "publish",
"pull": "pull",
"copy": "copy",
"inspect": "inspect",
"list": "list",
"search": "search",
"delete": "delete",
"sign": "sign",
"verify": "verify",
"show": "show",
"show readme": "show",
"show changelog": "show",
}

// registerDocumentation links every command to its documentation page.
func registerDocumentation(command *cobra.Command, path string) {
if page, exists := documentationPages[path]; exists {
internal.RegisterCommandMetadata(command, internal.WithDocumentationURL(docsBase+page))
}
for _, child := range command.Commands() {
next := child.Name()
if path != "" {
next = path + " " + child.Name()
}
registerDocumentation(child, next)
}
}

func init() {
defer perf.Track(nil, "artifacts.init")()

internal.Register(&CommandProvider{})
}

// CommandProvider registers the artifacts commands with the standard command registry.
type CommandProvider struct{}

// GetCommand returns the artifacts parent command with every subcommand attached.
func (*CommandProvider) GetCommand() *cobra.Command { return artifactsCmd }

// GetName returns the command name.
func (*CommandProvider) GetName() string { return "artifacts" }

// GetGroup returns the command group for help organization.
func (*CommandProvider) GetGroup() string { return "Other Commands" }

// GetFlagsBuilder returns nil: the subcommands own their flags.
func (*CommandProvider) GetFlagsBuilder() flags.Builder { return nil }

// GetPositionalArgsBuilder returns nil: the parent command takes no positional arguments.
func (*CommandProvider) GetPositionalArgsBuilder() *flags.PositionalArgsBuilder { return nil }

// GetCompatibilityFlags returns nil: the commands use native Cobra flags only.
func (*CommandProvider) GetCompatibilityFlags() map[string]compat.CompatibilityFlag { return nil }

// GetAliases returns nil: the commands have no aliases.
func (*CommandProvider) GetAliases() []internal.CommandAlias { return nil }

// IsExperimental reports that the artifacts commands are experimental in V1.
func (*CommandProvider) IsExperimental() bool { return true }
Loading
Loading