### Install Micro CLI with Go Source: https://github.com/micro-so/micro-cli/blob/main/README.md Installs the Micro CLI using the Go toolchain. Requires Go version 1.22 or later. ```sh go install 'github.com/micro-so/micro-cli/cmd/micro@latest' ``` -------------------------------- ### Micro CLI Basic Usage Example Source: https://github.com/micro-so/micro-cli/blob/main/README.md Demonstrates the basic command structure for the Micro CLI, querying deals with specified API key, team ID, and a GraphQL-like query. ```sh micro prism:objects:deals query \ --api-key 'My API Key' \ --team-id 'My Team ID' \ --team-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \ --query '{select: [id, name]}' ``` -------------------------------- ### Escape '@' for Literal Strings Source: https://github.com/micro-so/micro-cli/blob/main/README.md Demonstrates how to pass a string literal that starts with an '@' symbol by escaping it. This prevents the CLI from interpreting it as a file reference. ```bash micro --username '\@abe' ``` -------------------------------- ### Add Go Bin Directory to PATH Source: https://github.com/micro-so/micro-cli/blob/main/README.md Appends the Go binary directory to your system's PATH environment variable. This is necessary if CLI commands are not found after installation. Add this to your shell profile (.zshrc, .bashrc, etc.). ```sh # Add to your shell profile (.zshrc, .bashrc, etc.) export PATH="$PATH:$(go env GOPATH)/bin" ``` -------------------------------- ### Link Micro Go SDK to Local Copy Source: https://github.com/micro-so/micro-cli/blob/main/README.md Links the CLI against a local copy of the Micro Go SDK. Provide the relative or absolute path to the local SDK repository. ```bash ./scripts/link ../path/to/micro-go ``` -------------------------------- ### Link Micro Go SDK with Default Path Source: https://github.com/micro-so/micro-cli/blob/main/README.md Links the CLI against the default local Micro Go SDK path ('../micro-go') by running the link script without arguments. ```bash ./scripts/link ``` -------------------------------- ### Pass Files Using @ Syntax Source: https://github.com/micro-so/micro-cli/blob/main/README.md Shows how to pass files as arguments to the CLI using the '@' syntax. The file content will be read and passed to the specified argument. ```bash micro --arg @abe.jpg ``` -------------------------------- ### Run Micro CLI Locally Source: https://github.com/micro-so/micro-cli/blob/main/README.md Executes the Micro CLI tool locally after cloning the project repository. Replace 'args...' with the desired command-line arguments. ```sh ./scripts/run args... ``` -------------------------------- ### Link Micro Go SDK to Specific Version Source: https://github.com/micro-so/micro-cli/blob/main/README.md Links the CLI against a different version of the Micro Go SDK for development. Specify the repository and version (branch, tag, or commit hash). ```bash ./scripts/link github.com/org/repo@version ``` -------------------------------- ### Explicit File Encoding with @file and @data Source: https://github.com/micro-so/micro-cli/blob/main/README.md Shows how to explicitly control file encoding. Use '@file://' for plain text and '@data://' for base64 encoding. Absolute paths require an additional '/' after the scheme. ```bash micro --arg @data://file.txt ``` -------------------------------- ### Pass Files within JSON/YAML Blobs Source: https://github.com/micro-so/micro-cli/blob/main/README.md Illustrates passing file references within JSON or YAML structures. The '@' syntax is used to denote a file to be read. ```bash micro --arg '{image: "@abe.jpg"}' ``` ```bash # Equivalent: micro <