Documentation
¶
Index ¶
- func AddResourcesToProject(cmd *cobra.Command, projectDir string, resources []api.ResourceItem, ...) error
- func CanUseSSH() bool
- func CheckRepositoryAccess(sshURL, httpsURL string) bool
- func EnsureRepositoryAccess(cmd *cobra.Command, appID string, sshURL string, httpsURL string) error
- func ExtractGitHubURL(cloneURL string) (string, 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 AddResourcesToProject ¶ added in v0.2.19
func AddResourcesToProject(cmd *cobra.Command, projectDir string, resources []api.ResourceItem, applicationID string, framework constants.TemplateName) 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 CanUseSSH ¶ added in v0.2.27
func CanUseSSH() bool
CanUseSSH checks if SSH is available and configured for git
func CheckRepositoryAccess ¶ added in v0.2.27
CheckRepositoryAccess attempts to check if a repository is accessible via git ls-remote Returns true if accessible, false otherwise
func EnsureRepositoryAccess ¶ added in v0.2.27
EnsureRepositoryAccess ensures the user has access to the repository by inviting them as a collaborator This function prompts for GitHub username, sends an invite, and waits for access to be granted
func ExtractGitHubURL ¶ added in v0.2.27
ExtractGitHubURL extracts the GitHub repository URL from SSH or HTTPS clone URL Returns format: https://github.com/<owner>/<repo>
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