utils

package
v0.2.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddResourcesToViteProject added in v0.2.4

func AddResourcesToViteProject(cmd *cobra.Command, projectDir string, resources []api.ResourceItem, applicationID string) error

AddResourcesToViteProject adds selected resources to a Vite project using pnpm clients:add It handles differential updates: removes resources that are no longer selected and adds new ones

func GenerateResourcesFile added in v0.2.4

func GenerateResourcesFile(targetDir string) (string, int, error)

GenerateResourcesFile generates a RESOURCES.md file for the application in the specified directory. If targetDir is empty, it uses the current git repository root. Returns the path to the generated file and the number of resources written.

func GetApplicationID added in v0.2.4

func GetApplicationID() (string, error)

GetApplicationID retrieves the application ID for the current git repository

func GetApplicationIDFromDir added in v0.2.4

func GetApplicationIDFromDir(dir string) (string, string, error)

GetApplicationIDFromDir retrieves the application ID and organization ID for a git repository in the specified directory. If dir is empty, it uses the current directory. Deprecated: Use GetApplicationInfo instead

func GetApplicationInfo added in v0.2.4

func GetApplicationInfo(dir string) (*api.GetApplicationByRepoResponse, error)

GetApplicationInfo retrieves full application information for a git repository in the specified directory. If dir is empty, it uses the current directory.

func NoArgs added in v0.1.11

func NoArgs(cmd *cobra.Command, args []string) error

NoArgs returns an error with suggestions if any args are included. This is like cobra.NoArgs but includes command suggestions for typos.

func OpenBrowser

func OpenBrowser(url string) error

OpenBrowser opens the specified URL in the default browser

func SelectApplicationResources added in v0.2.4

func SelectApplicationResources(cmd *cobra.Command, apiClient *api.Client, orgID, appID string) ([]api.ResourceItem, error)

SelectApplicationResources prompts the user to select resources for the application Returns the selected resources with their full details

Types

type LocalResource added in v0.2.4

type LocalResource struct {
	ID            string `json:"id"`
	Name          string `json:"name"`
	Type          string `json:"type"`
	Description   string `json:"description"`
	ApplicationID string `json:"applicationId"`
}

LocalResource represents a resource stored in resources.json

func ReadLocalResources added in v0.2.4

func ReadLocalResources(projectDir string) ([]LocalResource, error)

ReadLocalResources reads the resources.json file from the project directory

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL