Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions cliv2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
github.com/mattn/go-isatty v0.0.20
github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.34.0
github.com/snyk-playground/cli-extension-axi v0.0.0-20260625161408-6f13b7a941b0
github.com/snyk/cli-extension-agent-scan v0.0.0-20260505093105-90d9442ea939
github.com/snyk/cli-extension-ai-bom v0.0.0-20260319140413-ac7392950603
github.com/snyk/cli-extension-ai-redteam v0.0.0-20260331152502-ce341aeaff9e
Expand Down Expand Up @@ -178,6 +179,7 @@ require (
github.com/lucasb-eyer/go-colorful v1.3.0 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mark3labs/mcp-go v0.31.0 // indirect
github.com/mattdolan-snyk/axi-sdk-go v0.0.0-20260624052311-475083281cb3 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.20 // indirect
Expand Down Expand Up @@ -229,6 +231,7 @@ require (
github.com/tchap/go-patricia/v2 v2.3.1 // indirect
github.com/tklauser/go-sysconf v0.3.14 // indirect
github.com/tklauser/numcpus v0.8.0 // indirect
github.com/toon-format/toon-go v0.0.0-20251202084852-7ca0e27c4e8c // indirect
github.com/ulikunitz/xz v0.5.15 // indirect
github.com/vincent-petithory/dataurl v1.0.0 // indirect
github.com/writeas/go-strip-markdown v2.0.1+incompatible // indirect
Expand Down
6 changes: 6 additions & 0 deletions cliv2/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ github.com/mark3labs/mcp-go v0.31.0 h1:4UxSV8aM770OPmTvaVe/b1rA2oZAjBMhGBfUgOGut
github.com/mark3labs/mcp-go v0.31.0/go.mod h1:rXqOudj/djTORU/ThxYx8fqEVj/5pvTuuebQ2RC7uk4=
github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo=
github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg=
github.com/mattdolan-snyk/axi-sdk-go v0.0.0-20260624052311-475083281cb3 h1:4hjDjUe8mxUPwvpXpd4VrrR2ewrvoE1VnLhnNBAw5LA=
github.com/mattdolan-snyk/axi-sdk-go v0.0.0-20260624052311-475083281cb3/go.mod h1:PAGxDYllJTF1m+RemOPn6WLGf9WrCUlP0M8tSOaiNAQ=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
Expand Down Expand Up @@ -539,6 +541,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/skeema/knownhosts v1.3.2 h1:EDL9mgf4NzwMXCTfaxSD/o/a5fxDw/xL9nkU28JjdBg=
github.com/skeema/knownhosts v1.3.2/go.mod h1:bEg3iQAuw+jyiw+484wwFJoKSLwcfd7fqRy+N0QTiow=
github.com/snyk-playground/cli-extension-axi v0.0.0-20260625161408-6f13b7a941b0 h1:HXymdUISQYO8jdx2VfyisDKMvwSR0ujzpo/L6tQ1t2A=
github.com/snyk-playground/cli-extension-axi v0.0.0-20260625161408-6f13b7a941b0/go.mod h1:wRi0pApLCFhXXdxQv8/2VPhg/emxmjvuUo83iGbt96A=
github.com/snyk/cli-extension-agent-scan v0.0.0-20260505093105-90d9442ea939 h1:GvW35inJZTr2AD1c/sIRkVOajom0kEY8nN30cqes+u0=
github.com/snyk/cli-extension-agent-scan v0.0.0-20260505093105-90d9442ea939/go.mod h1:+Znlgu2v7sOTNAVjsoldFjDZUIo8tpdKnFlMptZHzz0=
github.com/snyk/cli-extension-ai-bom v0.0.0-20260319140413-ac7392950603 h1:uZyw9OvOGCMFloZy8Fyu6l4K5y77o4k0KdxHuUKAp8M=
Expand Down Expand Up @@ -629,6 +633,8 @@ github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZ
github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY=
github.com/tklauser/numcpus v0.8.0 h1:Mx4Wwe/FjZLeQsK/6kt2EOepwwSl7SmJrK5bV/dXYgY=
github.com/tklauser/numcpus v0.8.0/go.mod h1:ZJZlAY+dmR4eut8epnzf0u/VwodKmryxR8txiloSqBE=
github.com/toon-format/toon-go v0.0.0-20251202084852-7ca0e27c4e8c h1:D8lDFovBMZywze1eh9iwMLcYor5f11mHBocLhO7cBe8=
github.com/toon-format/toon-go v0.0.0-20251202084852-7ca0e27c4e8c/go.mod h1:j/BOnpF2ihnz4lELs99h9mwGJBx/zdleOUCnLLRPCsc=
github.com/ulikunitz/xz v0.5.15 h1:9DNdB5s+SgV3bQ2ApL10xRc35ck0DuIX/isZvIk+ubY=
github.com/ulikunitz/xz v0.5.15/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/vincent-petithory/dataurl v1.0.0 h1:cXw+kPto8NLuJtlMsI152irrVw9fRDX8AbShPRpg2CI=
Expand Down
13 changes: 12 additions & 1 deletion cliv2/pkg/core/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/pflag"

"github.com/snyk-playground/cli-extension-axi/pkg/agent"

"github.com/snyk/go-application-framework/pkg/ui/consoleui"

"github.com/snyk/go-application-framework/pkg/analytics"
Expand All @@ -37,8 +39,8 @@ import (
"github.com/snyk/cli/cliv2/internal/cliv2"
"github.com/snyk/cli/cliv2/internal/constants"

cliv2utils "github.com/snyk/cli/cliv2/internal/utils"
persona "github.com/snyk/cli/cliv2/internal/persona"
cliv2utils "github.com/snyk/cli/cliv2/internal/utils"

localworkflows "github.com/snyk/go-application-framework/pkg/local_workflows"
"github.com/snyk/go-application-framework/pkg/local_workflows/config_utils"
Expand Down Expand Up @@ -377,6 +379,15 @@ func createCommandsForWorkflows(rootCommand *cobra.Command, engine workflow.Engi
case "fix":
// to preserve backwards compatibility we will need to relax flag validation
parentCommand.FParseErrWhitelist.UnknownFlags = true
case "agent":
// AXI: the `snyk agent` command surface is agent-ergonomic and owns its
// own help. Replace cobra's default help with the extension's renderer for
// the whole agent subtree (children inherit this help func). The engine is
// passed so the extension can introspect each scanner's underlying workflow
// flags for per-command help — without hardcoding other extensions' flags.
parentCommand.SetHelpFunc(func(cmd *cobra.Command, _ []string) {
agent.RenderHelp(cmd.OutOrStdout(), engine, os.Args[1:])
})
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions cliv2/pkg/core/workflows.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package core

import (
"github.com/snyk-playground/cli-extension-axi/pkg/agent"
"github.com/snyk/cli-extension-agent-scan/pkg/agentscan"
"github.com/snyk/cli-extension-ai-bom/pkg/aibom"
"github.com/snyk/cli-extension-ai-redteam/pkg/redteam"
Expand Down Expand Up @@ -41,6 +42,7 @@ func initExtensions(engine workflow.Engine, config configuration.Configuration,
engine.AddExtensionInitializer(ignore_workflow.InitIgnoreWorkflows)
engine.AddExtensionInitializer(agentscan.Init)
engine.AddExtensionInitializer(secrets.Init)
engine.AddExtensionInitializer(agent.Init)

// Register additional extensions injected via Run(WithAdditionalExtensions(...))
for _, ext := range additionalExts {
Expand Down