A CLI tool to manage Netlify subdomains without using the web UI. Perfect for developers who prefer the command line.
🎉 v1.1.0 Update: Full automation! No more manual steps in the Netlify UI!
- ✅ Add subdomains to any Netlify site from the command line
- ✅ Remove subdomains just as easily
- ✅ Use aliases for frequently accessed sites
- ✅ Track recently added domains
- ✅ List all your sites and DNS zones
- ✅ Works with any domain managed by Netlify DNS
npm install -g netlify-subdomain
Or install from this directory:
npm link
# Add to current directory's site
netlify-subdomain add blog
# Add to specific site using alias
netlify-subdomain add api danielle.world juice
# Add to site by name
netlify-subdomain add docs danielle.world my-docs-site
netlify-subdomain remove blog.danielle.world
netlify-subdomain alias blog my-blog-site
netlify-subdomain alias juice juice-box-musical
# List all sites (shows aliases)
netlify-subdomain list-sites
# List DNS zones
netlify-subdomain list-zones
# List recently added domains
netlify-subdomain list-recent
netlify-subdomain config
The tool stores configuration in ~/.netlify-subdomain-config.json
:
{
"defaultDomain": "danielle.world",
"aliases": {
"juice": "juice-box-musical",
"wedding": "melodic-longma-cade27",
"recipes": "gleeful-profiterole-f78030"
},
"recentDomains": []
}
- Node.js 18 or higher
- Netlify CLI (for authentication)
- Domain must be managed by Netlify DNS
This tool uses the Netlify API to:
- Create DNS records in your Netlify DNS zones
- Add domain aliases to your Netlify sites
- Manage your subdomains programmatically
The Netlify web UI is great, but adding subdomains requires multiple clicks and page loads. This tool makes it as simple as typing a single command.
MIT