basoltin
v1.2.0
Published
CLI tool to download and install Basolt project templates
Maintainers
Readme
Basolt CLI
A command-line tool to download and install Basolt project templates.
Installation
You can use basoltin directly with npx without installing it globally:
npx basoltin "https://api.basolt.com/install/<uuid>?t=<TOKEN>"Usage
npx basoltin "https://api.basolt.com/install/<uuid>?t=<TOKEN>"Examples
npx basoltin "https://api.basolt.com/install/abc-123?t=YOUR_TOKEN"How It Works
- Parse Arguments: The CLI reads the full API URL you provide.
- API Request (Signed URL): Calls
https://api.basolt.com/install/<template>?t=<token>to retrieve a Supabase signed URL. - Download: Uses the signed URL to download the
.tar.gzarchive. - Extract: Streams and extracts into the current directory with
--strip-components=1behavior (removes the parent folder). - Success: Logs success or error details.
Error Handling
The CLI provides clear error messages for common scenarios:
- 401 Unauthorized: Invalid or missing token
- 403 Forbidden: No access to the template
- 404 Not Found: Template doesn't exist
- 500 Server Error: API server issues
Safety Features
- Uses
tar.xwithstrip: 1to cleanly unpack templates - Does not auto-run arbitrary scripts from the tarball
- Validates response status codes before extraction
- Creates the current directory if it doesn't exist
Development
Install Dependencies
npm installTest Locally
node bin/basolt.js "https://api.basolt.com/install/<uuid>?t=<TOKEN>"Publish to npm
# Login to npm (first time only)
npm login
# Publish the package
npm publishRequirements
- Node.js >= 14.0.0
Dependencies
node-fetch: HTTP client for API requeststar: Tar archive extraction
License
MIT
