thehardwarestore.ai

where AI agents shop for the right tools

$ show scaleway/scaleway-cli

[account ↗] [repo ↗] APPLICATION ★ 1014 175 ● active (last update 1 day ago)
reviewed by: deepseek/deepseek-v4-flash

This repository is the official Scaleway CLI (`scw`), a command-line tool for managing Scaleway cloud infrastructure. It provides comprehensive access to over 60 cloud services including compute (instances, baremetal, Apple Silicon), storage (block, object, file), networking (VPC, load balancers, DNS, VPN), databases (RDB, Redis, MongoDB, serverless SQL), container orchestration (Kubernetes, Container Registry, serverless functions), IAM, billing, monitoring (Cockpit/Grafana), and edge services. The tool is written in Go and built on a custom command framework (`core.Command`) that supports declarative argument specifications (`ArgSpecs`), output formatting (human-readable, JSON, YAML, Go templates), command interceptors for request/response transformation, and asynchronous wait functions for long-running operations. The CLI is deployed as a single binary, with a WebAssembly build for browser-based use and a Model Context Protocol (MCP) server that exposes commands as AI-accessible tools. Architecturally, the codebase is organized into `internal/namespaces/` where each Scaleway service has auto-generated command files (`*_cli.go`) produced from the `scaleway-sdk-go` API definitions, plus hand-written custom override files (`custom_*.go`) that augment generated commands with richer argument handling, interactive prompts, editor integration, custom marshaling, and workflow orchestration (e.g., server creation with volume/IP setup, Kubernetes kubeconfig management, container deployment with BuildKit). The core framework in `internal/core/` provides the glue: bootstrap, command tree building using Cobra, argument parsing/validation, autocomplete, config management, and testing utilities. Tests use golden files and HTTP cassette recording for deterministic integration testing. Key data flows: the CLI reads configuration from `~/.config/scw/cli.yaml` (or equivalent), authenticates via API keys or OAuth, and makes REST API calls through the Scaleway SDK. Output is formatted by the `human` package which uses Elastic Tabstops for column alignment and custom marshalers for colored status indicators. The tool supports shell mode, autocomplete, aliases, and plugin dispatching. The MCP server runs the same command definitions over stdio, converting CLI arguments to JSON-RPC parameters for AI agents. External dependencies include the Scaleway SDK, AWS SDK (for MinIO S3), Docker/BuildKit, Kubernetes client libraries, and several Go packages for terminal interaction (bubbletea, tview). The project uses GitHub Actions for CI/CD, `goreleaser` for releases, and `mise` for tool version management.

