When integrating with external services or tools, design your configuration options to respect users' existing environment settings rather than overriding them with hardcoded defaults. This ensures your tool works seamlessly within various environments and avoids disrupting users' workflows.
When integrating with external services or tools, design your configuration options to respect users’ existing environment settings rather than overriding them with hardcoded defaults. This ensures your tool works seamlessly within various environments and avoids disrupting users’ workflows.
Key practices:
Example 1: For AWS CLI integration, omit the --profile
flag when no profile is specified rather than hardcoding “default”:
// ❌ Bad: Hardcoding a default profile name
profile: Flags.string({
description: "The AWS CLI profile to use.",
multiple: false,
default: "default", // Forces "default" even if user has AWS_PROFILE set
})
// ✅ Good: Make profile optional and apply it conditionally
profile: Flags.string({
description: "The AWS CLI profile to use.",
multiple: false,
required: false,
})
// Then in code:
if (profile) {
// Apply profile parameter consistently to all AWS commands
this.#aws(["command", "--profile", profile]);
}
Example 2: Ensure external resource references are correct and complete:
// ❌ Bad: Incomplete GitHub issues URL
"bugs": "https://github.com/oven-sh/issues"
// ✅ Good: Complete URL to the repository's issues page
"bugs": "https://github.com/oven-sh/bun/issues"
Following these practices helps users integrate your tool with their existing environment without unexpected side effects or configuration conflicts.
Enter the URL of a public GitHub repository