### Build surf CLI from source Source: https://github.com/asksurf-ai/surf-cli/blob/main/README.md Builds and installs the surf CLI from source using Go. ```sh go install github.com/asksurf-ai/surf-cli/cmd/surf@latest ``` -------------------------------- ### Install staging surf CLI Source: https://github.com/asksurf-ai/surf-cli/blob/main/README.md Installs the surf CLI from the staging installer for testing against the staging CDN and API. Do not run 'surf install' afterwards as it overwrites the staging binary with the production one. ```sh curl -fsSL https://downloads-stg.asksurf.ai/cli/releases/install.sh | sh ``` -------------------------------- ### Install surf CLI Source: https://github.com/asksurf-ai/surf-cli/blob/main/README.md Installs the surf CLI to ~/.local/bin without requiring sudo. ```sh curl -fsSL https://downloads.asksurf.ai/cli/releases/install.sh | sh ``` -------------------------------- ### Local development setup for surf CLI Source: https://github.com/asksurf-ai/surf-cli/blob/main/README.md Builds the surf binary and symlinks it into ~/.local/bin/surf so the surf command in PATH resolves to the local build. Then confirms the local build with surf version and surf help. ```sh go build -o bin/surf ./cmd/surf ln -sf "$(pwd)/bin/surf" ~/.local/bin/surf surf version # confirm you're on the local build surf help ``` -------------------------------- ### Install specific surf CLI version Source: https://github.com/asksurf-ai/surf-cli/blob/main/README.md Installs a specific version of the surf CLI by passing the version as an argument to the installer script. ```sh curl -fsSL https://downloads.asksurf.ai/cli/releases/install.sh | sh -s v0.1.3 ``` -------------------------------- ### Basic surf CLI usage Source: https://github.com/asksurf-ai/surf-cli/blob/main/README.md Basic usage examples for the surf CLI: saving an API key, querying market data, syncing commands, showing version and auth status, and clearing the saved key. ```sh # Save your API key surf auth --api-key sk-xxx # Query market data surf market-futures --symbol BTC surf search-project --q bitcoin # Update available commands from latest API spec surf sync # Show version surf version # Show auth status surf auth # Clear saved API key surf auth --clear ``` -------------------------------- ### Release surf CLI with GoReleaser Source: https://github.com/asksurf-ai/surf-cli/blob/main/README.md Releases the surf CLI using GoReleaser: tags a version and runs the release command, which builds binaries for Linux, macOS, and Windows (amd64/arm64) and uploads them to the configured release bucket. ```sh git tag v0.x.x goreleaser release --clean ``` -------------------------------- ### surf auth commands Source: https://github.com/asksurf-ai/surf-cli/blob/main/README.md Authentication commands for the surf CLI: saving an API key (prefers keychain, falls back to file), showing the current key source and masked value, and clearing the key from both keychain and file. ```sh surf auth --api-key sk-xxx # Save (prefers keychain, falls back to file) surf auth # Show current key source and masked value surf auth --clear # Clear from both keychain and file ```