### Install Awesome CLI from source or binary Source: https://context7.com/umutphp/awesome-cli/llms.txt Instructions for building the project from source code or downloading the pre-compiled binary from GitHub releases. ```bash # Build from source git clone git@github.com:umutphp/awesome-cli.git cd awesome-cli go run main.go sudo go build -o /usr/local/bin/awesome-cli . # Download binary curl -L https://github.com/umutphp/awesome-cli/releases/latest/download/awesome-cli-linux-amd64.zip -o awesome-cli.zip unzip awesome-cli.zip sudo mv awesome-cli /usr/local/bin/ ``` -------------------------------- ### Install Awesome CLI from Official Binary (Bash) Source: https://github.com/umutphp/awesome-cli/blob/master/README.md Download the official binary from the latest release page, extract it, and copy it to a directory in your system's PATH. This is a convenient way to install the latest stable version. ```bash > $ cp /path/to/zip/extract/awesome-cli /usr/local/bin/awesome-cli > $ awesome-cli ``` -------------------------------- ### Install Awesome CLI using Go (Bash) Source: https://github.com/umutphp/awesome-cli/blob/master/README.md Clone the repository and run the main Go file to execute the Awesome CLI. This is a basic method for running the tool directly from source. ```bash > $ git clone git@github.com:umutphp/awesome-cli.git > $ cd awesome-cli > $ go run main.go ``` -------------------------------- ### Sample Execution of Random Mode (Bash) Source: https://github.com/umutphp/awesome-cli/blob/master/README.md An example of running the 'random' mode, showing the CLI version and a discovered awesome repository with its URL. ```bash > $ awesome-cli random awesome-cli Version 0.2.0 ✔ Platforms ✔ Linux ✔ Applications ✔ Gedit https://wiki.gnome.org/Apps/Gedit ``` -------------------------------- ### Build Awesome CLI as a Binary (Bash) Source: https://github.com/umutphp/awesome-cli/blob/master/README.md Clone the repository, build the project using 'go build', and install the binary to a system path like /usr/local/bin. This allows you to run 'awesome-cli' from anywhere. ```bash > $ git clone git@github.com:umutphp/awesome-cli.git > $ cd awesome-cli > $ sudo go build -o /usr/local/bin/awesome-cli . > $ awesome-cli ``` -------------------------------- ### Display Awesome CLI Help (Bash) Source: https://github.com/umutphp/awesome-cli/blob/master/README.md Run the 'help' option to display all available commands and their descriptions. This includes options for interactive, random, surprise, profile, reset, and update modes. ```bash > $ awesome-cli help awesome-cli Version 0.6.0 Options of awesome-cli: help To print this screen. random To go to a random awesome content. surprise To go to a surprise awesome content according to your previos choices. profile To see your previous choices. reset To clean your choices to start from the beginning. update Update awesome-cli to the latest version. ``` -------------------------------- ### Manage Awesome list navigation with manager package Source: https://context7.com/umutphp/awesome-cli/llms.txt The manager package handles the traversal of the Awesome list tree structure. It supports initializing the root node, navigating between child nodes, and executing commands within the current context. ```go package main import ( "fmt" "github.com/umutphp/awesome-cli/internal/package/manager" ) func main() { mgr := manager.New() mgr.Initialize() root := mgr.Root fmt.Println(root.Name) pwd := mgr.GetPWD() if child := pwd.FindChildByName("Platforms"); child != nil { mgr.SetPWD(child) } mgr.GoBack() cmd := manager.Command{Text: "ls"} mgr.Execute(cmd) } ``` -------------------------------- ### Run Awesome CLI in Surprise Mode (Bash) Source: https://github.com/umutphp/awesome-cli/blob/master/README.md The 'surprise' option utilizes your previous selections from interactive mode to find a relevant random repository. This offers a personalized discovery experience. ```bash > $ awesome-cli surprise awesome-cli Version 0.3.0 ✔ Back-End Development ✔ Docker ✔ Videos ✔ From Local Docker Development to Production Deployments https://www.youtube.com/watch?v=7CZFpHUPqXw ``` -------------------------------- ### Fetch and Cache Repositories with Fetcher Package Source: https://context7.com/umutphp/awesome-cli/llms.txt The fetcher package manages HTTP interactions with GitHub, including README retrieval and local file caching with a 24-hour expiration policy. It also provides concurrent fetching capabilities with progress tracking. ```go package main import ( "fmt" "github.com/umutphp/awesome-cli/internal/package/fetcher" ) func main() { content, err := fetcher.FetchAwesomeRootRepo() if err != nil { panic(err) } fmt.Println(content) repoContent, err := fetcher.FetchAwesomeRepo("https://github.com/avelino/awesome-go") if err != nil { panic(err) } fmt.Println(repoContent) cachePath := fetcher.GetCachePath("https://github.com/example/repo") if fetcher.CacheFileExists(cachePath) && fetcher.CacheFileUptoDate(cachePath) { fmt.Println("Using cached version") } updates := make(chan fetcher.Progress) go func() { for progress := range updates { fmt.Printf("Found: %d, Crawled: %d, Errors: %d\n", progress.Found, progress.Crawled, progress.Errors) } }() result, errs := fetcher.FetchAllRepos(updates) fmt.Printf("Final: Downloaded %d / Failed %d\n", result.Crawled, result.Errors) } ``` -------------------------------- ### Run Awesome CLI Interactively (Bash) Source: https://github.com/umutphp/awesome-cli/blob/master/README.md Execute the awesome-cli command without any arguments to enter interactive mode. Use arrow keys to navigate through categories and repositories. This mode saves your choices for use in surprise mode. ```bash > $ awesome-cli Use the arrow keys to navigate: ↓ ↑ → ← ? Select from 'Awesome' list: ▸ Platforms Programming Languages Front-End Development Back-End Development Computer Science Big Data Theory Books Editors ↓ Gaming ``` -------------------------------- ### Run Awesome CLI in Random Mode (Bash) Source: https://github.com/umutphp/awesome-cli/blob/master/README.md Use the 'random' option to be directed to a random awesome repository within a random category. This provides a quick way to discover new content. ```bash > $ awesome-cli random awesome-cli Version 0.3.0 ✔ Programming Languages ✔ Eta ✔ Community ✔ IRC https://kiwiirc.com/client/irc.freenode.net/#eta-lang ``` -------------------------------- ### Handle user preferences with favourite package Source: https://context7.com/umutphp/awesome-cli/llms.txt The favourite package manages user browsing history and preferences using gob encoding. It allows for saving and loading cached categories and selecting random items for surprise mode. ```go package main import ( "fmt" "github.com/umutphp/awesome-cli/internal/package/favourite" ) func main() { favs := favourite.New("awesome") category := favourite.New("Back-End Development") subcategory := favourite.New("Docker") category.Add(subcategory) favs.Add(category) favs.SaveCache() loaded := favourite.NewFromCache("awesome") for name, cat := range loaded.GetChildren() { fmt.Printf("Category: %s\n", name) for subname := range cat.GetChildren() { fmt.Printf(" Subcategory: %s\n", subname) } } randomCategory := loaded.GetRandom() fmt.Println(randomCategory.GetName()) } ``` -------------------------------- ### Manage Tree Data Structures with Node Package Source: https://context7.com/umutphp/awesome-cli/llms.txt The node package allows for the creation and navigation of hierarchical tree structures representing Awesome lists. It supports adding children, retrieving node properties, and path navigation from child to root. ```go package main import ( "fmt" "github.com/umutphp/awesome-cli/internal/package/node" ) func main() { parent := node.New("Programming Languages", "", "") child := node.New("Go", "https://github.com/avelino/awesome-go", "Awesome Go frameworks and libraries") parent.AddChild(child) fmt.Println(parent.GetName()) fmt.Println(child.GetURL()) fmt.Println(child.GetDescription()) fmt.Println(child.GetFancyText()) children := parent.GetChildren() found := parent.FindChildByName("Go") pwd := child.GetPWD() fmt.Println(pwd) } ``` -------------------------------- ### Perform automatic updates with selfupdate package Source: https://context7.com/umutphp/awesome-cli/llms.txt The selfupdate package checks GitHub releases for newer versions of the CLI. It provides a simple interface to compare versions and apply updates automatically. ```go package main import ( "fmt" "github.com/umutphp/awesome-cli/internal/package/selfupdate" ) func main() { currentVersion := "0.7.6" if err := selfupdate.Update(currentVersion); err != nil { fmt.Printf("Update failed: %s\n", err) return } } ``` -------------------------------- ### Parse Markdown READMEs with Parser Package Source: https://context7.com/umutphp/awesome-cli/llms.txt The parser package extracts categories and links from markdown-formatted README files to populate the node tree structure. It provides methods for parsing full documents, individual content lines, and formatting headers. ```go package main import ( "fmt" "github.com/umutphp/awesome-cli/internal/package/parser" ) func main() { readme := `# Awesome List ## Platforms - [Linux](https://github.com/inputsh/awesome-linux) - Awesome Linux projects. - [Windows](https://github.com/Awesome-Windows/Awesome) - Windows software. ## Programming Languages - [Go](https://github.com/avelino/awesome-go) - Frameworks and libraries. - [Python](https://github.com/vinta/awesome-python) - Python resources. ` root := parser.ParseIndex(readme) for _, category := range root.GetChildren() { fmt.Printf("Category: %s\n", category.GetName()) for _, item := range category.GetChildren() { fmt.Printf(" - %s: %s\n", item.GetName(), item.GetURL()) } } name, url, desc, _ := parser.ParseContentFromLine("- [Example](https://example.com) - Description.") fmt.Println(name) fmt.Println(url) fmt.Println(desc) title := parser.LineToTitle("## My Category") fmt.Println(title) } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.