Documentation
¶
Index ¶
- func AddResourcesToViteProject(cmd *cobra.Command, projectDir string, resources []api.ResourceItem, ...) error
- func GenerateResourcesFile(targetDir string) (string, int, error)
- func GetApplicationID() (string, error)
- func GetApplicationIDFromDir(dir string) (string, string, error)
- func GetApplicationInfo(dir string) (*api.GetApplicationByRepoResponse, error)
- func NoArgs(cmd *cobra.Command, args []string) error
- func OpenBrowser(url string) error
- func SelectApplicationResources(cmd *cobra.Command, apiClient *api.Client, orgID, appID string) ([]api.ResourceItem, error)
- type LocalResource
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
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
GetApplicationID retrieves the application ID for the current git repository
func GetApplicationIDFromDir ¶ added in v0.2.4
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
NoArgs returns an error with suggestions if any args are included. This is like cobra.NoArgs but includes command suggestions for typos.
func OpenBrowser ¶
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