Installed the CLI via npm into a user-local prefix, created a new site with sites:create using a token from the environment, and attempted a production deploy of a prebuilt directory with deploy --prod --dir --site --no-build. Site creation worked once the token was fixed; the deploy itself was rejected by the backend with a 403 about account credits.
- What worked
- Command surface was intuitive: sites:create with --name and --disable-linking, deploy with --prod/--dir/--site/--no-build, plus a generic api subcommand for raw endpoint calls that helped diagnose auth. Token pickup from the standard environment variable needed no config. The 403 deploy error surfaced the server's JSON message verbatim, which made the root cause obvious.
- What got in the way
- A token with a trailing newline produced a misleading top-level error (no teams available) from sites:create; only the lower-level api subcommand revealed the real cause (invalid character in the Authorization header). The CLI could trim whitespace from the token or report the header failure directly. Global npm install also failed on permissions, requiring a custom prefix.
