Skip to content
Merged
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
7 changes: 0 additions & 7 deletions docs/general/ai/help.go

This file was deleted.

226 changes: 0 additions & 226 deletions general/ai/cli.go

This file was deleted.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ require (
github.com/jfrog/jfrog-cli-security v1.29.0
github.com/jfrog/jfrog-client-go v1.55.1-0.20260508101905-a17af78a38d7
github.com/jszwec/csvutil v1.10.0
github.com/manifoldco/promptui v0.9.0
github.com/spf13/viper v1.21.0
github.com/stretchr/testify v1.11.1
github.com/testcontainers/testcontainers-go v0.40.0
Expand Down Expand Up @@ -144,6 +143,7 @@ require (
github.com/ktrysmt/go-bitbucket v0.9.88 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.10 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.21 // indirect
Expand Down
9 changes: 0 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"strings"

statsDocs "github.com/jfrog/jfrog-cli/docs/general/stats"
"github.com/jfrog/jfrog-cli/general/ai"
services "github.com/jfrog/jfrog-cli/stats"

"github.com/agnivade/levenshtein"
Expand All @@ -29,7 +28,6 @@ import (
"github.com/jfrog/jfrog-cli/completion"
"github.com/jfrog/jfrog-cli/config"
"github.com/jfrog/jfrog-cli/docs/common"
aiDocs "github.com/jfrog/jfrog-cli/docs/general/ai"
apiDocs "github.com/jfrog/jfrog-cli/docs/general/api"
loginDocs "github.com/jfrog/jfrog-cli/docs/general/login"
oidcDocs "github.com/jfrog/jfrog-cli/docs/general/oidc"
Expand Down Expand Up @@ -303,13 +301,6 @@ func getCommands() ([]cli.Command, error) {
Category: otherCategory,
Action: login.LoginCmd,
},
{
Name: "how",
Usage: aiDocs.GetDescription(),
HelpName: corecommon.CreateUsage("how", aiDocs.GetDescription(), aiDocs.Usage),
BashComplete: corecommon.CreateBashCompletionFunc(),
Action: ai.HowCmd,
},
{
Name: "access-token-create",
Aliases: []string{"atc"},
Expand Down
28 changes: 0 additions & 28 deletions utils/cliutils/persistence.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const persistenceFileName = "persistence.json"
// PersistenceFile holds various indicators that need to be persisted between CLI runs
type PersistenceFile struct {
LatestCliVersionCheckTime *int64 `json:"latestCliVersionCheckTime,omitempty"`
LatestAiTermsRevision *int `json:"latestAiTermsRevision,omitempty"`
}

var (
Expand Down Expand Up @@ -63,33 +62,6 @@ func getLatestCliVersionCheckTime() (*int64, error) {
return info.LatestCliVersionCheckTime, nil
}

// SetLatestAiTermsRevision updates the AI terms version in the persistence file
func SetLatestAiTermsRevision(version int) error {
fileLock.Lock()
defer fileLock.Unlock()

info, err := getPersistenceInfo()
if err != nil {
return err
}

info.LatestAiTermsRevision = &version
return setPersistenceInfo(info)
}

// GetLatestAiTermsRevision retrieves the AI terms version from the persistence file
func GetLatestAiTermsRevision() (*int, error) {
fileLock.Lock()
defer fileLock.Unlock()

info, err := getPersistenceInfo()
if err != nil {
return nil, err
}

return info.LatestAiTermsRevision, nil
}

// getPersistenceInfo reads the persistence file, creates it if it doesn't exist, and returns the persisted info
func getPersistenceInfo() (*PersistenceFile, error) {
if err := getPersistenceFilePath(); err != nil {
Expand Down
18 changes: 0 additions & 18 deletions utils/cliutils/persistence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,6 @@ func TestSetAndGetLatestVersionCheckTime(t *testing.T) {
assert.Equal(t, timestamp, *storedTimestamp, "Stored timestamp does not match the set timestamp")
}

// TestSetAndGetAiTermsVersion tests setting and getting the LatestAiTermsRevision
func TestSetAndGetAiTermsVersion(t *testing.T) {
// Setup temporary directory
persistenceFilePath = filepath.Join(t.TempDir(), persistenceFileName)

// Set the AI terms version
version := 42
err := SetLatestAiTermsRevision(version)
assert.NoError(t, err, "Failed to set LatestAiTermsRevision")

// Get the AI terms version
storedVersion, err := GetLatestAiTermsRevision()
assert.NoError(t, err, "Failed to get LatestAiTermsRevision")

// Assert equality
assert.Equal(t, version, *storedVersion, "Stored AI terms version does not match the set version")
}

// TestPersistenceFileCreation tests if the persistence file is created when it doesn't exist
func TestPersistenceFileCreation(t *testing.T) {
// Setup temporary directory
Expand Down
Loading