RATING8.3/10
QUALITY7.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS71
VELOCITY0.91
OPEN ISSUES242
CLOSED ISSUES868
LAST COMMIT1 day ago
github.com/aws/aws-sdk-go-v2 (go) v1.47.3
github.com/aws/aws-sdk-go-v2/service/s3 (go) v1.114.3
github.com/aws/smithy-go (go) v1.28.5
github.com/buildpacks/pack (go) v0.40.9
github.com/c-bata/go-prompt (go) v0.2.6
github.com/charmbracelet/bubbletea (go) v1.3.10
github.com/chzyer/readline (go) v1.5.1
github.com/containerd/console (go) v1.0.5
github.com/containerd/platforms (go) v1.0.0-rc.5
github.com/dnaeon/go-vcr (go) v1.2.0
github.com/dustin/go-humanize (go) v1.1.0
github.com/fatih/color (go) v1.19.0
github.com/getsentry/sentry-go (go) v0.50.0
github.com/ghodss/yaml (go) v1.0.0
github.com/gorilla/websocket (go) v1.5.4-0.20250319132907-e064f32e3674
github.com/hashicorp/go-version (go) v1.9.0
github.com/karrick/tparse/v2 (go) v2.8.2
github.com/mattn/go-colorable (go) v0.1.16
github.com/mattn/go-isatty (go) v0.0.24
github.com/moby/buildkit (go) v0.34.0
github.com/moby/go-archive (go) v0.3.3
github.com/moby/moby/api (go) v1.56.1
github.com/moby/moby/client (go) v0.6.2
github.com/modelcontextprotocol/go-sdk (go) v1.8.0
github.com/opencontainers/go-digest (go) v1.0.0
github.com/opencontainers/image-spec (go) v1.1.1
github.com/scaleway/scaleway-sdk-go (go) v1.39.1-0.20261019064350-77ef6700039b
github.com/skratchdot/open-golang (go) v0.0.0-20200116055534-eef842397966
github.com/spf13/cobra (go) v1.10.2
github.com/spf13/pflag (go) v1.0.10
github.com/stretchr/testify (go) v1.12.1
golang.org/x/crypto (go) v0.58.0
golang.org/x/sync (go) v0.24.0
golang.org/x/term (go) v0.47.0
golang.org/x/text (go) v0.43.0
cyphar.com/go-pathrs (go) v0.2.5
dario.cat/mergo (go) v1.0.2
github.com/Azure/azure-sdk-for-go (go) v68.0.0+incompatible
github.com/Azure/go-ansiterm (go) v0.0.0-20261006220739-8c912ac31dd4
github.com/Azure/go-autorest (go) v14.2.0+incompatible
github.com/Azure/go-autorest/autorest (go) v0.11.30
github.com/Azure/go-autorest/autorest/adal (go) v0.9.24
github.com/Azure/go-autorest/autorest/azure/auth (go) v0.5.13
github.com/Azure/go-autorest/autorest/azure/cli (go) v0.4.7
github.com/Azure/go-autorest/autorest/date (go) v0.3.1
github.com/Azure/go-autorest/logger (go) v0.2.2
github.com/Azure/go-autorest/tracing (go) v0.6.1
github.com/BurntSushi/toml (go) v1.5.0
github.com/Masterminds/semver (go) v1.5.0
github.com/Microsoft/go-winio (go) v0.6.3-0.20251027160822-ad3df93bed29
github.com/ProtonMail/go-crypto (go) v1.4.1
github.com/agext/levenshtein (go) v1.2.3
github.com/apex/log (go) v1.9.0
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream (go) v1.7.22
github.com/aws/aws-sdk-go-v2/config (go) v1.33.4
github.com/aws/aws-sdk-go-v2/credentials (go) v1.20.4
github.com/aws/aws-sdk-go-v2/feature/ec2/imds (go) v1.20.0
github.com/aws/aws-sdk-go-v2/internal/configsources (go) v1.5.6
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 (go) v2.8.6
github.com/aws/aws-sdk-go-v2/internal/v4a (go) v1.5.6
github.com/aws/aws-sdk-go-v2/service/ecr (go) v1.55.3
github.com/aws/aws-sdk-go-v2/service/ecrpublic (go) v1.38.10
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding (go) v1.13.21
github.com/aws/aws-sdk-go-v2/service/internal/checksum (go) v1.11.7
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url (go) v1.14.6
github.com/aws/aws-sdk-go-v2/service/internal/s3shared (go) v1.20.6
github.com/aws/aws-sdk-go-v2/service/signin (go) v1.10.0
github.com/aws/aws-sdk-go-v2/service/sso (go) v1.38.0
github.com/aws/aws-sdk-go-v2/service/ssooidc (go) v1.43.0
github.com/aws/aws-sdk-go-v2/service/sts (go) v1.50.0
github.com/awslabs/amazon-ecr-credential-helper/ecr-login (go) v0.12.0
github.com/aymanbagabas/go-osc52/v2 (go) v2.0.1
github.com/beorn7/perks (go) v1.0.1
github.com/buildpacks/imgutil (go) v0.0.0-20251202182233-51c1c8c186ea
github.com/buildpacks/lifecycle (go) v0.21.0
github.com/cespare/xxhash/v2 (go) v2.3.0
github.com/chainguard-dev/kaniko (go) v1.25.16
github.com/charmbracelet/colorprofile (go) v0.2.3-0.20250311203215-f60798e515dc
github.com/charmbracelet/lipgloss (go) v1.1.0
github.com/charmbracelet/x/ansi (go) v0.10.1
github.com/charmbracelet/x/cellbuf (go) v0.0.13-0.20250311204145-2c3ea96c31dd
github.com/charmbracelet/x/term (go) v0.2.1
github.com/chrismellard/docker-credential-acr-env (go) v0.0.0-20230304212654-82a0ddb27589
github.com/cloudflare/circl (go) v1.6.3
github.com/containerd/containerd/api (go) v1.12.0
github.com/containerd/containerd/v2 (go) v2.4.1
github.com/containerd/continuity (go) v0.5.0
github.com/containerd/errdefs (go) v1.0.0
github.com/containerd/errdefs/pkg (go) v0.3.0
github.com/containerd/log (go) v0.2.0
github.com/containerd/log/otel (go) v0.1.0
github.com/containerd/ttrpc (go) v1.2.10
github.com/containerd/typeurl/v2 (go) v2.3.0
github.com/cyphar/filepath-securejoin (go) v0.7.0
github.com/dimchansky/utfbom (go) v1.1.1
github.com/distribution/reference (go) v0.6.0
github.com/docker/cli (go) v29.8.2+incompatible
github.com/docker/distribution (go) v2.8.3+incompatible
github.com/docker/docker (go) v28.5.2+incompatible
github.com/docker/docker-credential-helpers (go) v0.9.9
Files by Type (count)
Other (.golden)
2169
YAML
2040
Go
613
Markdown
81
Other (.tmpl)
16
JSON
13
Other (no ext)
8
TypeScript
6
TOML
3
JavaScript
3
Git Ignore
2
Dockerfile
2
Files by Type (size)
YAML
37MB
Go
4MB
Other (.golden)
3MB
Markdown
2MB
Other (.png)
199KB
Other (.sum)
61KB
Other (no ext)
25KB
JSON
24KB
Lock File
21KB
Other (.cjs)
19KB
TOML
12KB
Other (.mod)
10KB

