diff --git a/README.md b/README.md index ed8dc95..9530815 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ These tools are essential for a capable openclaw instance - screen capture, came |------|--------------| | [**summarize**](https://github.com/steipete/summarize) | Link → clean text → summary | | [**gogcli**](https://github.com/steipete/gogcli) | Google CLI for Gmail, Calendar, Drive, and Contacts | +| [**goplaces**](https://github.com/steipete/goplaces) | Google Places API (New) CLI | | [**camsnap**](https://github.com/steipete/camsnap) | Capture snapshots/clips from RTSP/ONVIF cameras | | [**sonoscli**](https://github.com/steipete/sonoscli) | Control Sonos speakers | | [**bird**](https://github.com/steipete/bird) | Fast X CLI for tweeting, replying, and reading | diff --git a/cmd/update-tools/main.go b/cmd/update-tools/main.go index ebaa108..8ff5c10 100644 --- a/cmd/update-tools/main.go +++ b/cmd/update-tools/main.go @@ -227,6 +227,16 @@ func main() { }, NixFile: filepath.Join(repoRoot, "nix", "pkgs", "gogcli.nix"), }, + { + Name: "goplaces", + Repo: "steipete/goplaces", + Assets: []AssetSpec{ + {System: "aarch64-darwin", Regex: regexp.MustCompile(`goplaces_[0-9.]+_darwin_arm64\.tar\.gz`)}, + {System: "x86_64-linux", Regex: regexp.MustCompile(`goplaces_[0-9.]+_linux_amd64\.tar\.gz`)}, + {System: "aarch64-linux", Regex: regexp.MustCompile(`goplaces_[0-9.]+_linux_arm64\.tar\.gz`)}, + }, + NixFile: filepath.Join(repoRoot, "nix", "pkgs", "goplaces.nix"), + }, { Name: "camsnap", Repo: "steipete/camsnap", diff --git a/flake.nix b/flake.nix index 007bf15..6765d33 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,7 @@ packageSystems = { summarize = [ "aarch64-darwin" "x86_64-linux" "aarch64-linux" ]; gogcli = [ "aarch64-darwin" "x86_64-linux" "aarch64-linux" ]; + goplaces = [ "aarch64-darwin" "x86_64-linux" "aarch64-linux" ]; camsnap = [ "aarch64-darwin" "x86_64-linux" "aarch64-linux" ]; sonoscli = [ "aarch64-darwin" "x86_64-linux" "aarch64-linux" ]; bird = [ "aarch64-darwin" ]; @@ -38,6 +39,9 @@ // (lib.optionalAttrs (supports "gogcli") { gogcli = pkgs.callPackage ./nix/pkgs/gogcli.nix {}; }) + // (lib.optionalAttrs (supports "goplaces") { + goplaces = pkgs.callPackage ./nix/pkgs/goplaces.nix {}; + }) // (lib.optionalAttrs (supports "camsnap") { camsnap = pkgs.callPackage ./nix/pkgs/camsnap.nix {}; }) diff --git a/nix/pkgs/goplaces.nix b/nix/pkgs/goplaces.nix new file mode 100644 index 0000000..7fb2954 --- /dev/null +++ b/nix/pkgs/goplaces.nix @@ -0,0 +1,47 @@ +{ lib, stdenv, fetchurl }: + +let + sources = { + "aarch64-darwin" = { + url = "https://github.com/steipete/goplaces/releases/download/v0.2.1/goplaces_0.2.1_darwin_arm64.tar.gz"; + hash = "sha256-haImHN6IS2eAMPd6YusOFreSuRc4e0uxpwrYTJkxle8="; + }; + "x86_64-linux" = { + url = "https://github.com/steipete/goplaces/releases/download/v0.2.1/goplaces_0.2.1_linux_amd64.tar.gz"; + hash = "sha256-oDsFtk+M/NOC3CLCgVpVws15VfY7NQdUMUZgdzTqwW0="; + }; + "aarch64-linux" = { + url = "https://github.com/steipete/goplaces/releases/download/v0.2.1/goplaces_0.2.1_linux_arm64.tar.gz"; + hash = "sha256-3PzBz0/DjOmD86yjQRW9Ak/J50/+NDLpjoByEuatmEU="; + }; + }; +in +stdenv.mkDerivation { + pname = "goplaces"; + version = "0.2.1"; + + src = fetchurl sources.${stdenv.hostPlatform.system}; + + dontConfigure = true; + dontBuild = true; + + unpackPhase = '' + tar -xzf "$src" + ''; + + installPhase = '' + runHook preInstall + mkdir -p "$out/bin" + cp $(find . -type f -name goplaces | head -1) "$out/bin/goplaces" + chmod 0755 "$out/bin/goplaces" + runHook postInstall + ''; + + meta = with lib; { + description = "Modern Go client + CLI for the Google Places API"; + homepage = "https://github.com/steipete/goplaces"; + license = licenses.mit; + platforms = builtins.attrNames sources; + mainProgram = "goplaces"; + }; +} diff --git a/tools/goplaces/flake.nix b/tools/goplaces/flake.nix new file mode 100644 index 0000000..0dabe77 --- /dev/null +++ b/tools/goplaces/flake.nix @@ -0,0 +1,38 @@ +{ + description = "openclaw plugin: goplaces"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs?rev=16c7794d0a28b5a37904d55bcca36003b9109aaa&narHash=sha256-fFUnEYMla8b7UKjijLnMe%2BoVFOz6HjijGGNS1l7dYaQ%3D"; + root.url = "github:openclaw/nix-steipete-tools?rev=dbf0a31a57407d9140e32357ea8d0215bd9feed9&narHash=sha256-QkPl/Rgk9DXgaVNhjvHHHjy5e81j+MzcVOouZRdUTLA="; + }; + + outputs = { self, nixpkgs, root }: + let + lib = nixpkgs.lib; + systems = builtins.attrNames root.packages; + pluginFor = system: + let + packagesForSystem = root.packages.${system} or {}; + goplaces = packagesForSystem.goplaces or null; + in + if goplaces == null then null else { + name = "goplaces"; + skills = [ ./skills/goplaces ]; + packages = [ goplaces ]; + needs = { + stateDirs = []; + requiredEnv = []; + }; + }; + in { + packages = lib.genAttrs systems (system: + let + goplaces = (root.packages.${system} or {}).goplaces or null; + in + if goplaces == null then {} + else { goplaces = goplaces; } + ); + + openclawPlugin = pluginFor; + }; +} diff --git a/tools/goplaces/skills/goplaces/SKILL.md b/tools/goplaces/skills/goplaces/SKILL.md new file mode 100644 index 0000000..b3d4eea --- /dev/null +++ b/tools/goplaces/skills/goplaces/SKILL.md @@ -0,0 +1,28 @@ +--- +name: goplaces +description: Google Places API (New) CLI and Go client. +homepage: https://github.com/steipete/goplaces +metadata: {"openclaw":{"emoji":"📍","requires":{"bins":["goplaces"],"env":["GOOGLE_PLACES_API_KEY"]},"primaryEnv":"GOOGLE_PLACES_API_KEY","install":[{"id":"brew","kind":"brew","formula":"steipete/tap/goplaces","bins":["goplaces"],"label":"Install goplaces (brew)"}]}} +--- + +# goplaces + +Use `goplaces` for the Google Places API (New). + +API key +- `GOOGLE_PLACES_API_KEY` + +Quick start +- `goplaces search "coffee" --lat 40.8065 --lng -73.9719 --radius-m 3000 --limit 5` +- `goplaces autocomplete "cof" --session-token "goplaces-demo" --limit 5` +- `goplaces details --photos --reviews` +- `goplaces nearby --lat 47.6062 --lng -122.3321 --radius-m 1500 --type cafe --limit 5` +- `goplaces route "coffee" --from "Seattle, WA" --to "Portland, OR"` + +Output tips +- Use `--json` for machine output. +- Add `--no-color` when piping. + +Notes +- Long flags accept `--flag=value` or `--flag value`. +- Routes API must be enabled for `route` searches.