| Crates.io | robin_cli_tool |
| lib.rs | robin_cli_tool |
| version | 1.0.2 |
| created_at | 2025-01-24 01:17:59.319694+00 |
| updated_at | 2025-02-11 22:58:51.35886+00 |
| description | A CLI tool to run scripts for any project |
| homepage | https://github.com/cesarferreira/robin |
| repository | https://github.com/cesarferreira/robin |
| max_upload_size | |
| id | 1528882 |
| size | 2,664,350 |
Your own customizable CLI tool
Maintaining a simple JSON file with all the available tasks allows for easy customization of deployment, release, cleaning, and other project-specific actions. This ensures that everyone on the team can use, edit, and add tasks on a project level.
.robin.json# From crates.io
cargo install robin_cli_tool
# From source
cargo install --path .
robin init
This creates a .robin.json file in your current directory with some template scripts.
# Initialize with a specific template
robin init --template android # Android project template
robin init --template ios # iOS project template
robin init --template flutter # Flutter project template
robin init --template rails # Ruby on Rails project template
robin init --template node # Node.js/TypeScript project template
robin init --template nextjs # Next.js project template
robin init --template python # Python project template
robin init --template rust # Rust project template
robin init --template go # Go project template
Each template comes with a curated set of useful commands for that specific platform or framework. For example:
If a .robin.json file already exists, you'll be prompted to confirm before overriding it.
robin --list
robin --interactive # or -i
robin add "deploy" "fastlane deliver --submit-to-review"
robin deploy staging
robin release beta
The .robin.json file supports both single commands and command sequences:
{
"scripts": {
"clean": "rm -rf build/",
"deploy": "echo 'ruby deploy tool --{{env=[staging,production]}}'",
"prep-and-deploy": [
"robin clean",
"robin build",
"robin deploy --env=production"
],
"full-release": [
"flutter clean",
"flutter pub get",
"flutter build ios",
"cd ios && fastlane beta"
]
}
}
When using command sequences (arrays):
Robin supports including external configuration files, which is particularly useful for monorepos or sharing common scripts across projects:
{
"include": [
"../common/robin.base.json",
"./team-specific.json"
],
"scripts": {
"local-dev": "npm run dev",
"test": "npm run test"
}
}
Here's a typical monorepo structure using shared scripts:
monorepo/
├── common/
│ └── robin.base.json # Shared scripts for all projects
├── frontend/
│ ├── .robin.json # Frontend-specific scripts
│ └── package.json
├── backend/
│ ├── .robin.json # Backend-specific scripts
│ └── package.json
└── mobile/
├── .robin.json # Mobile-specific scripts
└── pubspec.yaml
common/robin.base.json:
{
"scripts": {
"lint": "eslint .",
"format": "prettier --write .",
"docker:up": "docker-compose up -d",
"docker:down": "docker-compose down",
"ci:test": [
"npm ci",
"npm run test"
]
}
}
frontend/.robin.json:
{
"include": ["../common/robin.base.json"],
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"deploy:staging": [
"robin docker:down",
"robin build",
"robin docker:up"
]
}
}
mobile/.robin.json:
{
"include": ["../common/robin.base.json"],
"scripts": {
"dev": "flutter run",
"build:android": "flutter build apk",
"build:ios": "flutter build ios",
"deploy:beta": [
"robin build:{{platform=[ios,android]}}",
"fastlane {{platform}} beta"
]
}
}
Scripts from included files are merged with local scripts, where local scripts take precedence. This allows you to:
Use {{variable}} in your scripts and pass them as --variable=XXX when running the command:
{
"scripts": {
"deploy": "fastlane {{platform}} {{env}}"
}
}
Then run:
robin deploy --platform=ios --env=staging
You can specify default values for variables using {{variable=default}} syntax:
{
"scripts": {
"build": "echo \"Building {{mode=debug}}\"",
"deploy": "echo \"Deploying to {{env=staging}} with version {{version=latest}}\""
}
}
Using default values:
robin build # Will use default: debug
robin deploy # Will use defaults: staging and latest
# Override defaults:
robin build --mode=release # Will use: release
robin deploy --env=prod --version=1.0.0 # Will use: prod and 1.0.0
You can restrict variable values to a specific set using {{variable=[value1, value2, ...]}} syntax:
{
"scripts": {
"deploy": "echo \"Deploying to {{env=[staging, prod]}}\"",
"build": "cargo build --{{mode=[debug, release]}}",
"deploy:app": "fastlane {{platform=[ios, android]}} {{env=[dev, staging, prod]}} --track={{track=[alpha, beta, production]}}"
}
}
Using enum validation:
# Simple validation
robin deploy --env=staging # Works: 'staging' is allowed
robin deploy --env=prod # Works: 'prod' is allowed
robin deploy --env=dev # Fails: only 'staging' or 'prod' are allowed
# Build modes
robin build --mode=debug # Works: 'debug' is allowed
robin build --mode=release # Works: 'release' is allowed
robin build --mode=test # Fails: only 'debug' or 'release' are allowed
# Multiple validations
robin deploy:app \
--platform=ios \
--env=staging \
--track=beta # Works: all values are allowed
robin deploy:app \
--platform=web \ # Fails: 'web' is not in [ios, android]
--env=staging \
--track=beta
Variables work in both single commands and command sequences:
{
"scripts": {
"deploy-sequence": [
"flutter clean",
"flutter build {{platform=[ios,android]}}",
"fastlane {{platform}} beta"
]
}
}
The doctor command helps verify your development environment is properly set up:
robin doctor
This will check:
Example output:
🔍 Checking development environment...
📦 Required Tools:
✅ Cargo: cargo 1.75.0
✅ Rust: rustc 1.75.0
✅ Ruby: ruby 3.2.2
✅ Fastlane: fastlane 2.217.0
❌ Flutter not found
✅ Node.js: v20.10.0
✅ npm: 10.2.3
🔧 Environment Variables:
✅ ANDROID_HOME is set
✅ JAVA_HOME is set
❌ FLUTTER_ROOT is not set
📱 Platform Tools:
✅ Android Debug Bridge (adb): Android Debug Bridge version 1.0.41
✅ Xcode Command Line Tools: installed
✅ CocoaPods: 1.14.3
🔐 Git Configuration:
✅ Git user.name is set
✅ Git user.email is set
To update all development tools to their latest versions:
robin doctor:update
This will update:
MIT © Cesar Ferreira