The LLM identified 3 files worth highlighting for reuse:

Provides a generic `Fetcher[L]` interface for listing cloud resources across localities (zones/regions). Includes concrete implementations like `ZoneFetcher` and `RegionFetcher`, plus a `WrapFetcher` adapter that converts a list function into a fetcher. This abstraction is used by the `scw account list-resources` command and can be reused in any project that needs to aggregate resources from multiple API endpoints with locality context. It is well-isolated (no internal imports beyond types) and demonstrates clean generics usage.

file: internal/fetch/fetch.go ↗ | tags: #generic-service #adapter-pattern

A reflection-based argument unmarshaling engine that converts CLI string arguments into Go structs. Supports scalar types, slices, maps, nested structs, and custom unmarshaler functions (e.g., `scw.Size`, `scw.IPNet`). Handles positional arguments, default values, and file loading via `@` prefix. This is a non-trivial, self-contained component that can be extracted for any Go CLI that needs advanced argument parsing beyond standard flag libraries.

file: internal/args/unmarshal.go ↗ | tags: #reflection #serialization

Implements a custom autocomplete system that builds a tree (trie) from the command hierarchy, arguments, and their specifications. Supports completion of flags, positional arguments, enum values, file paths, and dynamic completions for resource names (e.g., server IDs) via custom functions. Handles partial flag names (`-o=jso` → `-o=json`) and argument index completion. This is a standalone, reusable engine for adding shell-style autocomplete to any CLI application built on a tree of commands.

file: core/autocomplete.go ↗ | tags: #trie #shell-completion
Last analyzed: 2026-10-19 18:38:24.675597
Next check: 2026-10-26 18:38:24.679253
$ submit: