ula-cli
v0.0.4
Published
ULA Components CLI - Download and manage components from private repositories
Maintainers
Readme
@ula/cli
A lightweight CLI tool for downloading and managing ULA components from private repositories.
Features
- 🚀 Lightweight: Minimal dependencies, fast installation
- 🔐 Flexible Authentication: Support for SSH keys, HTTPS credentials, and tokens
- 📦 Smart Component Management: Install, update, and uninstall components on-demand
- 🌐 Multi-Platform: Support for Bitbucket, GitHub, and GitLab
- ⚙️ Environment Variables: Easy configuration via environment variables
- 📁 Sparse Cloning: Only download the components you need
Installation
npm install -g @ula/cliQuick Start
Configure your repository:
ula configureList available components:
ula listInstall a component:
ula install buttonCheck status:
ula status
Configuration
Interactive Configuration
Run ula configure to set up your repository settings interactively.
Environment Variables
You can also configure the CLI using environment variables:
# Repository settings
export ULA_REPO_TYPE=bitbucket
export ULA_REPO_URL=https://bitbucket.org/your-workspace/your-repo
export ULA_REPO_BRANCH=main
# Authentication (choose one method)
export ULA_SSH_KEY_PATH=~/.ssh/id_rsa
# OR
export ULA_USERNAME=your-username
export ULA_PASSWORD=your-app-password
# OR
export ULA_TOKEN=your-access-token
# Local settings
export ULA_LOCAL_PATH=./src/componentsConfiguration File
The CLI creates a .ula-config.json file in your project root:
{
"repository": {
"type": "bitbucket",
"url": "https://bitbucket.org/your-workspace/your-repo",
"branch": "main",
"sshKeyPath": "~/.ssh/id_rsa"
},
"components": ["button", "input"],
"localPath": "./src/components"
}Commands
ula configure
Interactive configuration wizard for repository settings.
ula list
List all available components in the repository.
ula install <component>
Install a specific component.
Options:
-f, --force: Force reinstall if already installed--no-dependencies: Skip installing dependencies
ula uninstall <component>
Uninstall a specific component.
ula update <component>
Update a specific component to the latest version.
ula update-all
Update all installed components.
ula status
Show installation status and configuration.
Repository Structure
Your private repository should have this structure:
your-repo/
├── components/
│ ├── button/
│ │ ├── index.ts
│ │ ├── package.json
│ │ └── ...
│ ├── input/
│ │ ├── index.ts
│ │ ├── package.json
│ │ └── ...
│ └── ...
└── ...Each component should have:
index.ts- Export statementspackage.json- Dependencies (optional)- Component files
Authentication Methods
SSH Keys (Recommended)
export ULA_SSH_KEY_PATH=~/.ssh/id_rsaHTTPS with Username/Password
export ULA_USERNAME=your-username
export ULA_PASSWORD=your-app-passwordHTTPS with Access Token
export ULA_TOKEN=your-access-tokenExamples
Install with SSH
export ULA_REPO_TYPE=bitbucket
export ULA_REPO_URL=https://bitbucket.org/myteam/components
export ULA_SSH_KEY_PATH=~/.ssh/bitbucket_key
ula install buttonInstall with Token
export ULA_REPO_TYPE=github
export ULA_REPO_URL=https://github.com/myorg/components
export ULA_TOKEN=ghp_xxxxxxxxxxxxxxxx
ula install inputForce Reinstall
ula install button --forceSkip Dependencies
ula install button --no-dependenciesDevelopment
Building
npm run buildDevelopment Mode
npm run devPublishing
npm publishTroubleshooting
Permission Denied
Make sure your SSH key has the correct permissions:
chmod 600 ~/.ssh/id_rsaAuthentication Failed
- Verify your credentials are correct
- For Bitbucket, use App Passwords instead of your account password
- For GitHub, ensure your token has the correct scopes
Component Not Found
- Check the component exists in the
components/directory - Verify you're on the correct branch
- Ensure the component has an
index.tsfile
License
MIT
